Skip to content

jmackie/nixos-networkmanager-profiles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 

Repository files navigation

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:

# configuration.nix

{ ... }: {

  imports = [ 
    (import (builtins.fetchTarball https://github.com/jmackie/nixos-networkmanager-profiles/archive/master.tar.gz))
  ];

  config.networking.networkmanager.profiles = {
    "home-wifi" = { 
      connection = {
        id = "home-wifi";
        uuid = "<your-uuid-here>";
        type = "wifi";
        permissions = "";
      };
      wifi = {
        mac-address-blacklist = "";
        mode = "infrastructure";
        ssid = "Home Wi-Fi";
      };
      wifi-security = {
        auth-alg = "open";
        key-mgmt = "wpa-psk";
        psk = "<password>";
      };
      ipv4 = {
        dns-search = "";
        method = "auto";
      };
      ipv6 = {
        addr-gen-mode = "stable-privacy";
        dns-search = "";
        method = "auto";
      };
    };
  };
}

About

🌐 Declarative NetworkManager profiles in NixOS

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages