diff --git a/secrets/secrets.nix b/secrets/secrets.nix index 8d848a02..c2ea257e 100644 --- a/secrets/secrets.nix +++ b/secrets/secrets.nix @@ -1,16 +1,14 @@ let - keys = [ - (builtins.readFile ./publicKeys/aly_fallarbor.pub) - (builtins.readFile ./publicKeys/aly_lavaridge.pub) - (builtins.readFile ./publicKeys/aly_mauville.pub) - (builtins.readFile ./publicKeys/aly_petalburg.pub) - (builtins.readFile ./publicKeys/aly_rustboro.pub) - (builtins.readFile ./publicKeys/root_fallarbor.pub) - (builtins.readFile ./publicKeys/root_lavaridge.pub) - (builtins.readFile ./publicKeys/root_mauville.pub) - (builtins.readFile ./publicKeys/root_petalburg.pub) - (builtins.readFile ./publicKeys/root_rustboro.pub) + hosts = [ + "fallarbor" + "lavaridge" + "mauville" + "petalburg" + "rustboro" ]; + systemKeys = builtins.map (host: builtins.readFile ./publicKeys/root_${host}.pub) hosts; + userKeys = builtins.map (host: builtins.readFile ./publicKeys/aly_${host}.pub) hosts; + keys = systemKeys ++ userKeys; in { "lastFM/apiKey.age".publicKeys = keys; "lastFM/secret.age".publicKeys = keys;