CI: Travis: add HACK to fix reload Nix-daemon after Nix update 2.0 -> 2.2
M .travis.yml
This commit is contained in:
parent
361232ea5e
commit
ebdb4e827f
15
.travis.yml
15
.travis.yml
|
@ -125,7 +125,20 @@ before_script:
|
|||
- if [ "${TRAVIS_OS_NAME}" = "osx" ]; then sudo nix upgrade-nix; fi
|
||||
#
|
||||
# NOTE: macOS service restart
|
||||
- sudo launchctl kickstart -k system/org.nixos.nix-daemon || true
|
||||
# HACK: Because Nix can not update its daemon itself between 2.0 -> 2.2:
|
||||
# 1. https://github.com/NixOS/nix/issues/3125#issuecomment-539667327
|
||||
# 2. https://github.com/NixOS/nix/issues/3125#issuecomment-539771768
|
||||
# Since Nix on macOS has problems restarting the service:
|
||||
# Force the real disable, get target file from the symlink, unlink symlink, copy file, and reload service
|
||||
- |
|
||||
if [ "${TRAVIS_OS_NAME}" = "osx" ]; then true && \
|
||||
sudo launchctl unload /Library/LaunchDaemons/org.nixos.nix-daemon.plist && \
|
||||
export NIX_SERVICE_FILE=$(readlink /Library/LaunchDaemons/org.nixos.nix-daemon.plist) && \
|
||||
sudo unlink /Library/LaunchDaemons/org.nixos.nix-daemon.plist && \
|
||||
sudo cp -f "$NIX_SERVICE_FILE" /Library/LaunchDaemons/org.nixos.nix-daemon.plist && \
|
||||
sudo launchctl load /Library/LaunchDaemons/org.nixos.nix-daemon.plist && \
|
||||
sudo launchctl kickstart -k system/org.nixos.nix-daemon && \
|
||||
true; fi
|
||||
|
||||
script:
|
||||
#
|
||||
|
|
Loading…
Reference in a new issue