nixos/users-group: make homeMode respect is_dry and create home directly with right permissions

main
Federico Beffa 2 years ago
parent 311aa6d05d
commit 572ff94f55
  1. 4
      nixos/modules/config/update-users-groups.pl

@ -223,8 +223,8 @@ foreach my $u (@{$spec->{users}}) {
}
# Ensure home directory incl. ownership and permissions.
if ($u->{createHome}) {
make_path($u->{home}, { mode => 0700 }) if ! -e $u->{home} and ! $is_dry;
if ($u->{createHome} and !$is_dry) {
make_path($u->{home}, { mode => oct($u->{homeMode}) }) if ! -e $u->{home};
chown $u->{uid}, $u->{gid}, $u->{home};
chmod oct($u->{homeMode}), $u->{home};
}

Loading…
Cancel
Save