forked from Fediversity/Fediversity
Integrate hostPublicKey
with the options
This commit is contained in:
parent
01e2fc8a6f
commit
bd270999f3
1 changed files with 5 additions and 4 deletions
|
@ -6,22 +6,23 @@
|
|||
}:
|
||||
|
||||
let
|
||||
inherit (lib) attrValues elem;
|
||||
inherit (lib) attrValues elem mkDefault;
|
||||
inherit (lib.attrsets) concatMapAttrs optionalAttrs;
|
||||
inherit (lib.strings) removeSuffix;
|
||||
|
||||
secretsPrefix = ../../secrets;
|
||||
secrets = import (secretsPrefix + "/secrets.nix");
|
||||
keys = import ../../keys;
|
||||
hostPublicKey = keys.systems.${config.fediversityVm.name};
|
||||
|
||||
in
|
||||
{
|
||||
imports = [ ./options.nix ];
|
||||
|
||||
fediversityVm.hostPublicKey = mkDefault keys.systems.${config.fediversityVm.name};
|
||||
|
||||
ssh = {
|
||||
host = config.fediversityVm.ipv4.address;
|
||||
hostPublicKey = hostPublicKey;
|
||||
hostPublicKey = config.fediversityVm.hostPublicKey;
|
||||
};
|
||||
|
||||
nixpkgs = inputs.nixpkgs;
|
||||
|
@ -46,7 +47,7 @@ in
|
|||
## as `age.secrets.<name>.file`.
|
||||
age.secrets = concatMapAttrs (
|
||||
name: secret:
|
||||
optionalAttrs (elem hostPublicKey secret.publicKeys) ({
|
||||
optionalAttrs (elem config.fediversityVm.hostPublicKey secret.publicKeys) ({
|
||||
${removeSuffix ".age" name}.file = secretsPrefix + "/${name}";
|
||||
})
|
||||
) secrets;
|
||||
|
|
Loading…
Add table
Reference in a new issue