Archived
Prestage a declarative wifi connection on the gui host
Check NixOS configurations / eval-hosts (pull_request) Successful in 10m32s
Check NixOS configurations / eval-hosts (pull_request) Successful in 10m32s
Adds modules/networking/wifi.nix using NetworkManager's ensureProfiles mechanism so the gui host associates to a known SSID on first boot with no manual nmtui step. Credentials are placeholders in variables.nix (wifiSsid/wifiPassword, both empty) to be filled in once the bare-metal hardware profile is wired up — the module is a no-op until then.
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
{ lib, vars, ... }:
|
||||
|
||||
{
|
||||
# Prestages a NetworkManager connection profile for vars.wifiSsid/
|
||||
# wifiPassword so the host associates on first boot with no manual
|
||||
# nmtui/nmcli step. Guarded on a non-empty SSID so leaving the
|
||||
# placeholders blank in variables.nix is a no-op rather than an empty,
|
||||
# broken profile — fill both in once the bare-metal hardware profile is
|
||||
# wired up.
|
||||
networking.networkmanager.ensureProfiles.profiles = lib.mkIf (vars.wifiSsid != "") {
|
||||
${vars.wifiSsid} = {
|
||||
connection = {
|
||||
id = vars.wifiSsid;
|
||||
type = "wifi";
|
||||
};
|
||||
wifi = {
|
||||
mode = "infrastructure";
|
||||
ssid = vars.wifiSsid;
|
||||
};
|
||||
wifi-security = {
|
||||
key-mgmt = "wpa-psk";
|
||||
psk = vars.wifiPassword;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user