Get periodic scan to work.

This commit is contained in:
Raphaël Numbus
2026-03-01 19:11:39 +01:00
parent ca8e8c967e
commit 331b686bae
+7 -1
View File
@@ -25,6 +25,12 @@ in
config = mkIf cfg.enable {
environment.systemPackages = [ pkgs.clamav pkgs.curl ];
system.activationScripts.clamav-quarantine = ''
mkdir -p /quarantine
chown clamav:clamav /quarantine
chmod 440 /quarantine
'';
security.sudo.extraRules = [{
users = [ "clamav" ];
commands = [{
@@ -66,7 +72,7 @@ in
onFailure = [ "clamav-virus-notify.service" ];
serviceConfig = {
Type = "oneshot";
ExecStart = "${pkgs.clamav}/bin/clamdscan --fdpass --multiscan ${lib.escapeShellArgs onAccessPaths}";
ExecStart = "${pkgs.clamav}/bin/clamdscan --verbose --multiscan --move=/quarantine ${lib.escapeShellArgs onAccessPaths}";
User = "clamav";
Group = "clamav";
SupplementaryGroups = [ "users" ];