make clamav a module

This commit is contained in:
Robin Raymond 2017-09-02 12:59:07 +02:00
parent 691f034f9d
commit 061054926d
3 changed files with 16 additions and 9 deletions

View file

@ -14,10 +14,15 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>
{ virus_scanning }:
{ config, pkgs, lib, ... }:
let
cfg = config.mailserver;
in
{
daemon.enable = virus_scanning;
updater.enable = virus_scanning;
config = lib.mkIf cfg.virus_scanning {
services.clamav.daemon.enable = true;
services.clamav.updater.enable = true;
};
}

View file

@ -51,8 +51,4 @@ in
inherit vmail_group_name vmail_user_name mail_dir enable_imap
enable_pop3 cert key;
};
clamav = import ./clamav.nix {
inherit virus_scanning;
};
}