From 16cbb8f6a113f42cfca09dae92bbc1f3c58dc656 Mon Sep 17 00:00:00 2001 From: Daiderd Jordan Date: Sat, 13 May 2017 16:25:07 +0200 Subject: [PATCH] launchd: fix reload of services --- modules/system/launchd.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/system/launchd.nix b/modules/system/launchd.nix index e0d2a62..7a70e1a 100644 --- a/modules/system/launchd.nix +++ b/modules/system/launchd.nix @@ -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 '';