Add a static IP for ens18 via NetworkManager
This commit is contained in:
+22
-2
@@ -14,17 +14,37 @@
|
|||||||
boot.loader.systemd-boot.enable = true;
|
boot.loader.systemd-boot.enable = true;
|
||||||
boot.loader.efi.canTouchEfiVariables = true;
|
boot.loader.efi.canTouchEfiVariables = true;
|
||||||
|
|
||||||
|
# Machine name
|
||||||
|
networking.hostName = "nix-gaming";
|
||||||
|
|
||||||
# Use latest kernel.
|
# Use latest kernel.
|
||||||
boot.kernelPackages = pkgs.linuxPackages_latest;
|
boot.kernelPackages = pkgs.linuxPackages_latest;
|
||||||
|
|
||||||
# Need nonfree for nvidia software and gaming
|
# Need nonfree for nvidia software and gaming
|
||||||
nixpkgs.config.allowUnfree = true;
|
nixpkgs.config.allowUnfree = true;
|
||||||
|
|
||||||
networking.hostName = "nix-gaming";
|
|
||||||
|
|
||||||
# Configure network connections interactively with nmcli or nmtui.
|
# Configure network connections interactively with nmcli or nmtui.
|
||||||
networking.networkmanager.enable = true;
|
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.
|
# Set your time zone.
|
||||||
# time.timeZone = "Europe/Amsterdam";
|
# time.timeZone = "Europe/Amsterdam";
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user