From 2459c83f8e1704b875480b18baab7a3a6df912e3 Mon Sep 17 00:00:00 2001 From: Kris Lamoureux Date: Sun, 28 Jun 2026 02:45:06 -0400 Subject: [PATCH] Add a static IP for ens18 via NetworkManager --- configuration.nix | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/configuration.nix b/configuration.nix index 3292307..9a6f92d 100644 --- a/configuration.nix +++ b/configuration.nix @@ -14,17 +14,37 @@ boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; + # Machine name + networking.hostName = "nix-gaming"; + # Use latest kernel. boot.kernelPackages = pkgs.linuxPackages_latest; # Need nonfree for nvidia software and gaming nixpkgs.config.allowUnfree = true; - networking.hostName = "nix-gaming"; - # Configure network connections interactively with nmcli or nmtui. networking.networkmanager.enable = true; + # Add NetworkManager profile with static IP + networking.networkmanager.ensureProfiles.profiles = { + "ens18-static" = { + connection = { + id = "Ethernet"; + type = "ethernet"; + interface-name = "ens18"; + }; + ipv4 = { + method = "manual"; + address1 = "192.168.95.12/24,192.168.95.1"; + dns = "192.168.95.1;"; + }; + ipv6 = { + method = "disabled"; + }; + }; + }; + # Set your time zone. # time.timeZone = "Europe/Amsterdam";