summaryrefslogtreecommitdiff
path: root/modules/users
diff options
context:
space:
mode:
authorWael M. Nasreddine <wael.nasreddine@gmail.com>2019-02-21 16:04:59 -0800
committerDaiderd Jordan <daiderd@gmail.com>2019-02-24 22:06:45 +0100
commit7c68f691546b3684719745bf60b9db0eba943b80 (patch)
treeb5c3a77deec76bec94223c244b83e648850d5419 /modules/users
parent303c5fbb0060587bcab4b2f25ac588de49c725ec (diff)
users: create/chown the home only when it is different than /var/empty
Diffstat (limited to 'modules/users')
-rw-r--r--modules/users/default.nix6
1 files changed, 4 insertions, 2 deletions
diff --git a/modules/users/default.nix b/modules/users/default.nix
index c3ef463..daadde3 100644
--- a/modules/users/default.nix
+++ b/modules/users/default.nix
@@ -139,8 +139,10 @@ in
dscl . -create '/Users/${v.name}' RealName '${v.description}'
dscl . -create '/Users/${v.name}' NFSHomeDirectory '${v.home}'
dscl . -create '/Users/${v.name}' UserShell '${v.shell}'
- mkdir -p '${v.home}'
- chown '${toString v.uid}:${toString v.gid}' '${v.home}'
+ ${optionalString (v.home != "/var/empty") ''
+ mkdir -p '${v.home}'
+ chown '${toString v.uid}:${toString v.gid}' '${v.home}'
+ ''}
else
if [ "$u" -ne ${toString v.uid} ]; then
echo "warning: existing user '${v.name}' has unexpected uid $u, skipping..." >&2