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
|
let
|
||||||
inherit (lib) attrValues elem;
|
inherit (lib) attrValues elem mkDefault;
|
||||||
inherit (lib.attrsets) concatMapAttrs optionalAttrs;
|
inherit (lib.attrsets) concatMapAttrs optionalAttrs;
|
||||||
inherit (lib.strings) removeSuffix;
|
inherit (lib.strings) removeSuffix;
|
||||||
|
|
||||||
secretsPrefix = ../../secrets;
|
secretsPrefix = ../../secrets;
|
||||||
secrets = import (secretsPrefix + "/secrets.nix");
|
secrets = import (secretsPrefix + "/secrets.nix");
|
||||||
keys = import ../../keys;
|
keys = import ../../keys;
|
||||||
hostPublicKey = keys.systems.${config.fediversityVm.name};
|
|
||||||
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
imports = [ ./options.nix ];
|
imports = [ ./options.nix ];
|
||||||
|
|
||||||
|
fediversityVm.hostPublicKey = mkDefault keys.systems.${config.fediversityVm.name};
|
||||||
|
|
||||||
ssh = {
|
ssh = {
|
||||||
host = config.fediversityVm.ipv4.address;
|
host = config.fediversityVm.ipv4.address;
|
||||||
hostPublicKey = hostPublicKey;
|
hostPublicKey = config.fediversityVm.hostPublicKey;
|
||||||
};
|
};
|
||||||
|
|
||||||
nixpkgs = inputs.nixpkgs;
|
nixpkgs = inputs.nixpkgs;
|
||||||
|
@ -46,7 +47,7 @@ in
|
||||||
## as `age.secrets.<name>.file`.
|
## as `age.secrets.<name>.file`.
|
||||||
age.secrets = concatMapAttrs (
|
age.secrets = concatMapAttrs (
|
||||||
name: secret:
|
name: secret:
|
||||||
optionalAttrs (elem hostPublicKey secret.publicKeys) ({
|
optionalAttrs (elem config.fediversityVm.hostPublicKey secret.publicKeys) ({
|
||||||
${removeSuffix ".age" name}.file = secretsPrefix + "/${name}";
|
${removeSuffix ".age" name}.file = secretsPrefix + "/${name}";
|
||||||
})
|
})
|
||||||
) secrets;
|
) secrets;
|
||||||
|
|
Loading…
Add table
Reference in a new issue