diff options
| author | Wael M. Nasreddine <wael.nasreddine@gmail.com> | 2019-02-21 16:04:59 -0800 |
|---|---|---|
| committer | Daiderd Jordan <daiderd@gmail.com> | 2019-02-24 22:06:45 +0100 |
| commit | 7c68f691546b3684719745bf60b9db0eba943b80 (patch) | |
| tree | b5c3a77deec76bec94223c244b83e648850d5419 /modules/users | |
| parent | 303c5fbb0060587bcab4b2f25ac588de49c725ec (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.nix | 6 |
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 "[1;31mwarning: existing user '${v.name}' has unexpected uid $u, skipping...[0m" >&2 |
