summaryrefslogtreecommitdiff
path: root/modules/root/wifi.nix
diff options
context:
space:
mode:
authorTim Keller <tjkeller.xyz>2025-01-05 16:19:45 -0600
committerTim Keller <tjkeller.xyz>2025-01-05 16:19:45 -0600
commit1835aa04051f2f0c41017423f2bcba6c549f26b0 (patch)
treeb5f26e29032e9084b27eeb0688c7a3a9bb0df57f /modules/root/wifi.nix
parentd0faef2f53e2e5195b2acc7cc7bba898bd7cd05b (diff)
downloadnixos-1835aa04051f2f0c41017423f2bcba6c549f26b0.tar.xz
nixos-1835aa04051f2f0c41017423f2bcba6c549f26b0.zip
overhual
Diffstat (limited to 'modules/root/wifi.nix')
-rw-r--r--modules/root/wifi.nix24
1 files changed, 7 insertions, 17 deletions
diff --git a/modules/root/wifi.nix b/modules/root/wifi.nix
index 880d436..542cfd7 100644
--- a/modules/root/wifi.nix
+++ b/modules/root/wifi.nix
@@ -1,18 +1,4 @@
-{ pkgs, lib, config, ... }:
-let
- mkNetworksFromEnvironmentFile = n: builtins.listToAttrs (
- map (i: {
- name = "@SSID_${toString i}@";
- value = {
- psk = "@PSK_${toString i}@";
- priority = n - i;
- };
- }) (lib.lists.range 1 n)
- );
- environmentFile = config.sops.secrets.wireless-env.path;
- #networks = mkNetworksFromEnvironmentFile ((builtins.length (lib.strings.splitString "\n" (builtins.readFile environmentFile))) / 2);
- networks = mkNetworksFromEnvironmentFile 9; # Number of networks listed in wireless-env
-in {
+{ lib, config, ... }: {
options = {
wifi.enable = lib.mkEnableOption "enables wifi";
};
@@ -21,8 +7,12 @@ in {
networking.wireless = {
enable = true; # Enables wireless support via wpa_supplicant.
userControlled.enable = true;
- inherit networks;
- inherit environmentFile;
+ allowAuxiliaryImperativeNetworks = true; # Networks defined in aux imperitive networks (/etc/wpa_supplicant.conf)
+ };
+
+ # Link /etc/wpa_supplicant.conf -> secret config
+ environment.etc."wpa_supplicant.conf" = {
+ source = config.sops.secrets.wpa_supplicant-conf.path;
};
};
}