mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-11-12 03:56:17 +03:00
clamav module: make services.clamav.daemon.enable actually work
This commit is contained in:
parent
3314e18a39
commit
652842d82e
@ -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 ];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user