summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorFederico Beffa <beffa@fbengineering.ch>2022-05-21 14:18:10 +0200
committerFederico Beffa <beffa@fbengineering.ch>2022-05-23 07:47:11 +0200
commit572ff94f55b8dc9ee230212df72c2d40beefc73e (patch)
treeaeb8acbeb51c509be4e533248a498d1a73d3addd /nixos
parent311aa6d05d57fe1e94d16509b8eff43dbd6dbc7d (diff)
downloadnixpkgs-572ff94f55b8dc9ee230212df72c2d40beefc73e.tar
nixpkgs-572ff94f55b8dc9ee230212df72c2d40beefc73e.tar.gz
nixpkgs-572ff94f55b8dc9ee230212df72c2d40beefc73e.tar.bz2
nixpkgs-572ff94f55b8dc9ee230212df72c2d40beefc73e.tar.lz
nixpkgs-572ff94f55b8dc9ee230212df72c2d40beefc73e.tar.xz
nixpkgs-572ff94f55b8dc9ee230212df72c2d40beefc73e.tar.zst
nixpkgs-572ff94f55b8dc9ee230212df72c2d40beefc73e.zip
nixos/users-group: make homeMode respect is_dry and create home directly with right permissions
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/config/update-users-groups.pl4
1 files changed, 2 insertions, 2 deletions
diff --git a/nixos/modules/config/update-users-groups.pl b/nixos/modules/config/update-users-groups.pl
index 6ceb668a595..5a21cb45d52 100644
--- a/nixos/modules/config/update-users-groups.pl
+++ b/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};
     }