diff --git a/modules/services/clamav.nix b/modules/services/clamav.nix index 3ea4883..da96922 100644 --- a/modules/services/clamav.nix +++ b/modules/services/clamav.nix @@ -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; } \ No newline at end of file diff --git a/modules/services/default.nix b/modules/services/default.nix index 7aca70e..3b275aa 100644 --- a/modules/services/default.nix +++ b/modules/services/default.nix @@ -3,6 +3,7 @@ { imports = [ # ./adguard.nix + ./clamav.nix ./frigate.nix ./gitea.nix ./home-assistant.nix diff --git a/modules/services/nextcloud.nix b/modules/services/nextcloud.nix index 3021ca7..e884f21 100644 --- a/modules/services/nextcloud.nix +++ b/modules/services/nextcloud.nix @@ -240,7 +240,7 @@ helper.mkPodmanService { sudo -u numbus-admin podman exec --user www-data nextcloud-server php occ db:add-missing-indices sudo -u numbus-admin podman exec --user www-data nextcloud-server php occ maintenance:repair --include-expensive - INSTALL_APPS_LIST=( "calendar" "contacts" "mail" "note" "onlyoffice" "cookbook" "whiteboard" ) + INSTALL_APPS_LIST=( "calendar" "contacts" "mail" "notes" "onlyoffice" "cookbook" "whiteboard" ) REMOVE_APPS_LIST=( "activity" "app_api" "federatedfilesharing" "federation" "webhook_listeners" "photos" "recommendations" "sharebymail" "teams" "support" "richdocumentscode" ) CURRENT_APPS_SIGNATURE="$(echo "''${INSTALL_APPS_LIST[@]}" "''${REMOVE_APPS_LIST[@]}")" APPS_SIGNATURE_FILE="/var/lib/numbus-server/${name}/installed_apps.signature"