summary refs log tree commit diff
path: root/nixos/modules/services/security/clamav.nix
diff options
context:
space:
mode:
authorLéo Gaspard <leo@gaspard.io>2017-10-27 20:26:33 +0200
committerRok Garbas <rok@garbas.si>2017-11-28 13:45:13 +0100
commit652842d82ea1feaf71f6c46744bfaeb54298e746 (patch)
tree791d98573b944ff44c0e9d3c758309506ca817bd /nixos/modules/services/security/clamav.nix
parent3314e18a3925863d2ca4154340bf88e64178e54e (diff)
downloadnixlib-652842d82ea1feaf71f6c46744bfaeb54298e746.tar
nixlib-652842d82ea1feaf71f6c46744bfaeb54298e746.tar.gz
nixlib-652842d82ea1feaf71f6c46744bfaeb54298e746.tar.bz2
nixlib-652842d82ea1feaf71f6c46744bfaeb54298e746.tar.lz
nixlib-652842d82ea1feaf71f6c46744bfaeb54298e746.tar.xz
nixlib-652842d82ea1feaf71f6c46744bfaeb54298e746.tar.zst
nixlib-652842d82ea1feaf71f6c46744bfaeb54298e746.zip
clamav module: make services.clamav.daemon.enable actually work
Diffstat (limited to 'nixos/modules/services/security/clamav.nix')
-rw-r--r--nixos/modules/services/security/clamav.nix9
1 files changed, 5 insertions, 4 deletions
diff --git a/nixos/modules/services/security/clamav.nix b/nixos/modules/services/security/clamav.nix
index f71f30fee97a..7de2d121e76c 100644
--- a/nixos/modules/services/security/clamav.nix
+++ b/nixos/modules/services/security/clamav.nix
@@ -76,8 +76,9 @@ in
     };
   };
 
-  config = mkIf cfg.updater.enable or cfg.daemon.enable {
+  config = mkIf (cfg.updater.enable || cfg.daemon.enable) {
     environment.systemPackages = [ pkg ];
+
     users.extraUsers = singleton {
       name = clamavUser;
       uid = config.ids.uids.clamav;
@@ -94,7 +95,7 @@ in
     environment.etc."clamav/freshclam.conf".source = freshclamConfigFile;
     environment.etc."clamav/clamd.conf".source = clamdConfigFile;
 
-    systemd.services.clamav-daemon = mkIf cfg.daemon.enable {
+    systemd.services.clamav-daemon = optionalAttrs cfg.daemon.enable {
       description = "ClamAV daemon (clamd)";
       after = mkIf cfg.updater.enable [ "clamav-freshclam.service" ];
       requires = mkIf cfg.updater.enable [ "clamav-freshclam.service" ];
@@ -115,7 +116,7 @@ in
       };
     };
 
-    systemd.timers.clamav-freshclam = mkIf cfg.updater.enable {
+    systemd.timers.clamav-freshclam = optionalAttrs cfg.updater.enable {
       description = "Timer for ClamAV virus database updater (freshclam)";
       wantedBy = [ "timers.target" ];
       timerConfig = {
@@ -124,7 +125,7 @@ in
       };
     };
 
-    systemd.services.clamav-freshclam = mkIf cfg.updater.enable {
+    systemd.services.clamav-freshclam = optionalAttrs cfg.updater.enable {
       description = "ClamAV virus database updater (freshclam)";
       restartTriggers = [ freshclamConfigFile ];