From 94edfe8c7b2f83650c0f6262e50063ebcdedf29d Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Wed, 18 Apr 2018 15:18:05 +0200 Subject: minSleep --- nix/module.nix | 14 +++++++++++--- nix/rolling-directory.nix | 2 +- 2 files changed, 12 insertions(+), 4 deletions(-) (limited to 'nix') 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 type = with types; either ints.positive str; }; + minSleep = mkOption { + type = with types; nullOr ints.positive; + default = 3600; + }; + monitorTimeout = mkOption { type = with types; nullOr ints.positive; - default = 3600; + default = 3600 * 24; }; }; }; @@ -25,8 +30,11 @@ let wantedBy = [ "multi-user.target" ]; serviceConfig = { - ExecStart = '' - ${pkgs.rolling-directory}/bin/rolling-directory %I ${toString dCfg.maxSize} monitor ${optionalString (dCfg.monitorTimeout != null) (toString dCfg.monitorTimeout)} + ExecStart = let + extraArgs = optionals (dCfg.monitorTimeout != null) ["-t" (toString dCfg.monitorTimeout)] + + optionals (dCfg.minSleep != null) ["-s" (toString dCfg.minSleep)]; + in '' + ${pkgs.rolling-directory}/bin/rolling-directory %I ${toString dCfg.maxSize} monitor ${escapeShellArgs extraArgs} ''; }; }; 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 @@ stdenv.mkDerivation rec { name = "rolling-directory-${version}"; - version = "0.2"; + version = "0.3"; src = ../rolling-directory; phases = [ "buildPhase" "installPhase" ]; -- cgit v1.2.3