diff options
author | Linnnus <[email protected]> | 2024-12-25 21:07:51 +0000 |
---|---|---|
committer | Linnnus <[email protected]> | 2024-12-27 09:07:52 +0100 |
commit | d925e7a6f8d0af246fd8ad7e253c510bdf3c8eb5 (patch) | |
tree | cdf8546347e7255c426fa433602a55f37468c779 /hosts | |
parent | 3bf29c686274e19576aeb4f19510fa0702d2cb0c (diff) |
omar: Add wpa networking config
Diffstat (limited to 'hosts')
-rw-r--r-- | hosts/omar/configuration.nix | 6 | ||||
-rw-r--r-- | hosts/omar/wireless-networking/default.nix | 19 |
2 files changed, 21 insertions, 4 deletions
diff --git a/hosts/omar/configuration.nix b/hosts/omar/configuration.nix index 681a199..69df37a 100644 --- a/hosts/omar/configuration.nix +++ b/hosts/omar/configuration.nix @@ -12,6 +12,8 @@ ../../shared/nixos-and-darwin/common-shell-settings ../../shared/nixos-and-darwin/common-hm-settings ../../shared/nixos/zfs-impermenance + + ./wireless-networking ]; boot.loader.grub = { @@ -34,10 +36,6 @@ # Should match containing folder. networking.hostName = "omar"; - # Pick only one of the below networking options. - networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. - # networking.networkmanager.enable = true; # Easiest to use and most distros use this by default. - # Create the main user. users.users.linus = { isNormalUser = true; diff --git a/hosts/omar/wireless-networking/default.nix b/hosts/omar/wireless-networking/default.nix new file mode 100644 index 0000000..78a9d3e --- /dev/null +++ b/hosts/omar/wireless-networking/default.nix @@ -0,0 +1,19 @@ +# This module configures wireless networking using WPA. + +{...}: + +{ + # Enables wireless support via wpa_supplicant. + networking.wireless.enable = true; + + # wpa_supplicant needs a configuration file. That file contains plaintext + # passwords and should NOT be added to the configuration. Instead, let's + # store it persistently. + # + # I created that file with the following commands: + # mkdir -p /persist/etc/ + # echo '# Allow frontend (e.g. wpa_cli) to be used by all users in 'wheel' group. + # ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel' >/persist/etc/wpa_supplicant.conf + # And then I added the network={} blocks for the networks I know. + environment.etc."wpa_supplicant.conf".source = "/persist/etc/wpa_supplicant.conf"; +} |