Kieran's opinionated (and probably slightly dumb) nix config
at main 53 lines 1.7 kB view raw view rendered
1# wifi 2 3Declarative Wi-Fi profile manager using NetworkManager. Supports three ways to supply passwords and has built-in eduroam (WPA-EAP) support. 4 5## Options 6 7All options under `atelier.network.wifi`: 8 9| Option | Type | Default | Description | 10|--------|------|---------|-------------| 11| `enable` | bool | `false` | Enable Wi-Fi management | 12| `hostName` | string | — | Sets `networking.hostName` | 13| `nameservers` | list of strings | `[]` | Custom DNS servers | 14| `envFile` | path | — | Environment file providing PSK variables for all profiles | 15 16### Profiles 17 18Defined under `atelier.network.wifi.profiles.<ssid>`: 19 20| Option | Type | Default | Description | 21|--------|------|---------|-------------| 22| `psk` | string or null | `null` | Literal WPA-PSK passphrase | 23| `pskVar` | string or null | `null` | Environment variable name containing the PSK (from `envFile`) | 24| `pskFile` | path or null | `null` | Path to file containing the PSK | 25| `eduroam` | bool | `false` | Use WPA-EAP with MSCHAPV2 (for eduroam networks) | 26| `identity` | string or null | `null` | EAP identity (required when `eduroam = true`) | 27 28Only one of `psk`, `pskVar`, or `pskFile` should be set per profile. 29 30## Example 31 32```nix 33atelier.network.wifi = { 34 enable = true; 35 hostName = "moonlark"; 36 nameservers = [ "1.1.1.1" "8.8.8.8" ]; 37 envFile = config.age.secrets.wifi.path; 38 39 profiles = { 40 "Home Network" = { 41 pskVar = "HOME_PSK"; # read from envFile 42 }; 43 "eduroam" = { 44 eduroam = true; 45 identity = "user@university.edu"; 46 pskVar = "EDUROAM_PSK"; 47 }; 48 "Phone Hotspot" = { 49 pskFile = config.age.secrets.hotspot.path; 50 }; 51 }; 52}; 53```