From c2505b344d7369497cbd957eeab08b87392d20e6 Mon Sep 17 00:00:00 2001 From: Nikkuss Date: Sun, 15 Feb 2026 01:41:34 +0400 Subject: [PATCH] fix again --- nix/flakeModule.nix | 60 +++++++++++++++++++++++---------------------- 1 file changed, 31 insertions(+), 29 deletions(-) diff --git a/nix/flakeModule.nix b/nix/flakeModule.nix index fffad99..85d41d2 100644 --- a/nix/flakeModule.nix +++ b/nix/flakeModule.nix @@ -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 {