From 0e2fb13ecfcc7130a73b7efb4e9d5f6394016c2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20H=C3=A4ring?= Date: Sun, 15 May 2022 20:03:52 +0200 Subject: [PATCH] remove newlines in recipient keys file if not removed, empty lines will be added to the final encryption command as --recipient '' which causes the command to fail with invalid recipient '' --- pkgs/agenix.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/agenix.nix b/pkgs/agenix.nix index ca1c44e..033d666 100644 --- a/pkgs/agenix.nix +++ b/pkgs/agenix.nix @@ -114,7 +114,7 @@ trap "cleanup" 0 2 3 15 function edit { FILE=$1 - KEYS=$((${nixInstantiate} --eval -E "(let rules = import $RULES; in builtins.concatStringsSep \"\n\" rules.\"$FILE\".publicKeys)" | ${sedBin} 's/"//g' | ${sedBin} 's/\\n/\n/g') || exit 1) + KEYS=$((${nixInstantiate} --eval -E "(let rules = import $RULES; in builtins.concatStringsSep \"\n\" rules.\"$FILE\".publicKeys)" | ${sedBin} 's/"//g' | ${sedBin} 's/\\n/\n/g') | ${sedBin} '/^$/d' || exit 1) if [ -z "$KEYS" ] then