mirror of
https://github.com/LnL7/nix-darwin.git
synced 2024-12-14 11:57:34 +00:00
users: switch back to using dscl
for deleting users
The previous default behaviour when nix-darwin deletes users is that their home directories are left intact, however as the `-keepHome` flag for `sysadminctl -deleteUser` is broken, we'll need to switch back for now.
This commit is contained in:
parent
b702750226
commit
b089e7e726
1 changed files with 3 additions and 1 deletions
|
@ -189,8 +189,10 @@ in
|
|||
|
||||
requireFDA "$1" deleted
|
||||
|
||||
sysadminctl -deleteUser "$1" 2> /dev/null
|
||||
dscl . -delete "/Users/$1" 2> /dev/null
|
||||
|
||||
# `dscl . -delete` should exit with a non-zero exit code when there's an error, but we'll leave
|
||||
# this code here just in case and for when we switch to `sysadminctl -deleteUser`
|
||||
# We need to check as `sysadminctl -deleteUser` still exits with exit code 0 when there's an error
|
||||
if id "$1" &> /dev/null; then
|
||||
printf >&2 '\e[1;31merror: failed to delete user %s, aborting activation\e[0m\n', "$1"
|
||||
|
|
Loading…
Reference in a new issue