24 lines
503 B
Nix
24 lines
503 B
Nix
{ ip_address, hostname }:
|
|
{
|
|
# Configure hostname.
|
|
networking.hostName = hostname;
|
|
|
|
# Conigure a static IP address.
|
|
networking.useDHCP = false;
|
|
networking.useNetworkd= true;
|
|
|
|
networking.defaultGateway = {
|
|
address = ip_address;
|
|
interface = "enp6s18";
|
|
};
|
|
|
|
networking.nameservers = [ "192.168.100.1" ];
|
|
networking.firewall.allowedTCPPorts = [ 80 443 ];
|
|
networking.interfaces.enp6s18.ipv4.addresses = [
|
|
{
|
|
address = ip_address;
|
|
prefixLength = 24;
|
|
}
|
|
];
|
|
}
|