From 1c17881aede650e114b43dfb4efb10249c2bcaea Mon Sep 17 00:00:00 2001 From: makefu Date: Sun, 13 Dec 2015 13:50:39 +0100 Subject: k 3 fetchWallpaper: change predicate handling a failed predicate does not result in a failed system service it will just not download the remote --- krebs/3modules/fetchWallpaper.nix | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'krebs/3modules/fetchWallpaper.nix') diff --git a/krebs/3modules/fetchWallpaper.nix b/krebs/3modules/fetchWallpaper.nix index b5eb00e9..83ecf417 100644 --- a/krebs/3modules/fetchWallpaper.nix +++ b/krebs/3modules/fetchWallpaper.nix @@ -37,11 +37,10 @@ let fetchWallpaperScript = pkgs.writeScript "fetchWallpaper" '' #! ${pkgs.bash}/bin/bash - ${if (cfg.predicate == null) then "" else '' - ${cfg.predicate} - if [ $? -ne 0 ]; then - echo "predicate failed" - exit 23 + ${optionalString (cfg.predicate != null) '' + if ! ${cfg.predicate}; then + echo "predicate failed - will not fetch from remote" + exit 0 fi ''} mkdir -p ${shell.escape cfg.stateDir} -- cgit v1.2.3