diff --git a/modules/linux/core/default.nix b/modules/linux/core/default.nix index 6f58fac..9f5a6b5 100644 --- a/modules/linux/core/default.nix +++ b/modules/linux/core/default.nix @@ -46,23 +46,6 @@ in ''; }; suppressWarnings = lib.mkEnableOption "suppress warnings"; - networking = { - enable = lib.mkOption { - type = lib.types.bool; - default = true; - description = ''Whether to set up and enable networking daemons.''; - }; - backend = lib.mkOption { - type = lib.types.enum [ - "wpa_supplicant" - "iwd" - ]; - default = "wpa_supplicant"; - description = '' - Which backend to use for networking. Default is wpa_supplicant with NetworkManager as a frontend. With iwd, iwctl is the frontend. - ''; - }; - }; bluetooth.enable = lib.mkOption { type = lib.types.bool; default = true; @@ -161,19 +144,6 @@ in hardware.enableRedistributableFirmware = true; - networking.networkmanager.enable = lib.mkIf ( - cfg.networking.enable && cfg.networking.backend == "wpa_supplicant" - ) true; - - systemd.services.NetworkManager-wait-online.enable = lib.mkIf ( - cfg.networking.enable && cfg.networking.backend == "wpa_supplicant" - ) false; - - networking.wireless.iwd = lib.mkIf (cfg.networking.enable && cfg.networking.backend == "iwd") { - enable = true; - settings.General.EnableNetworkConfiguration = true; - }; - programs.gnupg.agent = { enable = true; enableSSHSupport = true; diff --git a/modules/linux/networking/default.nix b/modules/linux/networking/default.nix index 7f898e5..ba49980 100755 --- a/modules/linux/networking/default.nix +++ b/modules/linux/networking/default.nix @@ -31,6 +31,16 @@ in vite = lib.mkEnableOption "firewall ports for Vite"; }; cloudflareNameservers.enable = lib.mkEnableOption "Cloudflare DNS servers"; + backend = lib.mkOption { + type = lib.types.enum [ + "wpa_supplicant" + "iwd" + ]; + default = "wpa_supplicant"; + description = '' + Which backend to use for networking. Default is wpa_supplicant with NetworkManager as a frontend. With iwd, iwctl is the frontend. + ''; + }; }; config = lib.mkIf cfg.enable { @@ -55,5 +65,17 @@ in "1.1.1.1" "1.0.0.1" ]; + + networking.networkmanager.enable = lib.mkIf (cfg.enable && cfg.backend == "wpa_supplicant") true; + + systemd.services.NetworkManager-wait-online.enable = lib.mkIf ( + cfg.enable && cfg.backend == "wpa_supplicant" + ) false; + + networking.wireless.iwd = lib.mkIf (cfg.enable && cfg.backend == "iwd") { + enable = true; + settings.General.EnableNetworkConfiguration = true; + }; + }; } diff --git a/reference/hosts/callisto/configuration.nix b/reference/hosts/callisto/configuration.nix index c647215..83b96ba 100755 --- a/reference/hosts/callisto/configuration.nix +++ b/reference/hosts/callisto/configuration.nix @@ -28,6 +28,7 @@ networking = { firewallPresets.vite = true; cloudflareNameservers.enable = true; + backend = "iwd"; }; }; };