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

uninstaller: remove unnecessary attempt to delete nix-daemon

Fixes https://github.com/LnL7/nix-darwin/issues/910
This commit is contained in:
Michael Hoang 2024-11-05 01:14:16 +11:00
parent 84ad3a2d7e
commit 1b5fa6be40

View file

@ -7,31 +7,29 @@ with lib;
assertions = mkForce []; assertions = mkForce [];
system.activationScripts.checks.text = mkForce ""; system.activationScripts.checks.text = mkForce "";
# Disable etc, launchd, ...
environment.etc = mkForce {}; environment.etc = mkForce {};
launchd.agents = mkForce {}; launchd.agents = mkForce {};
launchd.daemons = mkForce {}; launchd.daemons = mkForce {};
launchd.user.agents = mkForce {}; launchd.user.agents = mkForce {};
system.activationScripts.postUserActivation.text = mkAfter '' system.activationScripts.postUserActivation.text = mkAfter ''
if test -L ~/.nix-defexpr/channels/darwin; then if [[ -L ~/.nix-defexpr/channels/darwin ]]; then
nix-channel --remove darwin || true nix-channel --remove darwin || true
fi fi
''; '';
system.activationScripts.postActivation.text = mkAfter '' system.activationScripts.postActivation.text = mkAfter ''
if test -L /Applications/Nix\ Apps; then if [[ -L /Applications/Nix\ Apps ]]; then
rm /Applications/Nix\ Apps rm /Applications/Nix\ Apps
fi fi
if test -L /etc/static; then if [[ -L /etc/static ]]; then
rm /etc/static rm /etc/static
fi fi
if test -O /nix/store; then # If the Nix Store is owned by root then we're on a multi-user system
if ! test -e /Library/LaunchDaemons/org.nixos.nix-daemon.plist; then if [[ -O /nix/store ]]; then
sudo rm /Library/LaunchDaemons/org.nixos.nix-daemon.plist || true if [[ -e /nix/var/nix/profiles/default/Library/LaunchDaemons/org.nixos.nix-daemon.plist ]]; then
sudo launchctl remove org.nixos.nix-daemon 2> /dev/null || true
sudo cp /nix/var/nix/profiles/default/Library/LaunchDaemons/org.nixos.nix-daemon.plist /Library/LaunchDaemons/org.nixos.nix-daemon.plist sudo cp /nix/var/nix/profiles/default/Library/LaunchDaemons/org.nixos.nix-daemon.plist /Library/LaunchDaemons/org.nixos.nix-daemon.plist
sudo launchctl load -w /Library/LaunchDaemons/org.nixos.nix-daemon.plist sudo launchctl load -w /Library/LaunchDaemons/org.nixos.nix-daemon.plist
fi fi