Updated clamAV configuration. Fixed nextcloud-quirk typo.

This commit is contained in:
Raphaël Numbus
2026-03-01 12:05:30 +01:00
parent ab886a8a0b
commit fad1f51323
3 changed files with 36 additions and 26 deletions
+34 -25
View File
@@ -1,34 +1,43 @@
{ config, lib, pkgs, ... }:
let
cfg = config.numbus.services.clamav;
onAccessPaths = lib.mapAttrsToList (n: v: v.dataDir) (lib.filterAttrs (n: v:
v ? enable && v.enable && v ? dataDir && v.dataDir != false
) config.numbus.services);
in
{
environment.systemPackages = [ pkgs.clamav pkgs.curl ];
services.clamav = {
updater.enable = true;
daemon.enable = true;
scanner = {
enable = true;
interval = "*-*-* 04:00:00"; # Everyday at 4am
scanDirectories = [
"/etc"
"/home"
"/var/lib"
"/var/tmp"
"/tmp"
];
options.numbus.services.clamav = {
enable = mkEnableOption "ClamAV open-source anti-virus software";
};
config.numbus.services.clamav = mkIf cfg.enable {
environment.systemPackages = [ pkgs.clamav pkgs.curl ];
clamonacc.enable = true;
services.clamav = {
updater.enable = true;
clamonacc.enable = true;
daemon.settings = {
OnAccessPrevention = true;
OnAccessIncludePath = "/mnt/data";
scanner = {
enable = true;
interval = "*-*-* 04:00:00"; # Everyday at 4am
scanDirectories = [
"/etc"
"/home"
"/var/lib"
"/var/tmp"
"/tmp"
];
};
daemon = {
enable = true;
settings = {
OnAccessPrevention = true;
OnAccessIncludePath = onAccessPaths;
};
};
};
};
};
services.clamav.daemon.enable = true;
services.clamav.updater.enable = true;
services.clamav.clamonacc.enable = true;
}