secrets: improve formatting
This commit is contained in:
parent
73d9d015de
commit
46097b2398
1 changed files with 10 additions and 2 deletions
|
@ -4,7 +4,9 @@ let
|
|||
inherit (lib.our) mkOpt;
|
||||
inherit (lib.types) bool attrsOf path;
|
||||
|
||||
mkSecret = name: nameValuePair (removeSuffix ".age" name) { file = "${./.}/${name}"; };
|
||||
mkSecret = name: nameValuePair
|
||||
(removeSuffix ".age" name)
|
||||
{ file = "${./.}/${name}"; };
|
||||
secrets = listToAttrs (map mkSecret (attrNames (import ./secrets.nix)));
|
||||
|
||||
withOwner = name: secret: secret // { owner = name; group = name; };
|
||||
|
@ -18,7 +20,13 @@ in
|
|||
config = mkIf config.modules.secrets.enable {
|
||||
secrets = mapAttrs (n: v: v.path) config.age.secrets;
|
||||
age.secrets = mkMerge [
|
||||
{ inherit (secrets) "infinidoge-password" "root-password" "binary-cache-private-key"; }
|
||||
{
|
||||
inherit (secrets)
|
||||
"infinidoge-password"
|
||||
"root-password"
|
||||
"binary-cache-private-key"
|
||||
;
|
||||
}
|
||||
(mkIf config.services.nginx.enable {
|
||||
"inx.moe.pem" = withOwner "nginx" secrets."inx.moe.pem";
|
||||
"inx.moe.key" = withOwner "nginx" secrets."inx.moe.key";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue