nixos-config/modules/network.nix

28 lines
722 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 ];
2020-03-03 18:52:13 +04:00
interfaces.wlan0.allowedTCPPortRanges = [{
2020-02-17 17:00:59 +04:00
from = 1714;
to = 1764;
}];
2020-03-03 18:52:13 +04:00
interfaces.wlan0.allowedUDPPortRanges = [{
2020-02-17 17:00:59 +04:00
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";
}