nixos/user-groups: fixup of 5666a378

This commit is contained in:
rnhmjoj 2023-09-13 11:43:19 +02:00
parent 51078b896c
commit 205b56cffc
No known key found for this signature in database
GPG Key ID: BFBAF4C975F76450
2 changed files with 5 additions and 5 deletions

View File

@ -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});

View File

@ -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";