aboutsummaryrefslogtreecommitdiffstats
path: root/hosts/common/optional
diff options
context:
space:
mode:
authorsadbeast <sadbeast@sadbeast.com>2024-05-30 00:47:47 +0000
committersadbeast <sadbeast@sadbeast.com>2024-10-05 16:44:14 -0700
commit09513b5c4e4babfaefdd06c592ef34c0908dc572 (patch)
tree5a9af6ef0407346c223334e295adc8012654f112 /hosts/common/optional
downloadnix-config-09513b5c4e4babfaefdd06c592ef34c0908dc572.tar.gz
nix-config-09513b5c4e4babfaefdd06c592ef34c0908dc572.tar.bz2
oh god what have i doneHEADmain
Diffstat (limited to 'hosts/common/optional')
-rw-r--r--hosts/common/optional/wireless.nix35
1 files changed, 35 insertions, 0 deletions
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";
+}