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