forked from Fediversity/Fediversity
Full resource for forgejo-ci
This commit is contained in:
parent
f4a1a1650b
commit
09ea1acdbe
1 changed files with 34 additions and 4 deletions
|
@ -1,5 +1,20 @@
|
||||||
{ inputs, ... }:
|
{ lib, inputs, ... }:
|
||||||
|
|
||||||
|
## NOTE: Hackish solution mostly taken from `../common/resource.nix`.
|
||||||
|
## Eventually, `forgejo-ci` should move to a datacentre somewhere and this code
|
||||||
|
## should be integrated with the code for other machines (in particular VMs).
|
||||||
|
|
||||||
|
let
|
||||||
|
inherit (lib) attrValues elem;
|
||||||
|
inherit (lib.attrsets) concatMapAttrs optionalAttrs;
|
||||||
|
inherit (lib.strings) removeSuffix;
|
||||||
|
|
||||||
|
secretsPrefix = ../../secrets;
|
||||||
|
secrets = import (secretsPrefix + "/secrets.nix");
|
||||||
|
keys = import ../../keys;
|
||||||
|
hostPublicKey = keys.systems.forgejo-ci;
|
||||||
|
|
||||||
|
in
|
||||||
{
|
{
|
||||||
nixops4Deployments.forgejo-ci =
|
nixops4Deployments.forgejo-ci =
|
||||||
{ providers, ... }:
|
{ providers, ... }:
|
||||||
|
@ -12,12 +27,27 @@
|
||||||
|
|
||||||
ssh = {
|
ssh = {
|
||||||
host = "45.142.234.216";
|
host = "45.142.234.216";
|
||||||
opts = "-J orianne";
|
opts = "-J orianne"; # FIXME
|
||||||
hostPublicKey = (import ../../keys).systems.forgejo-ci;
|
hostPublicKey = hostPublicKey;
|
||||||
};
|
};
|
||||||
|
|
||||||
nixpkgs = inputs.nixpkgs;
|
nixpkgs = inputs.nixpkgs;
|
||||||
nixos.module = import ./configuration.nix;
|
|
||||||
|
nixos.module = {
|
||||||
|
imports = [
|
||||||
|
inputs.agenix.nixosModules.default
|
||||||
|
./configuration.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
age.secrets = concatMapAttrs (
|
||||||
|
name: secret:
|
||||||
|
optionalAttrs (elem hostPublicKey secret.publicKeys) ({
|
||||||
|
${removeSuffix ".age" name}.file = secretsPrefix + "/${name}";
|
||||||
|
})
|
||||||
|
) secrets;
|
||||||
|
|
||||||
|
users.users.root.openssh.authorizedKeys.keys = attrValues keys.contributors;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue