From 758cdc98f49ba72f4e941933575db8a70f24cfe3 Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Fri, 12 May 2023 11:01:22 +0200 Subject: [PATCH 1/2] Disable shellcheck warning about impossible comparison This shellcheck warning occurs when setting a path for a secret using the home-manager module. Signed-off-by: Sefa Eyeoglu --- modules/age-home.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/age-home.nix b/modules/age-home.nix index 86bfbe0..c3209ab 100644 --- a/modules/age-home.nix +++ b/modules/age-home.nix @@ -48,6 +48,7 @@ with lib; let test "''${#IDENTITIES[@]}" -eq 0 && echo "[agenix] WARNING: no readable identities found!" mkdir -p "$(dirname "$_truePath")" + # shellcheck disable=SC2193 [ "${secretType.path}" != "${cfg.secretsDir}/${secretType.name}" ] && mkdir -p "$(dirname "${secretType.path}")" ( umask u=r,g=,o= @@ -59,6 +60,7 @@ with lib; let mv -f "$TMP_FILE" "$_truePath" ${optionalString secretType.symlink '' + # shellcheck disable=SC2193 [ "${secretType.path}" != "${cfg.secretsDir}/${secretType.name}" ] && ln -sfn "${cfg.secretsDir}/${secretType.name}" "${secretType.path}" ''} ''; From 72205a86cafc06df6a11e1ae9dcef71374cd2cf5 Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Fri, 12 May 2023 20:13:33 +0200 Subject: [PATCH 2/2] Add test for custom secret paths for HM Signed-off-by: Sefa Eyeoglu --- test/integration.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/integration.nix b/test/integration.nix index f719356..e0ee85a 100644 --- a/test/integration.nix +++ b/test/integration.nix @@ -59,6 +59,10 @@ pkgs.nixosTest { # Only decryptable by user1's key file = ../example/secret2.age; }; + secrets.secret2Path = { + file = ../example/secret2.age; + path = "/home/user1/secret2"; + }; }; }; };