From f88661c9a9f4ff10b6a5aca18d5caf7d537e3923 Mon Sep 17 00:00:00 2001 From: DDoSolitary Date: Mon, 19 Feb 2024 16:36:11 +0800 Subject: [PATCH] Revert "don't substitute binaries" This reverts commit 7711514b8543891eea6ae84392c74a379c5010de. With db82bcafd43548323a2fdce6774e1137a3c869e7, 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. --- modules/sops/templates/default.nix | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/modules/sops/templates/default.nix b/modules/sops/templates/default.nix index 0a543fd..750a531 100644 --- a/modules/sops/templates/default.nix +++ b/modules/sops/templates/default.nix @@ -90,12 +90,11 @@ in { tpl = config.sops.templates.${name}; substitute = pkgs.writers.writePython3 "substitute" { } (readFile ./subs.py); - subst-pairs = pkgs.writeText "pairs" (flip (concatMapStringsSep "\n") - (attrNames (filterAttrs (n: v: v ? format && v.format != "binary") config.sops.secrets)) + subst-pairs = pkgs.writeText "pairs" (concatMapStringsSep "\n" (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})