mirror of
https://github.com/LnL7/nix-darwin.git
synced 2025-03-13 20:30:02 +00:00
launchd: fix reload of services
This commit is contained in:
parent
0495b41b4d
commit
16cbb8f6a1
1 changed files with 4 additions and 4 deletions
|
@ -12,22 +12,22 @@ let
|
|||
};
|
||||
|
||||
launchdActivation = basedir: target: ''
|
||||
if ! diff '${cfg.build.launchd}/Library/${basedir}/${target}' '/Library/${basedir}/${target}'; then
|
||||
if ! diff '${cfg.build.launchd}/Library/${basedir}/${target}' '/Library/${basedir}/${target}' &> /dev/null; then
|
||||
if test -f '/Library/${basedir}/${target}'; then
|
||||
launchctl unload -w '/Library/${basedir}/${target}' || true
|
||||
fi
|
||||
cp -f '${cfg.build.launchd}/Library/${basedir}/${target}' '/Library/${basedir}/${target}'
|
||||
launchctl load '/Library/${basedir}/${target}'
|
||||
launchctl load -w '/Library/${basedir}/${target}'
|
||||
fi
|
||||
'';
|
||||
|
||||
userLaunchdActivation = target: ''
|
||||
if ! diff ${cfg.build.launchd}/user/Library/LaunchAgents/${target} ~/Library/LaunchAgents/${target}; then
|
||||
if ! diff ${cfg.build.launchd}/user/Library/LaunchAgents/${target} ~/Library/LaunchAgents/${target} &> /dev/null; then
|
||||
if test -f ~/Library/LaunchAgents/${target}; then
|
||||
launchctl unload -w ~/Library/LaunchAgents/${target} || true
|
||||
fi
|
||||
cp -f '${cfg.build.launchd}/user/Library/LaunchAgents/${target}' ~/Library/LaunchAgents/${target}
|
||||
launchctl load ~/Library/LaunchAgents/${target}
|
||||
launchctl load -w ~/Library/LaunchAgents/${target}
|
||||
fi
|
||||
'';
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue