Correction secrets.nix

merge-requests/22/head
pigeonmoelleux 2025-06-25 17:37:21 +02:00
parent 6081457da2
commit 02ab2c3aec
No known key found for this signature in database
GPG Key ID: B3BE02E379E6E8E2
1 changed files with 16 additions and 16 deletions

View File

@ -62,7 +62,7 @@ let
# Secrets
commonSecrets = (listFilesRelative ./secrets/common) ++ [
"./secrets/restic/client_env"
"./secrets/restic/client_env.age"
];
acmeSecrets = listFilesRelative ./secrets/acme;
@ -74,21 +74,21 @@ in
# Secrets pour ACME
// (genAttrs acmeSecrets acme)
# Secrets pour restic
// builtins.foldl' (
acc: name:
acc
// (
let
key = hosts.${name};
in
genAttrs
[
"./secrets/restic/${name}/base-repo"
"./secrets/restic/${name}/base-password"
]
[ key ]
)
) { } (lists.remove "thot" hostnames)
// attrsets.foldlAttrs (
outacc: host: key:
let
secrets = listFilesRelative (path.append ./secrets/restic host);
in
outacc
// builtins.foldl' (
acc: secret:
acc
// {
"${secret}".publicKeys = [ key ] ++ nounous;
}
) { } secrets
) { } (lib.filterAttrs (host: _: host != "thot" && host != "cephiroth") hosts)
# Secrets spécifiques à chaque VM
// attrsets.foldlAttrs (
outacc: host: key:
let