Skip to content

Networkmanager

networking.networkmanager.appendNameservers

A list of name servers that should be appended to the ones configured in NetworkManager or received by DHCP.

Type: list of string

Default

[ ]

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/networking/networkmanager.nix

networking.networkmanager.connectionConfig

Configuration for the [connection] section of NetworkManager.conf. Refer to https://developer.gnome.org/NetworkManager/stable/NetworkManager.conf.html#id-1.2.3.11 or {manpage}NetworkManager.conf(5) for more information.

Type: attribute set of (null or boolean or signed integer or string)

Default

{ }

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/networking/networkmanager.nix

networking.networkmanager.dhcp

Which program (or internal library) should be used for DHCP.

Type: one of "dhcpcd", "internal"

Default

"internal"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/networking/networkmanager.nix

networking.networkmanager.dispatcherScripts

A list of scripts which will be executed in response to network events.

Type: list of (submodule)

Default

[ ]

Example

`#!nix [ { source = pkgs.writeText "upHook" '' if [ "$2" != "up" ]; then logger "exit: event $2 != up" exit fi

# coreutils and iproute are in PATH too
logger "Device $DEVICE_IFACE coming up"

''; type = "basic"; } ] `

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/networking/networkmanager.nix

networking.networkmanager.dispatcherScripts.*.source

Path to the hook script.

Type: path

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/networking/networkmanager.nix

networking.networkmanager.dispatcherScripts.*.type

Dispatcher hook type. Look up the hooks described at https://developer.gnome.org/NetworkManager/stable/NetworkManager.html and choose the type depending on the output folder. You should then filter the event type (e.g., "up"/"down") from within your script.

Type: one of "basic", "pre-down", "pre-up"

Default

"basic"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/networking/networkmanager.nix

networking.networkmanager.dns

Set the DNS (resolv.conf) processing mode.

A description of these modes can be found in the main section of https://developer.gnome.org/NetworkManager/stable/NetworkManager.conf.html or in {manpage}NetworkManager.conf(5).

Type: one of "default", "dnsmasq", "systemd-resolved", "none"

Default

"default"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/networking/networkmanager.nix

networking.networkmanager.enable

Whether to use NetworkManager to obtain an IP address and other configuration for all network interfaces that are not manually configured. If enabled, a group networkmanager will be created. Add all users that should have permission to change network settings to this group.

Type: boolean

Default

false

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/networking/networkmanager.nix

networking.networkmanager.enableStrongSwan

Enable the StrongSwan plugin.

If you enable this option the networkmanager_strongswan plugin will be added to the {option}networking.networkmanager.plugins option so you don't need to do that yourself.

Type: boolean

Default

false

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/networking/networkmanager.nix

networking.networkmanager.ensureProfiles.environmentFiles

Files to load as environment file. Environment variables from this file will be substituted into the static configuration file using envsubst.

Type: list of path

Default

[ ]

Example

["/run/secrets/network-manager.env"]

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/networking/networkmanager.nix

networking.networkmanager.ensureProfiles.profiles

Declaratively define NetworkManager profiles. You can find information about the generated file format here and here. You current profiles which are most likely stored in /etc/NetworkManager/system-connections and there is a tool to convert them to the needed nix code. If you add a new ad-hoc connection via a GUI or nmtui or anything similar it should just work together with the declarative ones. And if you edit a declarative profile NetworkManager will move it to the persistent storage and treat it like a ad-hoc one, but there will be two profiles as soon as the systemd unit from this option runs again which can be confusing since NetworkManager tools will start displaying two profiles with the same name and probably a bit different settings depending on what you edited. A profile won't be deleted even if it's removed from the config until the system reboots because that's when NetworkManager clears it's temp directory. If networking.resolvconf.enable is true, attributes affecting the name resolution (such as ignore-auto-dns) may not end up changing /etc/resolv.conf as expected when other name services (for example networking.dhcpcd) are enabled. Run resolvconf -l in the terminal to see what each service produces.

Type: attribute set of (attribute set of section of an INI file (attrs of INI atom (null, bool, int, float or string)))

Default

{ }

Example

{home-wifi = {connection = {id = "home-wifi";permissions = "";type = "wifi";};ipv4 = {dns-search = "";method = "auto";};ipv6 = {addr-gen-mode = "stable-privacy";dns-search = "";method = "auto";};wifi = {mac-address-blacklist = "";mode = "infrastructure";ssid = "Home Wi-Fi";};wifi-security = {auth-alg = "open";key-mgmt = "wpa-psk";psk = "$HOME_WIFI_PASSWORD";};};}

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/networking/networkmanager.nix

networking.networkmanager.ensureProfiles.profiles.<name>.connection.id

This is the name that will be displayed by NetworkManager and GUIs. Type: string

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/networking/networkmanager.nix

networking.networkmanager.ensureProfiles.profiles.<name>.connection.type

The connection type defines the connection kind, like vpn, wireguard, gsm, wifi and more. Type: string

Example

"vpn"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/networking/networkmanager.nix

networking.networkmanager.ethernet.macAddress

Set the MAC address of the interface.

  • "XX:XX:XX:XX:XX:XX": MAC address of the interface
  • "permanent": Use the permanent MAC address of the device
  • "preserve": Don’t change the MAC address of the device upon activation
  • "random": Generate a randomized value upon each connect
  • "stable": Generate a stable, hashed MAC address

Type: string or one of "permanent", "preserve", "random", "stable"

Default

"preserve"

Example

"00:11:22:33:44:55"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/networking/networkmanager.nix

networking.networkmanager.fccUnlockScripts

List of FCC unlock scripts to enable on the system, behaving as described in https://modemmanager.org/docs/modemmanager/fcc-unlock/#integration-with-third-party-fcc-unlock-tools.

Type: list of (submodule)

Default

[ ]

Example

[{ id = "03f0:4e1d"; path = "${pkgs.modemmanager}/share/ModemManager/fcc-unlock.available.d/03f0:4e1d"; }]

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/networking/networkmanager.nix

networking.networkmanager.fccUnlockScripts.*.id

vid:pid of either the PCI or USB vendor and product ID Type: string

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/networking/networkmanager.nix

networking.networkmanager.fccUnlockScripts.*.path

Path to the unlock script Type: path

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/networking/networkmanager.nix

networking.networkmanager.insertNameservers

A list of name servers that should be inserted before the ones configured in NetworkManager or received by DHCP.

Type: list of string

Default

[ ]

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/networking/networkmanager.nix

networking.networkmanager.logLevel

Set the default logging verbosity level.

Type: one of "OFF", "ERR", "WARN", "INFO", "DEBUG", "TRACE"

Default

"WARN"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/networking/networkmanager.nix

networking.networkmanager.plugins

List of NetworkManager plug-ins to enable. Some plug-ins are enabled by the NetworkManager module by default.

Type: list of NetworkManager plug-in

Default

[ ]

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/networking/networkmanager.nix

networking.networkmanager.settings

Configuration added to the generated NetworkManager.conf, note that you can overwrite settings with this. Refer to https://developer.gnome.org/NetworkManager/stable/NetworkManager.conf.html or {manpage}NetworkManager.conf(5) for more information.

Type: attribute set of section of an INI file (attrs of INI atom (null, bool, int, float or string))

Default

{ }

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/networking/networkmanager.nix

networking.networkmanager.unmanaged

List of interfaces that will not be managed by NetworkManager. Interface name can be specified here, but if you need more fidelity, refer to https://developer.gnome.org/NetworkManager/stable/NetworkManager.conf.html#device-spec or the "Device List Format" Appendix of {manpage}NetworkManager.conf(5).

Type: list of string

Default

[ ]

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/networking/networkmanager.nix

networking.networkmanager.wifi.backend

Specify the Wi-Fi backend used for the device. Currently supported are {option}wpa_supplicant or {option}iwd (experimental).

Type: one of "wpa_supplicant", "iwd"

Default

"wpa_supplicant"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/networking/networkmanager.nix

networking.networkmanager.wifi.macAddress

Set the MAC address of the interface.

  • "XX:XX:XX:XX:XX:XX": MAC address of the interface
  • "permanent": Use the permanent MAC address of the device
  • "preserve": Don’t change the MAC address of the device upon activation
  • "random": Generate a randomized value upon each connect
  • "stable": Generate a stable, hashed MAC address
  • "stable-ssid": Generate a stable MAC addressed based on Wi-Fi network

Type: string or one of "permanent", "preserve", "random", "stable", "stable-ssid"

Default

"preserve"

Example

"00:11:22:33:44:55"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/networking/networkmanager.nix

networking.networkmanager.wifi.powersave

Whether to enable Wi-Fi power saving.

Type: null or boolean

Default

null

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/networking/networkmanager.nix

networking.networkmanager.wifi.scanRandMacAddress

Whether to enable MAC address randomization of a Wi-Fi device during scanning.

Type: boolean

Default

true

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/networking/networkmanager.nix