networking to module

This commit is contained in:
Robin Raymond 2017-09-02 14:58:33 +02:00
parent 201c532a67
commit 9ac491f87d
2 changed files with 14 additions and 12 deletions

View file

@ -14,15 +14,21 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>
{ domain, hostPrefix, enableImap, enablePop3 }:
{ config, pkgs, lib, ... }:
let
cfg = config.mailserver;
in
{
#hostName = "${hostPrefix}.${domain}";
config = with cfg; lib.mkIf enable {
firewall = {
enable = true;
allowedTCPPorts = [ 25 587 ]
++ (if enableImap then [ 143 ] else [])
++ (if enablePop3 then [ 110 ] else []);
networking.hostName = "${hostPrefix}.${domain}";
networking.firewall = {
enable = true;
allowedTCPPorts = [ 25 587 ]
++ (if enableImap then [ 143 ] else [])
++ (if enablePop3 then [ 110 ] else []);
};
};
}