plasma
This commit is contained in:
@@ -87,6 +87,7 @@ in
|
||||
systemd = {
|
||||
services = {
|
||||
NetworkManager-wait-online.enable = false;
|
||||
systemd-networkd-wait-online.enable = lib.mkForce false;
|
||||
systemd-networkd.stopIfChanged = false;
|
||||
systemd-resolved.stopIfChanged = false;
|
||||
};
|
||||
@@ -139,43 +140,39 @@ in
|
||||
extraCommands = lib.mkIf (cfg.extraFirewallCommands != "") cfg.extraFirewallCommands;
|
||||
};
|
||||
|
||||
# Configure iwd if enabled
|
||||
# Enable iwd daemon when requested.
|
||||
# When iwd is enabled alongside NetworkManager, iwd acts as the WiFi
|
||||
# backend for NM (iwd handles scanning/association; NM handles
|
||||
# connection management). They are not mutually exclusive.
|
||||
wireless.iwd = lib.mkIf cfg.iwd.enable {
|
||||
enable = true;
|
||||
settings = cfg.iwd.settings;
|
||||
};
|
||||
|
||||
# Configure NetworkManager
|
||||
networkmanager = mkMerge [
|
||||
# Disable NetworkManager when iwd is enabled
|
||||
(mkIf cfg.iwd.enable {
|
||||
enable = mkForce false;
|
||||
wifi.backend = mkForce "iwd";
|
||||
})
|
||||
# Configure NetworkManager when enabled
|
||||
networkmanager = mkIf cfg.networkmanager.enable {
|
||||
enable = true;
|
||||
# Use iwd as the WiFi backend when iwd is also enabled
|
||||
wifi.backend = mkIf cfg.iwd.enable "iwd";
|
||||
wifi.powersave = cfg.networkmanager.powersave;
|
||||
settings.connectivity.uri = mkDefault "http://nmcheck.gnome.org/check_network_status.txt";
|
||||
plugins = with pkgs; [
|
||||
networkmanager-fortisslvpn
|
||||
networkmanager-iodine
|
||||
networkmanager-l2tp
|
||||
networkmanager-openconnect
|
||||
networkmanager-openvpn
|
||||
networkmanager-sstp
|
||||
networkmanager-strongswan
|
||||
networkmanager-vpnc
|
||||
];
|
||||
|
||||
# Enable NetworkManager when wifi is enabled and iwd is disabled
|
||||
(mkIf (cfg.networkmanager.enable && !cfg.iwd.enable) {
|
||||
enable = true;
|
||||
wifi.powersave = cfg.networkmanager.powersave;
|
||||
settings.connectivity.uri = mkDefault "http://nmcheck.gnome.org/check_network_status.txt";
|
||||
plugins = with pkgs; [
|
||||
networkmanager-fortisslvpn
|
||||
networkmanager-iodine
|
||||
networkmanager-l2tp
|
||||
networkmanager-openconnect
|
||||
networkmanager-openvpn
|
||||
networkmanager-sstp
|
||||
networkmanager-strongswan
|
||||
networkmanager-vpnc
|
||||
];
|
||||
|
||||
# Configure WiFi profiles if any are defined
|
||||
ensureProfiles = mkIf (cfg.networkmanager.profiles != { }) {
|
||||
environmentFiles = lib.optional (config.sops.secrets ? wifi) config.sops.secrets.wifi.path;
|
||||
profiles = profiles;
|
||||
};
|
||||
})
|
||||
];
|
||||
# Configure WiFi profiles if any are defined
|
||||
ensureProfiles = mkIf (cfg.networkmanager.profiles != { }) {
|
||||
environmentFiles = lib.optional (config.sops.secrets ? wifi) config.sops.secrets.wifi.path;
|
||||
profiles = profiles;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user