mirror of
https://github.com/LnL7/nix-darwin.git
synced 2024-12-14 11:57:34 +00:00
users: create the home-directory for a new user
This commit is contained in:
parent
6c6c8f2164
commit
303c5fbb00
1 changed files with 2 additions and 0 deletions
|
@ -139,6 +139,8 @@ in
|
||||||
dscl . -create '/Users/${v.name}' RealName '${v.description}'
|
dscl . -create '/Users/${v.name}' RealName '${v.description}'
|
||||||
dscl . -create '/Users/${v.name}' NFSHomeDirectory '${v.home}'
|
dscl . -create '/Users/${v.name}' NFSHomeDirectory '${v.home}'
|
||||||
dscl . -create '/Users/${v.name}' UserShell '${v.shell}'
|
dscl . -create '/Users/${v.name}' UserShell '${v.shell}'
|
||||||
|
mkdir -p '${v.home}'
|
||||||
|
chown '${toString v.uid}:${toString v.gid}' '${v.home}'
|
||||||
else
|
else
|
||||||
if [ "$u" -ne ${toString v.uid} ]; then
|
if [ "$u" -ne ${toString v.uid} ]; then
|
||||||
echo "[1;31mwarning: existing user '${v.name}' has unexpected uid $u, skipping...[0m" >&2
|
echo "[1;31mwarning: existing user '${v.name}' has unexpected uid $u, skipping...[0m" >&2
|
||||||
|
|
Loading…
Reference in a new issue