1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2024-12-14 11:57:34 +00:00

users: change default description to null

This commit is contained in:
Michael Hoang 2024-10-22 10:24:06 +11:00
parent ac7932f9de
commit 11c777c719
2 changed files with 9 additions and 3 deletions

View file

@ -168,7 +168,7 @@ in
else
if [ -z "$u" ]; then
echo "creating user ${v.name}..." >&2
sysadminctl -addUser ${lib.escapeShellArgs [ v.name "-UID" v.uid "-GID" v.gid "-fullName" v.description "-home" v.home "-shell" (shellPath v.shell) ]}
sysadminctl -addUser ${lib.escapeShellArgs ([ v.name "-UID" v.uid "-GID" v.gid ] ++ (lib.optionals (v.description != null) [ "-fullName" v.description ]) ++ [ "-home" v.home "-shell" (shellPath v.shell) ])}
dscl . -create ${dsclUser} IsHidden ${if v.isHidden then "1" else "0"}
${optionalString v.createHome "createhomedir -cu ${name}"}
fi

View file

@ -14,12 +14,18 @@
};
description = mkOption {
type = types.str;
default = "";
type = types.nullOr types.nonEmptyStr;
default = null;
example = "Alice Q. User";
description = ''
A short description of the user account, typically the
user's full name.
This defaults to `null` which means, on creation, `sysadminctl`
will pick the description which is usually always {option}`name`.
Using an empty name is not supported and breaks macOS like
making the user not appear in Directory Utility.
'';
};