all repos — nix-packages @ 8b16719752bc026984733bafa11d43a1219a02d9

My personal collection of packages for nix

goaccess: lower process priority

Alin
commit

8b16719752bc026984733bafa11d43a1219a02d9

parent

55680ab6e693d2807a487c845a4f5c9758977f4c

1 file changed, 21 insertions(+), 7 deletions(-)

changed files
M modules/nixos/goaccess.nixmodules/nixos/goaccess.nix
@@ -256,7 +256,6 @@ description = "GoAccess Web Log Analyzer (${name})";
wantedBy = if realTime then [ "multi-user.target" ] else [ "timers.target" ]; serviceConfig = { - Type = if realTime then "simple" else "oneshot"; ExecStart = "${cfg.package}/bin/goaccess --no-parsing-spinner --config-file=${configFile}"; ExecStartPre = "+"
@@ -274,17 +273,31 @@ # Security settings
NoNewPrivileges = true; PrivateTmp = true; ProtectSystem = "strict"; - RestrictAddressFamilies = lib.optionals (instanceCfg.settings.real-time-html) [ - "AF_INET" - "AF_INET6" - "AF_UNIX" - ]; ProtectHome = true; ReadOnlyPaths = (lib.flatten instanceCfg.settings.log-file); ReadWritePaths = [ ("-" + dirOf instanceCfg.settings.output) ]; - }; + + } + // ( + if realTime then + { + Type = "simple"; + RestrictAddressFamilies = [ + "AF_INET" + "AF_INET6" + "AF_UNIX" + ]; + Nice = lib.mkDefault "+5"; + } + else + { + Type = "oneshot"; + CPUSchedulingPolicy = lib.mkDefault "batch"; + Nice = lib.mkDefault "+10"; + } + ); } ) enabledInstances;
@@ -297,6 +310,7 @@ timerConfig = {
OnCalendar = instanceCfg.dates; Persistent = true; }; + unitConfig."X-OnlyManualStart" = true; }) ) (lib.filterAttrs (_: icfg: icfg.dates != null) enabledInstances);