mirror of
https://gitlab.com/simple-nixos-mailserver/nixos-mailserver.git
synced 2024-12-27 11:40:32 +05:00
make clamav a module
This commit is contained in:
parent
691f034f9d
commit
061054926d
10
default.nix
10
default.nix
@ -82,6 +82,7 @@ in
|
||||
mkpasswd -m sha-512 "super secret password"
|
||||
```
|
||||
'';
|
||||
default = {};
|
||||
};
|
||||
|
||||
valiases = mkOption {
|
||||
@ -98,6 +99,7 @@ in
|
||||
forwarded to some valid email address. (Alternatively you can create login
|
||||
accounts for `postmaster` and (or) `abuse`).
|
||||
'';
|
||||
default = {};
|
||||
};
|
||||
|
||||
vmail_id_start = mkOption {
|
||||
@ -245,12 +247,16 @@ in
|
||||
};
|
||||
};
|
||||
|
||||
imports = [
|
||||
./mail-server/clamav.nix
|
||||
];
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
services = import ./mail-server/services.nix {
|
||||
inherit lib;
|
||||
inherit (cfg) mail_dir vmail_user_name vmail_group_name valiases domain
|
||||
enable_imap enable_pop3 virus_scanning dkim_signing dkim_selector
|
||||
dkim_dir certificate_scheme cert_file key_file cert_dir;
|
||||
enable_imap enable_pop3 dkim_signing dkim_selector dkim_dir
|
||||
certificate_scheme cert_file key_file cert_dir virus_scanning;
|
||||
};
|
||||
|
||||
environment = import ./mail-server/environment.nix {
|
||||
|
@ -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;
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user