Skip to content

Commit

Permalink
clamav module: make services.clamav.daemon.enable actually work
Browse files Browse the repository at this point in the history
  • Loading branch information
Ekleog authored and garbas committed Nov 28, 2017
1 parent 3314e18 commit 652842d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions nixos/modules/services/security/clamav.nix
Expand Up @@ -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;
Expand All @@ -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" ];
Expand All @@ -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 = {
Expand All @@ -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 ];

Expand Down

0 comments on commit 652842d

Please sign in to comment.