environment to module

This commit is contained in:
Robin Raymond 2017-09-02 14:04:07 +02:00
parent 26ac134660
commit 201c532a67
2 changed files with 10 additions and 9 deletions

View file

@ -250,6 +250,7 @@ in
imports = [ imports = [
./mail-server/clamav.nix ./mail-server/clamav.nix
./mail-server/users.nix ./mail-server/users.nix
./mail-server/environment.nix
]; ];
config = mkIf cfg.enable { config = mkIf cfg.enable {
@ -260,11 +261,6 @@ in
certificateScheme certificateFile keyFile certificateDirectory virusScanning; certificateScheme certificateFile keyFile certificateDirectory virusScanning;
}; };
environment = import ./mail-server/environment.nix {
inherit pkgs;
inherit (cfg) certificateScheme;
};
networking = import ./mail-server/networking.nix { networking = import ./mail-server/networking.nix {
inherit (cfg) domain hostPrefix enableImap enablePop3; inherit (cfg) domain hostPrefix enableImap enablePop3;
}; };

View file

@ -14,10 +14,15 @@
# 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/>
{ pkgs, certificateScheme }: { config, pkgs, lib, ... }:
let
cfg = config.mailserver;
in
{ {
systemPackages = with pkgs; [ config = with cfg; lib.mkIf enable {
environment.systemPackages = with pkgs; [
dovecot opendkim openssh postfix clamav rspamd rmilter dovecot opendkim openssh postfix clamav rspamd rmilter
] ++ (if certificateScheme == 2 then [ openssl ] else []); ] ++ (if certificateScheme == 2 then [ openssl ] else []);
};
} }