stinky wifi

This commit is contained in:
2025-10-28 17:25:15 +00:00
parent 37aad7d951
commit 4907238726
4 changed files with 69 additions and 0 deletions

38
common/wifi.nix Normal file
View File

@@ -0,0 +1,38 @@
{ config, lib, ... }:
{
# WiFi configuration for NixOS hosts
# Import this module on hosts that should connect to WiFi
# Credentials stored in secrets/wifi.yaml (access controlled via .sops.yaml)
sops.secrets.wifi-password-pi = {
sopsFile = ./../secrets/wifi.yaml;
};
networking.wireless = {
enable = true;
networks = {
"pi" = {
pskRaw = "ext:wifi-password-pi";
};
};
# Only enable on wireless interface, not ethernet
interfaces = [ "wlan0" ];
};
# Prefer wifi over ethernet, but keep ethernet as fallback
networking.dhcpcd.extraConfig = ''
# Prefer wlan0 over ethernet interfaces
interface wlan0
metric 100
interface eth0
metric 200
'';
# Persist wireless configuration across reboots (for impermanence)
environment.persistence.${config.custom.impermanence.persistPath} = {
files = [
"/etc/wpa_supplicant.conf"
];
};
}