diff --git a/secrets/flake-part.nix b/secrets/flake-part.nix index 9f9b7f4..aa7a2eb 100644 --- a/secrets/flake-part.nix +++ b/secrets/flake-part.nix @@ -6,7 +6,7 @@ let inherit (builtins) elem; - inherit (lib.attrsets) concatMapAttrs filterAttrs; + inherit (lib.attrsets) concatMapAttrs optionalAttrs; inherit (lib.strings) removeSuffix; secrets = import ./secrets.nix; @@ -27,9 +27,12 @@ in ''; }; - config.age.secrets = concatMapAttrs (name: _: { - ${removeSuffix ".age" name}.file = ./. + "/${name}"; - }) (filterAttrs (_: secret: elem config.x_fediversity.hostPublicKey secret.publicKeys) secrets); + config.age.secrets = concatMapAttrs ( + name: secret: + optionalAttrs (elem config.x_fediversity.hostPublicKey secret.publicKeys) ({ + ${removeSuffix ".age" name}.file = ./. + "/${name}"; + }) + ) secrets; } ); };