diff options
author | Matt Votava <mvnetbiz@gmail.com> | 2021-03-19 01:49:57 -0700 |
---|---|---|
committer | lewo <lewo@abesis.fr> | 2021-03-21 14:32:54 +0000 |
commit | d0a2e74574a9955d974396c84c6a3729a11d8258 (patch) | |
tree | d62d6502ebe528e93f3cc697adf5f244f420f8ef | |
parent | 06cf3557dfab637b847e255a3d6e6ee8a5569aeb (diff) |
Use services.clamav.daemon.settings if it is available
-rw-r--r-- | mail-server/clamav.nix | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/mail-server/clamav.nix b/mail-server/clamav.nix index 3c5fb21..a73d4e5 100644 --- a/mail-server/clamav.nix +++ b/mail-server/clamav.nix @@ -14,19 +14,29 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/> -{ config, pkgs, lib, ... }: +{ config, pkgs, lib, options, ... }: let cfg = config.mailserver; + clamHasSettings = options.services.clamav.daemon ? settings; in +with lib; { config = lib.mkIf (cfg.enable && cfg.virusScanning) { - services.clamav.daemon.enable = true; - services.clamav.updater.enable = true; - services.clamav.daemon.extraConfig = '' - PhishingScanURLs no - ''; + # 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 + ''; + }); + + services.clamav.updater.enable = true; }; } |