From 09513b5c4e4babfaefdd06c592ef34c0908dc572 Mon Sep 17 00:00:00 2001 From: sadbeast Date: Thu, 30 May 2024 00:47:47 +0000 Subject: oh god what have i done --- hosts/common/optional/wireless.nix | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 hosts/common/optional/wireless.nix (limited to 'hosts/common/optional/wireless.nix') diff --git a/hosts/common/optional/wireless.nix b/hosts/common/optional/wireless.nix new file mode 100644 index 0000000..ce66419 --- /dev/null +++ b/hosts/common/optional/wireless.nix @@ -0,0 +1,35 @@ +{config, ...}: { + # Wireless secrets stored through sops + sops.secrets.wireless = { + sopsFile = ../secrets.yaml; + neededForUsers = true; + }; + + networking.wireless = { + enable = true; + fallbackToWPA2 = false; + + # Declarative + secretsFile = config.sops.secrets.wireless.path; + networks = { + "Black Vulture" = { + pskRaw = "ext:home_psk"; + }; + }; + + # Imperative + allowAuxiliaryImperativeNetworks = true; + userControlled = { + enable = true; + group = "network"; + }; + extraConfig = '' + update_config=1 + ''; + }; + + # Ensure group exists + users.groups.network = {}; + + systemd.services.wpa_supplicant.preStart = "touch /etc/wpa_supplicant.conf"; +} -- cgit v1.2.3