summaryrefslogtreecommitdiff
path: root/modules/users/default.nix
diff options
context:
space:
mode:
authorMichael Hoang <enzime@users.noreply.github.com>2024-10-25 01:16:19 +1100
committerMichael Hoang <enzime@users.noreply.github.com>2024-10-27 21:52:41 +1100
commitdc6f754fe5d3b0d1ee6b033495c87ec3199a7f68 (patch)
tree02108e6de8592ac232f8baff757c8c0255fb0337 /modules/users/default.nix
parent3712ff78ccacd65c819435a310fe8b1a8a2de2ee (diff)
users: allow `shell` to be managed by macOS
Diffstat (limited to 'modules/users/default.nix')
-rw-r--r--modules/users/default.nix4
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/users/default.nix b/modules/users/default.nix
index 0b2ffd9..aee8fec 100644
--- a/modules/users/default.nix
+++ b/modules/users/default.nix
@@ -242,7 +242,7 @@ in
"-GID" v.gid ]
++ (lib.optionals (v.description != null) [ "-fullName" v.description ])
++ (lib.optionals (v.home != null) [ "-home" v.home ])
- ++ [ "-shell" (shellPath v.shell) ])} 2> /dev/null
+ ++ [ "-shell" (if v.shell != null then shellPath v.shell else "/usr/bin/false") ])} 2> /dev/null
# We need to check as `sysadminctl -addUser` still exits with exit code 0 when there's an error
if ! id ${name} &> /dev/null; then
@@ -260,7 +260,7 @@ in
# Update properties on known users to keep them inline with configuration
dscl . -create ${dsclUser} PrimaryGroupID ${toString v.gid}
${optionalString (v.description != null) "dscl . -create ${dsclUser} RealName ${lib.escapeShellArg v.description}"}
- dscl . -create ${dsclUser} UserShell ${lib.escapeShellArg (shellPath v.shell)}
+ ${optionalString (v.shell != null) "dscl . -create ${dsclUser} UserShell ${lib.escapeShellArg (shellPath v.shell)}"}
fi
'') createdUsers}