From e1f1160284198a68ea8c7fffbbb1436f99e46ef9 Mon Sep 17 00:00:00 2001 From: arcnmx Date: Fri, 9 Sep 2022 12:25:49 -0700 Subject: [PATCH] redshift/gammastep: add `enableVerboseLogging` option This option controls whether the `-v` command line argument is given. Co-authored-by: Sumner Evans --- modules/services/redshift-gammastep/lib/options.nix | 7 ++++++- .../gammastep-basic-configuration-expected.service | 2 +- .../redshift-basic-configuration-expected.service | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/modules/services/redshift-gammastep/lib/options.nix b/modules/services/redshift-gammastep/lib/options.nix index a5aeac55b..4c9d68ab3 100644 --- a/modules/services/redshift-gammastep/lib/options.nix +++ b/modules/services/redshift-gammastep/lib/options.nix @@ -110,6 +110,8 @@ in { ''; }; + enableVerboseLogging = mkEnableOption "verbose service logging"; + tray = mkOption { type = types.bool; default = false; @@ -199,7 +201,10 @@ in { ExecStart = let command = if cfg.tray then appletExecutable else mainExecutable; configFullPath = config.xdg.configHome + "/${xdgConfigFilePath}"; - in "${cfg.package}/bin/${command} -v -c ${configFullPath}"; + in "${cfg.package}/bin/${command} " + cli.toGNUCommandLineShell { } { + v = cfg.enableVerboseLogging; + c = configFullPath; + }; RestartSec = 3; Restart = "on-failure"; }; diff --git a/tests/modules/services/redshift-gammastep/gammastep-basic-configuration-expected.service b/tests/modules/services/redshift-gammastep/gammastep-basic-configuration-expected.service index 8d0e7a5fb..d172e3a86 100644 --- a/tests/modules/services/redshift-gammastep/gammastep-basic-configuration-expected.service +++ b/tests/modules/services/redshift-gammastep/gammastep-basic-configuration-expected.service @@ -2,7 +2,7 @@ WantedBy=graphical-session.target [Service] -ExecStart=@gammastep@/bin/gammastep -v -c /home/hm-user/.config/gammastep/config.ini +ExecStart=@gammastep@/bin/gammastep '-c' '/home/hm-user/.config/gammastep/config.ini' Restart=on-failure RestartSec=3 diff --git a/tests/modules/services/redshift-gammastep/redshift-basic-configuration-expected.service b/tests/modules/services/redshift-gammastep/redshift-basic-configuration-expected.service index 07ffbf06d..6ee4cdda2 100644 --- a/tests/modules/services/redshift-gammastep/redshift-basic-configuration-expected.service +++ b/tests/modules/services/redshift-gammastep/redshift-basic-configuration-expected.service @@ -2,7 +2,7 @@ WantedBy=graphical-session.target [Service] -ExecStart=@redshift@/bin/redshift -v -c /home/hm-user/.config/redshift/redshift.conf +ExecStart=@redshift@/bin/redshift '-c' '/home/hm-user/.config/redshift/redshift.conf' Restart=on-failure RestartSec=3