1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2025-03-13 20:30:02 +00:00

users: create/chown the home only when it is different than /var/empty

This commit is contained in:
Wael M. Nasreddine 2019-02-21 16:04:59 -08:00 committed by Daiderd Jordan
parent 303c5fbb00
commit 7c68f69154
No known key found for this signature in database
GPG key ID: D02435D05B810C96

View file

@ -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