diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2018-04-18 15:18:05 +0200 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2018-04-18 15:18:05 +0200 |
commit | 94edfe8c7b2f83650c0f6262e50063ebcdedf29d (patch) | |
tree | 08d8f57b1e29d01ae3981c91492c11c2a5f45c7b /nix | |
parent | c6d84a192db8abf037ad08de0379177e5f56b952 (diff) | |
download | utils-94edfe8c7b2f83650c0f6262e50063ebcdedf29d.tar utils-94edfe8c7b2f83650c0f6262e50063ebcdedf29d.tar.gz utils-94edfe8c7b2f83650c0f6262e50063ebcdedf29d.tar.bz2 utils-94edfe8c7b2f83650c0f6262e50063ebcdedf29d.tar.xz utils-94edfe8c7b2f83650c0f6262e50063ebcdedf29d.zip |
minSleep
Diffstat (limited to 'nix')
-rw-r--r-- | nix/module.nix | 14 | ||||
-rw-r--r-- | nix/rolling-directory.nix | 2 |
2 files changed, 12 insertions, 4 deletions
diff --git a/nix/module.nix b/nix/module.nix index 10c68ff..3263401 100644 --- a/nix/module.nix +++ b/nix/module.nix | |||
@@ -14,9 +14,14 @@ let | |||
14 | type = with types; either ints.positive str; | 14 | type = with types; either ints.positive str; |
15 | }; | 15 | }; |
16 | 16 | ||
17 | minSleep = mkOption { | ||
18 | type = with types; nullOr ints.positive; | ||
19 | default = 3600; | ||
20 | }; | ||
21 | |||
17 | monitorTimeout = mkOption { | 22 | monitorTimeout = mkOption { |
18 | type = with types; nullOr ints.positive; | 23 | type = with types; nullOr ints.positive; |
19 | default = 3600; | 24 | default = 3600 * 24; |
20 | }; | 25 | }; |
21 | }; | 26 | }; |
22 | }; | 27 | }; |
@@ -25,8 +30,11 @@ let | |||
25 | wantedBy = [ "multi-user.target" ]; | 30 | wantedBy = [ "multi-user.target" ]; |
26 | 31 | ||
27 | serviceConfig = { | 32 | serviceConfig = { |
28 | ExecStart = '' | 33 | ExecStart = let |
29 | ${pkgs.rolling-directory}/bin/rolling-directory %I ${toString dCfg.maxSize} monitor ${optionalString (dCfg.monitorTimeout != null) (toString dCfg.monitorTimeout)} | 34 | extraArgs = optionals (dCfg.monitorTimeout != null) ["-t" (toString dCfg.monitorTimeout)] |
35 | + optionals (dCfg.minSleep != null) ["-s" (toString dCfg.minSleep)]; | ||
36 | in '' | ||
37 | ${pkgs.rolling-directory}/bin/rolling-directory %I ${toString dCfg.maxSize} monitor ${escapeShellArgs extraArgs} | ||
30 | ''; | 38 | ''; |
31 | }; | 39 | }; |
32 | }; | 40 | }; |
diff --git a/nix/rolling-directory.nix b/nix/rolling-directory.nix index bb5dd53..4093c36 100644 --- a/nix/rolling-directory.nix +++ b/nix/rolling-directory.nix | |||
@@ -4,7 +4,7 @@ | |||
4 | 4 | ||
5 | stdenv.mkDerivation rec { | 5 | stdenv.mkDerivation rec { |
6 | name = "rolling-directory-${version}"; | 6 | name = "rolling-directory-${version}"; |
7 | version = "0.2"; | 7 | version = "0.3"; |
8 | src = ../rolling-directory; | 8 | src = ../rolling-directory; |
9 | 9 | ||
10 | phases = [ "buildPhase" "installPhase" ]; | 10 | phases = [ "buildPhase" "installPhase" ]; |