From 9ef6c886b9566222c586a8925827773a326c3b7d Mon Sep 17 00:00:00 2001 From: Snorre Ettrup Altschul Date: Mon, 3 Mar 2025 12:15:01 +0100 Subject: [PATCH] static ip --- modules/networking.nix | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/modules/networking.nix b/modules/networking.nix index d57c44b..3aa0636 100644 --- a/modules/networking.nix +++ b/modules/networking.nix @@ -1,10 +1,22 @@ -{hostname ? "server"}: {...}: { +{ hostname ? "server" }: { ... }: { networking.hostName = hostname; networking.hostId = "2ead098f"; networking.networkmanager.enable = true; networking.firewall = { enable = true; - allowedTCPPorts = []; - allowedUDPPorts = []; + allowedTCPPorts = [ ]; + allowedUDPPorts = [ ]; + }; + + # Static ip + networking.interfaces.enp2s0 = { + ipv4.addresses = [{ + address = "10.0.201.83"; + prefixLength = 24; + }]; + }; + networking.defaultGateway = { + address = "10.0.201.1"; + interface = "enp2s0"; }; }