mirror of
https://github.com/Mic92/sops-nix.git
synced 2024-12-15 17:50:51 +00:00
Revert "don't substitute binaries"
This reverts commit7711514b85
. Withdb82bcafd4
, 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:
parent
f805f3061a
commit
f88661c9a9
1 changed files with 2 additions and 3 deletions
|
@ -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})
|
||||||
|
|
Loading…
Reference in a new issue