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 { config = mkIf cfg.enable {
environment.systemPackages = [ pkgs.clamav pkgs.curl ]; environment.systemPackages = [ pkgs.clamav pkgs.curl ];
system.activationScripts.clamav-quarantine = ''
mkdir -p /quarantine
chown clamav:clamav /quarantine
chmod 440 /quarantine
'';
security.sudo.extraRules = [{ security.sudo.extraRules = [{
users = [ "clamav" ]; users = [ "clamav" ];
commands = [{ commands = [{
@@ -66,7 +72,7 @@ in
onFailure = [ "clamav-virus-notify.service" ]; onFailure = [ "clamav-virus-notify.service" ];
serviceConfig = { serviceConfig = {
Type = "oneshot"; 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"; User = "clamav";
Group = "clamav"; Group = "clamav";
SupplementaryGroups = [ "users" ]; SupplementaryGroups = [ "users" ];