From 4053256ace4df2275330153ba7e36caf728a8485 Mon Sep 17 00:00:00 2001 From: MoritzBoehme Date: Sun, 9 Jan 2022 14:15:39 +0100 Subject: [PATCH] :rocket: enables static network configuration --- hosts/nixos-desktop/default.nix | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/hosts/nixos-desktop/default.nix b/hosts/nixos-desktop/default.nix index 547d710..b86c7fa 100644 --- a/hosts/nixos-desktop/default.nix +++ b/hosts/nixos-desktop/default.nix @@ -29,10 +29,19 @@ # NETWORKING networking = { hostName = "nixos-desktop"; - networkmanager.enable = true; - + defaultGateway = "192.168.0.1"; + nameservers = [ "192.168.0.4" ]; useDHCP = false; - interfaces.enp42s0.useDHCP = true; + interfaces.enp42s0 = { + useDHCP = false; + ipv4 = { + addresses = [{ + address = "192.168.0.10"; + prefixLength = 24; + }]; + }; + }; + networkmanager.enable = true; }; services.xserver.videoDrivers = [ "nvidia" ];