Add a static IP for ens18 via NetworkManager

This commit is contained in:
2026-06-28 02:45:06 -04:00
parent 5d292211b4
commit 2459c83f8e
+22 -2
View File
@@ -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";