diff options
author | pennae <82953136+pennae@users.noreply.github.com> | 2023-09-13 19:27:52 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-13 19:27:52 +0200 |
commit | 0af23b2c3b081a9970c3cc6ec9a04243ba07988c (patch) | |
tree | 3ffc3f809032539522213cb3ac4235f085a410f9 | |
parent | c3772a501fe1b4c1e0aed7da11a56676f261a262 (diff) | |
parent | 7d6ee8ce1e3bdc37f00e2b483cc2842f978fabe9 (diff) |
Merge pull request #254919 from rnhmjoj/pr-password
nixos/user-groups: fixup of 5666a378
-rw-r--r-- | nixos/modules/config/update-users-groups.pl | 8 | ||||
-rw-r--r-- | nixos/modules/config/users-groups.nix | 2 | ||||
-rw-r--r-- | nixos/tests/shadow.nix | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/nixos/modules/config/update-users-groups.pl b/nixos/modules/config/update-users-groups.pl index 3785ba8c5fb80..7c6851473f42f 100644 --- a/nixos/modules/config/update-users-groups.pl +++ b/nixos/modules/config/update-users-groups.pl @@ -239,12 +239,12 @@ foreach my $u (@{$spec->{users}}) { chmod oct($u->{homeMode}), $u->{home}; } - if (defined $u->{passwordFile}) { - if (-e $u->{passwordFile}) { - $u->{hashedPassword} = read_file($u->{passwordFile}); + if (defined $u->{hashedPasswordFile}) { + if (-e $u->{hashedPasswordFile}) { + $u->{hashedPassword} = read_file($u->{hashedPasswordFile}); chomp $u->{hashedPassword}; } else { - warn "warning: password file ‘$u->{passwordFile}’ does not exist\n"; + warn "warning: password file ‘$u->{hashedPasswordFile}’ does not exist\n"; } } elsif (defined $u->{password}) { $u->{hashedPassword} = hashPassword($u->{password}); diff --git a/nixos/modules/config/users-groups.nix b/nixos/modules/config/users-groups.nix index 4893d28924ebd..5158974c27b36 100644 --- a/nixos/modules/config/users-groups.nix +++ b/nixos/modules/config/users-groups.nix @@ -264,7 +264,7 @@ let }; passwordFile = mkOption { - type = with types; nullOr (passwdEntry str); + type = with types; nullOr str; default = null; visible = false; description = lib.mdDoc "Deprecated alias of hashedPasswordFile"; diff --git a/nixos/tests/shadow.nix b/nixos/tests/shadow.nix index c9a04088e8709..a027af7e450b5 100644 --- a/nixos/tests/shadow.nix +++ b/nixos/tests/shadow.nix @@ -32,7 +32,7 @@ in import ./make-test-python.nix ({ pkgs, ... }: { }; users.berta = { isNormalUser = true; - hashedPassword = hashed_bcrypt; + hashedPasswordFile = (pkgs.writeText "hashed_bcrypt" hashed_bcrypt).outPath; shell = pkgs.bash; }; users.yesim = { |