Ensure that the home directory exists even if the user already exists

Changed files
+5 -5
nixos
modules
+5 -5
nixos/modules/config/update-users-groups.pl
···
} elsif (defined $u->{initialHashedPassword}) {
$u->{hashedPassword} = $u->{initialHashedPassword};
}
+
}
-
# Create a home directory.
-
if ($u->{createHome}) {
-
make_path($u->{home}, { mode => 0700 }) if ! -e $u->{home};
-
chown $u->{uid}, $u->{gid}, $u->{home};
-
}
+
# Create a home directory.
+
if ($u->{createHome} && ! -e $u->{home}) {
+
make_path($u->{home}, { mode => 0700 }) if ! -e $u->{home};
+
chown $u->{uid}, $u->{gid}, $u->{home};
}
if (defined $u->{passwordFile}) {