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

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.
This commit is contained in:
Daiderd Jordan 2018-09-14 22:32:49 +02:00
parent 75add386d3
commit 803bf18141
No known key found for this signature in database
GPG key ID: D02435D05B810C96

View file

@ -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