From 803bf18141fc3ea7c2205190dbe73949db8c71be Mon Sep 17 00:00:00 2001 From: Daiderd Jordan Date: Fri, 14 Sep 2018 22:32:49 +0200 Subject: [PATCH] uninstaller: continue if removing channel fails and make nix-daemon reload more robust Kind of a workaround, but failing to remove the channel isn't a big deal. --- pkgs/darwin-uninstaller/configuration.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/darwin-uninstaller/configuration.nix b/pkgs/darwin-uninstaller/configuration.nix index 991c1ad2..183e7801 100644 --- a/pkgs/darwin-uninstaller/configuration.nix +++ b/pkgs/darwin-uninstaller/configuration.nix @@ -19,7 +19,7 @@ with lib; fi if test -L ~/.nix-defexpr/channels/darwin; then - nix-channel --remove darwin + nix-channel --remove darwin || true fi ''; @@ -31,7 +31,7 @@ with lib; if test -O /nix/store; then l=$(readlink /Library/LaunchDaemons/org.nixos.nix-daemon.plist) || true if test "$l" != "/nix/var/nix/profiles/default/Library/LaunchDaemons/org.nixos.nix-daemon.plist"; then - sudo launchctl unload -w /Library/LaunchDaemons/org.nixos.nix-daemon.plist 2> /dev/null || true + sudo launchctl remove org.nixos.nix-daemon 2> /dev/null || true sudo ln -sfn /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 fi