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

Revert "don't substitute binaries"

This reverts commit 7711514b85.

With db82bcafd4, we no longer need to
ensure that the pair list only contains utf-8 text, as long as users
don't reference non-utf-8 data in template content.
Fixes Mic92/sops-nix#439.
This commit is contained in:
DDoSolitary 2024-02-19 16:36:11 +08:00 committed by mergify[bot]
parent f805f3061a
commit f88661c9a9

View file

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