项目作者: jmackie

项目描述 :
🌐 Declarative NetworkManager profiles in NixOS
高级语言: Nix
项目地址: git://github.com/jmackie/nixos-networkmanager-profiles.git
创建时间: 2020-03-17T11:17:19Z
项目社区:https://github.com/jmackie/nixos-networkmanager-profiles

开源协议:

下载


nixos-networkmanager-profiles

Declarative NetworkManager 👌

Shoutout to @Shou as this was fully his idea.

Usage

I suggest using nmtui or nm-connection-editor to write the *.nmconnection
file (look in /etc/NetworkManager/system-connections) then converting that to Nix
attributes like so:

  1. # configuration.nix
  2. { ... }: {
  3. imports = [
  4. (import (builtins.fetchTarball https://github.com/jmackie/nixos-networkmanager-profiles/archive/master.tar.gz))
  5. ];
  6. config.networking.networkmanager.profiles = {
  7. "home-wifi" = {
  8. connection = {
  9. id = "home-wifi";
  10. uuid = "<your-uuid-here>";
  11. type = "wifi";
  12. permissions = "";
  13. };
  14. wifi = {
  15. mac-address-blacklist = "";
  16. mode = "infrastructure";
  17. ssid = "Home Wi-Fi";
  18. };
  19. wifi-security = {
  20. auth-alg = "open";
  21. key-mgmt = "wpa-psk";
  22. psk = "<password>";
  23. };
  24. ipv4 = {
  25. dns-search = "";
  26. method = "auto";
  27. };
  28. ipv6 = {
  29. addr-gen-mode = "stable-privacy";
  30. dns-search = "";
  31. method = "auto";
  32. };
  33. };
  34. };
  35. }