From 0fd5d1eb58124b4eef8dd9749c0eac28503ae08f Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Wed, 18 Apr 2018 15:22:27 +0200 Subject: cleanup --- nix/module.nix | 16 +++++++++------- 1 file 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 dirService = dCfg: nameValuePair ("rolling-directory@" + escapeSystemdPath dCfg.path) { wantedBy = [ "multi-user.target" ]; - serviceConfig = { - 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} - ''; + path = with pkgs; [ rolling-directory ]; + + script = let + args = [ dCfg.path dCfg.maxSize "monitor" ] + + optionals (dCfg.monitorTimeout != null) ["-t" dCfg.monitorTimeout] + + optionals (dCfg.minSleep != null) ["-s" dCfg.minSleep]; + in '' + exec -- rolling-directory ${escapeShellArgs args} + ''; }; }; in { -- cgit v1.2.3