feature(clam): init

This commit is contained in:
DashieTM 2025-12-19 15:48:17 +01:00
parent 885ceb5c94
commit afaba29554
5 changed files with 67 additions and 2 deletions

View file

@ -5,6 +5,7 @@
homeMods,
inputs,
lib,
additionalHomeConfig,
mod,
pkgs,
root,
@ -58,6 +59,7 @@
../lib/foxwrappers.nix
]
++ homeMods
++ lib.optional (builtins.pathExists additionalHomeConfig) additionalHomeConfig
++ lib.optional (builtins.pathExists mod) mod;
};
};

60
modules/programs/clam.nix Normal file
View file

@ -0,0 +1,60 @@
{
lib,
config,
options,
pkgs,
...
}: {
options.mods.clam = {
enable = lib.mkOption {
default = true;
example = false;
type = lib.types.bool;
description = "Enables the clamav program and its daemon";
};
scanner = {
enable = lib.mkOption {
default = false;
example = true;
type = lib.types.bool;
description = "Enables the clamav scanner";
};
interval = lib.mkOption {
type = lib.types.str;
default = "*-*-* 04:00:00";
description = ''
How often clamdscan is invoked.
By default this runs using 10 cores at most, be sure to run it at a time of low traffic.
'';
};
scanDirectories = lib.mkOption {
type = with lib.types; listOf str;
default = [
"/home"
"/var/lib"
"/tmp"
"/etc"
"/var/tmp"
];
description = ''List of directories to scan'';
};
};
};
config = lib.mkIf config.mods.clam.enable (
lib.optionalAttrs (options ? services.clamav) {
services.clamav = {
daemon.enable = true;
updater.enable = true;
scanner = {
inherit (config.mods.clam.scanner) enable;
inherit (config.mods.clam.scanner) interval;
inherit (config.mods.clam.scanner) scanDirectories;
};
};
environment.systemPackages = [
pkgs.clamav
];
}
// lib.optionalAttrs (options ? home.packages) {home.packages = with pkgs; [clamtk];}
);
}

View file

@ -1,11 +1,11 @@
{
imports = [
./niri.nix
./acpid.nix
./anyrun.nix
./basePackages.nix
./bluetooth.nix
./browser
./clam.nix
./coding.nix
./containers.nix
./drives.nix
@ -31,6 +31,7 @@
./mime.nix
./ncspot.nix
./nextcloud.nix
./niri.nix
./onedrive.nix
./oxi
./piper.nix
@ -47,9 +48,9 @@
./sway.nix
./teams.nix
./virtmanager.nix
./wm.nix
./xkb.nix
./xone.nix
./wm.nix
./yazi
];
}

View file

@ -132,6 +132,7 @@
disable_splash_rendering = false
disable_hyprland_logo = true
disable_xdg_env_checks = true
disable_scale_notification = true
}
env=STATE_DIR,var/cache/regreet

View file

@ -311,6 +311,7 @@ in {
disable_splash_rendering = mkDashDefault true;
disable_hyprland_logo = mkDashDefault true;
disable_xdg_env_checks = mkDashDefault true;
disable_scale_notification = mkDashDefault true;
swallow_regex = mkDashDefault "^(.*)(kitty)(.*)$";
initial_workspace_tracking = mkDashDefault 1;
# just doesn't work