diff options
| author | Michael Hoang <enzime@users.noreply.github.com> | 2024-11-11 23:05:03 +1100 |
|---|---|---|
| committer | Michael Hoang <enzime@users.noreply.github.com> | 2024-11-17 01:11:27 +1100 |
| commit | e07f08c0dcbf2f10a51f76ac2910c25e25ff4d84 (patch) | |
| tree | e1fc03c9ab6f52b57b06d8b43fc917b41dcca453 | |
| parent | 6d20de4ed606846230f766cc059bf01b47b8e2d4 (diff) | |
uninstaller: fix restoring nix-daemon launchd daemon
| -rw-r--r-- | pkgs/darwin-uninstaller/configuration.nix | 3 | ||||
| -rw-r--r-- | pkgs/darwin-uninstaller/default.nix | 4 |
2 files changed, 6 insertions, 1 deletions
diff --git a/pkgs/darwin-uninstaller/configuration.nix b/pkgs/darwin-uninstaller/configuration.nix index 75d1cac..295477a 100644 --- a/pkgs/darwin-uninstaller/configuration.nix +++ b/pkgs/darwin-uninstaller/configuration.nix @@ -12,6 +12,9 @@ with lib; launchd.daemons = mkForce {}; launchd.user.agents = mkForce {}; + # Don't try to reload `nix-daemon` + nix.useDaemon = mkForce false; + system.activationScripts.postUserActivation.text = mkAfter '' if [[ -L ~/.nix-defexpr/channels/darwin ]]; then nix-channel --remove darwin || true diff --git a/pkgs/darwin-uninstaller/default.nix b/pkgs/darwin-uninstaller/default.nix index 17c0a46..f6e0450 100644 --- a/pkgs/darwin-uninstaller/default.nix +++ b/pkgs/darwin-uninstaller/default.nix @@ -31,7 +31,9 @@ in writeShellApplication { echo >&2 " - remove /Applications/Nix Apps symlink" echo >&2 " - cleanup static /etc files" echo >&2 " - disable and remove all launchd services managed by nix-darwin" - echo >&2 " - restore daemon service from nix installer (only when this is a multi-user install)" + if [[ $(stat -f '%Su' /nix/store) == "root" ]]; then + echo >&2 " - restore nix-daemon service from nix installer as this is a multi-user install" + fi echo >&2 if [[ -t 0 ]]; then |
