From 027834dc59c9599631d799c2951c677e52333ee3 Mon Sep 17 00:00:00 2001 From: Adithya Nair Date: Thu, 20 Jul 2023 20:40:19 +0530 Subject: [PATCH] switch to systemd-networkd --- hosts/skipper/default.nix | 26 ++------------------------ hosts/skipper/network.nix | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 24 deletions(-) create mode 100644 hosts/skipper/network.nix diff --git a/hosts/skipper/default.nix b/hosts/skipper/default.nix index b534f28..ce69fa1 100644 --- a/hosts/skipper/default.nix +++ b/hosts/skipper/default.nix @@ -1,12 +1,9 @@ -{ - lib, - pkgs, - ... -}: { +{pkgs, ...}: { imports = [ ./hardware ./programs ./services + ./network.nix ./persistence.nix ./plymouth.nix ./rollback.nix @@ -16,7 +13,6 @@ ./virtualisation.nix ]; - boot.binfmt.emulatedSystems = ["aarch64-linux"]; console.useXkbConfig = true; environment.sessionVariables = { @@ -57,24 +53,6 @@ location.provider = "geoclue2"; - networking = { - hostName = "Skipper"; - networkmanager = { - enable = true; - dns = "systemd-resolved"; - wifi = { - backend = "iwd"; - powersave = false; - }; - extraConfig = '' - [device] - wifi.iwd.autoconnect=yes - ''; - }; - useDHCP = lib.mkDefault false; - wireless.iwd.enable = true; - }; - sound.enable = true; time.timeZone = "Asia/Kolkata"; diff --git a/hosts/skipper/network.nix b/hosts/skipper/network.nix new file mode 100644 index 0000000..6f6996a --- /dev/null +++ b/hosts/skipper/network.nix @@ -0,0 +1,32 @@ +_: { + networking = { + hostName = "Skipper"; + wireless.iwd = { + enable = true; + settings = { + General = { + AddressRandomization = "network"; + }; + Settings = { + AutoConnect = true; + }; + }; + }; + }; + + systemd.network = { + enable = true; + networks.wifi = { + enable = true; + matchConfig = { + Name = "wlan0"; + }; + networkConfig = { + DHCP = "yes"; + }; + linkConfig = { + RequiredForOnline = "yes"; + }; + }; + }; +}