Nixos questions

hello I am new to nixos and I have 2 questions, the first on clamav, when I try to do freshclam, it answers me: can’t open/parse the config file /etc/clamav/freshclam.conf
My 2nd question concerns the firewall, is iptables the default firewall? how I could go about authorizing outgoing traffic and refusing all incoming traffic, thank you all, I’m happy to discover nixos

1 Like

You can configure clamav via its module:

https://search.nixos.org/options?channel=23.11&from=0&size=50&sort=relevance&type=packages&query=clamav

Regarding firewall configuration, see the manual:

ok thanks! i go!!!

hello, I don’t see this file nixos/modules/services/security/clamav.nix, should I create it?

No: This is the file that declares and defines the clamav module. If you are curious, you can find it over there https://github.com/NixOS/nixpkgs/blob/9f39ab41a72d6e6e573dd8b08b91604aa7558f5a/nixos/modules/services/security/clamav.nix .

From the point of view of your configuration, you don’t need that file per se (it’s “part of” NixOS already): you only have to use the options that it enables, as listed in the link @wamserma posted above, to setup clamav.

No, this file is in the nixpkgs collection of definition that also defines your NixOS.
You can simply use

services.clamav = {
 updater.enabled = true;
 updater.settings = {
    LogVerbose = true;
 };
 updater.interval = "hourly";

in your configuration.nix. Don’t forget to do a nixos-rebuild to activate those settings.

error synthax, i don t know why

The example of code above is missing }; at the end to close the services.clamav = { ... }; declaration.

1 Like