summaryrefslogtreecommitdiff
path: root/nix
diff options
context:
space:
mode:
Diffstat (limited to 'nix')
-rw-r--r--nix/module.nix14
-rw-r--r--nix/rolling-directory.nix2
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
5stdenv.mkDerivation rec { 5stdenv.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" ];