fix again

This commit is contained in:
2026-02-15 01:41:34 +04:00
parent b6371ad7d8
commit c2505b344d

View File

@@ -94,37 +94,39 @@ in
sops_secrets_map = sops_secrets_map =
host: host:
lib.mkMerge ( lib.mkMerge (
lib.mapAttrsToList ( lib.concatLists (
name: value: lib.mapAttrsToList (
let name: value:
hasHost = (lib.elem host value.hosts) || value.global; let
isYamlOrJson = value.format == "yaml" || value.format == "json"; hasHost = (lib.elem host value.hosts) || value.global;
in isYamlOrJson = value.format == "yaml" || value.format == "json";
( in
( (
[ (
( [
if hasHost && !(isYamlOrJson && value.keys != [ ]) then (
{ if hasHost && !(isYamlOrJson && value.keys != [ ]) then
${name} = { {
inherit (value) format neededForUsers; ${name} = {
sopsFile = inputs.self + "/${cfg.secretsDir}/${name}"; inherit (value) format neededForUsers;
}; sopsFile = inputs.self + "/${cfg.secretsDir}/${name}";
} };
else }
{ } else
) { }
] )
++ (lib.map (v: { ]
"${name}-${v}" = { ++ (lib.map (v: {
inherit (value) format neededForUsers; "${name}-${v}" = {
sopsFile = inputs.self + "/${cfg.secretsDir}/${name}"; inherit (value) format neededForUsers;
key = v; sopsFile = inputs.self + "/${cfg.secretsDir}/${name}";
}; key = v;
}) value.keys) };
}) value.keys)
)
) )
) ) secret_map
) secret_map )
); );
in in
{ {