nixos-config/modules/network.nix

28 lines
688 B
Nix
Raw Normal View History

2020-02-17 17:00:59 +04:00
{ pkgs, lib, config, ... }: {
networking = {
networkmanager.enable = true;
firewall = {
enable = true;
allowedTCPPorts = [ 13748 13722 5000 22 80 443 ];
allowedTCPPortRanges = [{
from = 1714;
to = 1764;
}];
allowedUDPPortRanges = [{
from = 1714;
to = 1764;
}];
};
resolvconf.extraConfig = ''
local_nameservers=""
name_server_blacklist="0.0.0.0 127.0.0.1"
resolv_conf_local_only=NO
'';
usePredictableInterfaceNames = false;
hostName = config.device;
};
systemd.services.ModemManager.wantedBy =
lib.optional (config.device == "ThinkPad-Laptop") "network.target";
}