summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pkgs/darwin-uninstaller/configuration.nix10
1 files changed, 10 insertions, 0 deletions
diff --git a/pkgs/darwin-uninstaller/configuration.nix b/pkgs/darwin-uninstaller/configuration.nix
index 0bdccb9..a2283d8 100644
--- a/pkgs/darwin-uninstaller/configuration.nix
+++ b/pkgs/darwin-uninstaller/configuration.nix
@@ -46,5 +46,15 @@ with lib;
echo >&2
fi
fi
+
+ # grep will return 1 when no lines matched which makes this line fail with `set -eo pipefail`
+ dscl . -list /Users UserShell | { grep "\s/run/" || true; } | awk '{print $1}' | while read -r user; do
+ shell=$(dscl . -read /Users/"$user" UserShell)
+ if [[ "$shell" != */bin/zsh ]]; then
+ echo >&2 "warning: changing $user's shell from $shell to /bin/zsh"
+ fi
+
+ dscl . -create /Users/"$user" UserShell /bin/zsh
+ done
'';
}