make networking setup more declarative
This commit is contained in:
parent
4c12928356
commit
f78ba400be
21
networks.nix
Normal file
21
networks.nix
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
# Allow ipv4 port forwarding
|
||||||
|
boot.kernel.sysctl = { "net.ipv4.ip_forward" = 1; };
|
||||||
|
|
||||||
|
networking = {
|
||||||
|
|
||||||
|
useDHCP = false;
|
||||||
|
interfaces.eth0.useDHCP = false;
|
||||||
|
interfaces.wlan0.useDHCP = true;
|
||||||
|
|
||||||
|
interfaces.eth0.ipv4.addresses = [ {
|
||||||
|
address = "192.168.22.1";
|
||||||
|
prefixLength = 24;
|
||||||
|
} ];
|
||||||
|
|
||||||
|
wireless.enable = true;
|
||||||
|
wireless.interfaces = [ "wlan0" ];
|
||||||
|
};
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user