From 0a9d5e41f6013a1b8b66573822f9beb827902968 Mon Sep 17 00:00:00 2001 From: pizmovc Date: Sun, 5 Nov 2023 14:40:23 +0100 Subject: [PATCH] fixup! Rename passwordFile to hashedPasswordFile --- pkgs/sops-install-secrets/nixos-test.nix | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/pkgs/sops-install-secrets/nixos-test.nix b/pkgs/sops-install-secrets/nixos-test.nix index d96e6161..487074ef 100644 --- a/pkgs/sops-install-secrets/nixos-test.nix +++ b/pkgs/sops-install-secrets/nixos-test.nix @@ -25,7 +25,7 @@ user-passwords = makeTest { name = "sops-user-passwords"; - nodes.machine = { config, ... }: { + nodes.machine = { config, lib, ... }: { imports = [ ../../modules/sops ]; sops = { age.keyFile = ./test-assets/age-keys.txt; @@ -34,9 +34,16 @@ secrets."nested/test/file".owner = "example-user"; }; - users.users.example-user = { + users.users.example-user = let + passwordFileKey = + if (lib.versionAtLeast (lib.versions.majorMinor lib.version) + "23.11") then + "hashedPasswordFile" + else + "passwordFile"; + in { isNormalUser = true; - hashedPasswordFile = config.sops.secrets.test_key.path; + ${passwordFileKey} = config.sops.secrets.test_key.path; }; };