add docs on declrative wifi configurations

reorganize with TOC
Aly Raffauf 2024-06-10 13:01:19 -04:00
parent 24e224b734
commit eb064c1c47
2 changed files with 12 additions and 1 deletions

@ -1 +1 @@
Welcome to the nixcfg wiki! 1. [[Networking]]

11
Networking.md Normal file

@ -0,0 +1,11 @@
## WiFi
WiFi networks can be configured declratively in `nixosModules/system/wifi.nix` using `networking.networkmanager.ensureProfiles.profiles`, provided by nixpkgs.
### Generating WiFi Profiles
[nm2nix](https://github.com/janik-haag/nm2nix) can generate nix-compatible code for all the WiFi networks in `/etc/NetworkManager/system-connections/` and `/run/NetworkManager/system-connections`.
```bash
sudo su -c "cd /etc/NetworkManager/system-connections && nix --extra-experimental-features 'nix-command flakes' run github:Janik-Haag/nm2nix | nix --extra-experimental-features 'nix-command flakes' run nixpkgs#nixfmt-rfc-style"
```