Archived
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.
27 lines
779 B
Nix
27 lines
779 B
Nix
{ 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;
|
|
};
|
|
};
|
|
};
|
|
}
|