From 7717607628b47417da1a3f918d7d755f27595a93 Mon Sep 17 00:00:00 2001 From: Natsu Kagami Date: Fri, 31 Mar 2023 10:56:24 +0200 Subject: [PATCH] Use systemd-networkd --- nki-home/configuration.nix | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/nki-home/configuration.nix b/nki-home/configuration.nix index 7e333bc..c472cc2 100644 --- a/nki-home/configuration.nix +++ b/nki-home/configuration.nix @@ -46,8 +46,28 @@ }; }; + systemd.network.enable = true; networking.hostName = "kagamiPC"; # Define your hostname. networking.wireless.iwd.enable = true; + # The global useDHCP flag is deprecated, therefore explicitly set to false here. + # Per-interface useDHCP will be mandatory in the future, so this generated config + # replicates the default behaviour. + systemd.network.networks = { + # Wired + "10-wired" = { + matchConfig.Name = "enp*"; + networkConfig.DHCP = "yes"; + }; + # Wireless + "20-wireless" = { + matchConfig.Name = "wlan*"; + networkConfig.DHCP = "yes"; + }; + }; + # networking.useDHCP = false; + # networking.interfaces.enp38s0.useDHCP = true; + # networking.interfaces.wlan0.useDHCP = true; + # Allow qmk boards to boot services.udev.packages = with pkgs; [ qmk-udev-rules ]; @@ -55,13 +75,6 @@ # Set your time zone. time.timeZone = "Europe/Zurich"; - # The global useDHCP flag is deprecated, therefore explicitly set to false here. - # Per-interface useDHCP will be mandatory in the future, so this generated config - # replicates the default behaviour. - networking.useDHCP = false; - networking.interfaces.enp38s0.useDHCP = true; - networking.interfaces.wlan0.useDHCP = true; - # Configure network proxy if necessary # networking.proxy.default = "http://user:password@proxy:port/"; # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";