summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2015-12-13 13:50:39 +0100
committermakefu <github@syntax-fehler.de>2015-12-13 13:50:39 +0100
commit1c17881aede650e114b43dfb4efb10249c2bcaea (patch)
tree2027af05639f2a37a4f4800aeba6e61d3966c3f3
parentc0786aee72507e08ab61b5e9391afb4e7fba76fa (diff)
k 3 fetchWallpaper: change predicate handling
a failed predicate does not result in a failed system service it will just not download the remote
-rw-r--r--krebs/3modules/fetchWallpaper.nix9
1 files changed, 4 insertions, 5 deletions
diff --git a/krebs/3modules/fetchWallpaper.nix b/krebs/3modules/fetchWallpaper.nix
index b5eb00e9c..83ecf4177 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}