From 7c16ad2f7cb2ad8fc593f5f72131c379132f1879 Mon Sep 17 00:00:00 2001 From: Aly Raffauf Date: Mon, 10 Jun 2024 23:14:18 -0400 Subject: [PATCH] secrets: simplified public key loading --- secrets/secrets.nix | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) 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;