summary refs log tree commit diff
path: root/nixos/modules/services/logging
diff options
context:
space:
mode:
authorFelix Buehler <account@buehler.rocks>2023-03-19 21:44:31 +0100
committerFelix Buehler <account@buehler.rocks>2023-04-07 13:38:33 +0200
commit327b0cff7aedc20a148d245b1182f43800acc1f5 (patch)
treea498ae1b2dd2289310483d81345903d7e9123cb7 /nixos/modules/services/logging
parentb392d9b827cf4bb52141ab86e4202ec340f0b181 (diff)
downloadnixpkgs-327b0cff7aedc20a148d245b1182f43800acc1f5.tar
nixpkgs-327b0cff7aedc20a148d245b1182f43800acc1f5.tar.gz
nixpkgs-327b0cff7aedc20a148d245b1182f43800acc1f5.tar.bz2
nixpkgs-327b0cff7aedc20a148d245b1182f43800acc1f5.tar.lz
nixpkgs-327b0cff7aedc20a148d245b1182f43800acc1f5.tar.xz
nixpkgs-327b0cff7aedc20a148d245b1182f43800acc1f5.tar.zst
nixpkgs-327b0cff7aedc20a148d245b1182f43800acc1f5.zip
treewide: use more lib.optionalString
Diffstat (limited to 'nixos/modules/services/logging')
-rw-r--r--nixos/modules/services/logging/logrotate.nix5
-rw-r--r--nixos/modules/services/logging/syslogd.nix2
2 files changed, 3 insertions, 4 deletions
diff --git a/nixos/modules/services/logging/logrotate.nix b/nixos/modules/services/logging/logrotate.nix
index b056f96c363..342ac5ec6e0 100644
--- a/nixos/modules/services/logging/logrotate.nix
+++ b/nixos/modules/services/logging/logrotate.nix
@@ -83,9 +83,8 @@ let
   };
 
   mailOption =
-    if foldr (n: a: a || (n.mail or false) != false) false (attrValues cfg.settings)
-    then "--mail=${pkgs.mailutils}/bin/mail"
-    else "";
+    optionalString (foldr (n: a: a || (n.mail or false) != false) false (attrValues cfg.settings))
+    "--mail=${pkgs.mailutils}/bin/mail";
 in
 {
   imports = [
diff --git a/nixos/modules/services/logging/syslogd.nix b/nixos/modules/services/logging/syslogd.nix
index 43969402588..553973e255f 100644
--- a/nixos/modules/services/logging/syslogd.nix
+++ b/nixos/modules/services/logging/syslogd.nix
@@ -7,7 +7,7 @@ let
   cfg = config.services.syslogd;
 
   syslogConf = pkgs.writeText "syslog.conf" ''
-    ${if (cfg.tty != "") then "kern.warning;*.err;authpriv.none /dev/${cfg.tty}" else ""}
+    ${optionalString (cfg.tty != "") "kern.warning;*.err;authpriv.none /dev/${cfg.tty}"}
     ${cfg.defaultConfig}
     ${cfg.extraConfig}
   '';