Use services.clamav.daemon.settings if it is available
This commit is contained in:
parent
06cf3557df
commit
d0a2e74574
|
@ -14,19 +14,29 @@
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>
|
# along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
|
|
||||||
{ config, pkgs, lib, ... }:
|
{ config, pkgs, lib, options, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.mailserver;
|
cfg = config.mailserver;
|
||||||
|
clamHasSettings = options.services.clamav.daemon ? settings;
|
||||||
in
|
in
|
||||||
|
with lib;
|
||||||
{
|
{
|
||||||
config = lib.mkIf (cfg.enable && cfg.virusScanning) {
|
config = lib.mkIf (cfg.enable && cfg.virusScanning) {
|
||||||
services.clamav.daemon.enable = true;
|
|
||||||
services.clamav.updater.enable = true;
|
|
||||||
|
|
||||||
services.clamav.daemon.extraConfig = ''
|
# Remove extraConfig and settings conditional after 20.09 support is removed
|
||||||
|
|
||||||
|
services.clamav.daemon = {
|
||||||
|
enable = true;
|
||||||
|
} // (if clamHasSettings then {
|
||||||
|
settings.PhishingScanURLs = "no";
|
||||||
|
} else {
|
||||||
|
extraConfig = ''
|
||||||
PhishingScanURLs no
|
PhishingScanURLs no
|
||||||
'';
|
'';
|
||||||
|
});
|
||||||
|
|
||||||
|
services.clamav.updater.enable = true;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue