anchor.diff:  
       users.groups.${clamavGroup} =
         { gid = config.ids.gids.clamav; };
  +
  +    services.clamav.daemon.settings = {
  +      DatabaseDirectory = stateDir;
  +      LocalSocket = "${runDir}/clamd.ctl";
  +      PidFile = "${runDir}/clamd.pid";
  +      TemporaryDirectory = "/tmp";
  +      User = "clamav";
  +      Foreground = true;
  +    };
  +
  +    services.clamav.updater.settings = {
  +      DatabaseDirectory = stateDir;
  +      Foreground = true;
  +      Checks = cfg.updater.frequency;
  +      DatabaseMirror = [ "database.clamav.net" ];
  +    };
   
       environment.etc."clamav/freshclam.conf".source = freshclamConfigFile;
       environment.etc."clamav/clamd.conf".source = clamdConfigFile;
  
positive.code:   cfg = config.services.clamav;
    pkg = pkgs.clamav;
  
    clamdConfigFile = pkgs.writeText "clamd.conf" ''
      DatabaseDirectory ${stateDir}
      LocalSocket ${runDir}/clamd.ctl
      PidFile ${runDir}/clamd.pid
      TemporaryDirectory /tmp
      User clamav
      Foreground yes
  
      ${cfg.daemon.extraConfig}
    '';
  
    freshclamConfigFile = pkgs.writeText "freshclam.conf" ''
      DatabaseDirectory ${stateDir}
      Foreground yes
      Checks ${toString cfg.updater.frequency}
  
      ${cfg.updater.extraConfig}
  
      DatabaseMirror database.clamav.net
    '';
  in
  {
    imports = [
      (mkRenamedOptionModule [ "services" "clamav" "updater" "config" ] [ "services" "clamav" "updater" "extraConfig" ])
    ];
  
    options = {
  
negative.code:           '';
          };
  
          settings = mkOption {
            type = with types; attrsOf (oneOf [ bool int str (listOf str) ]);
            default = {};
            description = ''
              freshclam configuration. Refer to <link xlink:href="https://linux.die.net/man/5/freshclam.conf"/>,
              for details on supported values.
            '';
          };
        };
  