diff --git a/nix/flakeModule.nix b/nix/flakeModule.nix index 556e640..1d9bc94 100644 --- a/nix/flakeModule.nix +++ b/nix/flakeModule.nix @@ -75,9 +75,9 @@ in perSystem: lib.mapAttrsToList ( _: host: - lib.mapAttrsToList ( - _: user: { "${user.userName}@${host.hostName}" = toKeyList (user.sopsPublic or [ ]); } - ) (host.users or { }) + lib.mapAttrsToList (_: user: { + "${user.userName}@${host.hostName}" = toKeyList (user.sopsPublic or [ ]); + }) (host.users or { }) ) perSystem ) (builtins.attrValues den.hosts) ) @@ -139,7 +139,8 @@ in ${name} = { inherit (value) format neededForUsers; sopsFile = inputs.self + "/${cfg.secretsDir}/${name}"; - }; + } + // lib.optionalAttrs (isYamlOrJson && value.keys == [ ]) { key = ""; }; } else { } @@ -182,7 +183,8 @@ in ${name} = { inherit (value) format; sopsFile = inputs.self + "/${cfg.secretsDir}/${name}"; - }; + } + // lib.optionalAttrs (isYamlOrJson && value.keys == [ ]) { key = ""; }; } else { }