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:
parent
303c5fbb00
commit
7c68f69154
1 changed files with 4 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue