diff options
author | lassulus <lass@lassul.us> | 2017-01-26 23:59:26 +0100 |
---|---|---|
committer | lassulus <lass@lassul.us> | 2017-01-26 23:59:26 +0100 |
commit | 5edbdb287d9365fe1b519aa3fee38451c82d4a95 (patch) | |
tree | 5f2718e546eabf87369c81d35b2434b8cff60d6a /krebs/3modules/fetchWallpaper.nix | |
parent | c363534571075914bc4bdbab2988c809f3499300 (diff) |
k 3 fetchWallpaper: add maxTime option
Diffstat (limited to 'krebs/3modules/fetchWallpaper.nix')
-rw-r--r-- | krebs/3modules/fetchWallpaper.nix | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/krebs/3modules/fetchWallpaper.nix b/krebs/3modules/fetchWallpaper.nix index aed5f595c..29c4f50e9 100644 --- a/krebs/3modules/fetchWallpaper.nix +++ b/krebs/3modules/fetchWallpaper.nix @@ -38,6 +38,11 @@ let ''; default = {}; }; + maxTime = mkOption { + type = types.int; + default = 0; + description = "Time to wait before download is aborted"; + }; }; fetchWallpaperScript = pkgs.writeDash "fetchWallpaper" '' @@ -45,7 +50,7 @@ let mkdir -p ${shell.escape cfg.stateDir} cd ${shell.escape cfg.stateDir} - (curl -s -o wallpaper.tmp -z wallpaper ${shell.escape cfg.url} && mv wallpaper.tmp wallpaper) || : + (curl --max-time ${toString cfg.maxTime} -s -o wallpaper.tmp -z wallpaper ${shell.escape cfg.url} && mv wallpaper.tmp wallpaper) || : feh --no-fehbg --bg-scale ${shell.escape cfg.stateDir}/wallpaper ''; |