Prestage a declarative wifi connection on the gui host
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:
2026-07-21 23:42:22 +00:00
parent cb141f0a41
commit 14621e7ad5
3 changed files with 37 additions and 0 deletions
+26
View File
@@ -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;
};
};
};
}