summaryrefslogtreecommitdiff
path: root/modules/users/default.nix
diff options
context:
space:
mode:
authorWael M. Nasreddine <wael.nasreddine@gmail.com>2019-02-23 08:29:57 -0800
committerDaiderd Jordan <daiderd@gmail.com>2019-02-24 22:13:45 +0100
commit41a00f14b4c13a0f765e59fafb69d3d1c461314d (patch)
tree95bec11769e92fadac31ee77d7ed97e032165094 /modules/users/default.nix
parent7c68f691546b3684719745bf60b9db0eba943b80 (diff)
users: gate the creation with an option, false by default and use createhomedir
Diffstat (limited to 'modules/users/default.nix')
-rw-r--r--modules/users/default.nix5
1 files changed, 1 insertions, 4 deletions
diff --git a/modules/users/default.nix b/modules/users/default.nix
index daadde3..e791a49 100644
--- a/modules/users/default.nix
+++ b/modules/users/default.nix
@@ -139,10 +139,7 @@ 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}'
- ${optionalString (v.home != "/var/empty") ''
- mkdir -p '${v.home}'
- chown '${toString v.uid}:${toString v.gid}' '${v.home}'
- ''}
+ ${optionalString v.createHome "createhomedir -cu '${v.name}'"}
else
if [ "$u" -ne ${toString v.uid} ]; then
echo "warning: existing user '${v.name}' has unexpected uid $u, skipping..." >&2