1
0
Fork 0
mirror of https://github.com/Mic92/sops-nix.git synced 2024-12-14 11:57:52 +00:00

don't substitute binaries

This commit is contained in:
Edward Tjörnhammar 2023-10-14 16:53:21 +02:00 committed by mergify[bot]
parent f995ea1592
commit 7711514b85

View file

@ -90,11 +90,12 @@ in {
tpl = config.sops.templates.${name};
substitute = pkgs.writers.writePython3 "substitute" { }
(readFile ./subs.py);
subst-pairs = pkgs.writeText "pairs" (concatMapStringsSep "\n"
subst-pairs = pkgs.writeText "pairs" (flip (concatMapStringsSep "\n")
(attrNames (filterAttrs (n: v: v ? format && v.format != "binary") config.sops.secrets))
(name:
"${toString config.sops.placeholder.${name}} ${
config.sops.secrets.${name}.path
}") (attrNames config.sops.secrets));
}"));
in ''
mkdir -p "${dirOf tpl.path}"
(umask 077; ${substitute} ${tpl.file} ${subst-pairs} > ${tpl.path})