diff options
Diffstat (limited to 'nix')
| -rw-r--r-- | nix/module.nix | 16 | 
1 files changed, 9 insertions, 7 deletions
diff --git a/nix/module.nix b/nix/module.nix index 3263401..20c10a1 100644 --- a/nix/module.nix +++ b/nix/module.nix  | |||
| @@ -29,13 +29,15 @@ let | |||
| 29 | dirService = dCfg: nameValuePair ("rolling-directory@" + escapeSystemdPath dCfg.path) { | 29 | dirService = dCfg: nameValuePair ("rolling-directory@" + escapeSystemdPath dCfg.path) { | 
| 30 | wantedBy = [ "multi-user.target" ]; | 30 | wantedBy = [ "multi-user.target" ]; | 
| 31 | 31 | ||
| 32 | serviceConfig = { | 32 | path = with pkgs; [ rolling-directory ]; | 
| 33 | ExecStart = let | 33 | |
| 34 | extraArgs = optionals (dCfg.monitorTimeout != null) ["-t" (toString dCfg.monitorTimeout)] | 34 | script = let | 
| 35 | + optionals (dCfg.minSleep != null) ["-s" (toString dCfg.minSleep)]; | 35 | args = [ dCfg.path dCfg.maxSize "monitor" ] | 
| 36 | in '' | 36 | + optionals (dCfg.monitorTimeout != null) ["-t" dCfg.monitorTimeout] | 
| 37 | ${pkgs.rolling-directory}/bin/rolling-directory %I ${toString dCfg.maxSize} monitor ${escapeShellArgs extraArgs} | 37 | + optionals (dCfg.minSleep != null) ["-s" dCfg.minSleep]; | 
| 38 | ''; | 38 | in '' | 
| 39 | exec -- rolling-directory ${escapeShellArgs args} | ||
| 40 | ''; | ||
| 39 | }; | 41 | }; | 
| 40 | }; | 42 | }; | 
| 41 | in { | 43 | in { | 
