NixOS / NixOS/nixpkgs

nixos/networkmanager: wireless autoconnect not working on boot with ensureProfiles

Open
#548,751 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

0.kind: bug 6.topic: nixos
Dominant language
Nix
Stars
26.2k
Forks
20.1k
PR merge metrics
PR metrics pending

Description

Nixpkgs version
  • Stable (26.05)
Describe the bug

When I use plain Network Manager to connect to my wifi it autoconnects on boot with no issues. When I enable the networking.networkmanager.ensureProfiles option, the autoconnect on boot is no longer working. I couldn't find anything relevant in my system log, so I create this issue here. Connecting manually works fine.

My full config can be found here, but the relevant part is this:

      networking.networkmanager.ensureProfiles = {
        environmentFiles = [ "/secret/wifi.txt" ];
        profiles = {
          home-2 = {
            connection = {
              autoconnect-priority = 0;
              id = "home-2";
              type = "wifi";
            };
            ipv4 = {
              method = "auto";
            };
            ipv6 = {
              addr-gen-mode = "eui64";
              method = "auto";
            };
            wifi = {
              mode = "infrastructure";
              ssid = "home-6";
            };
            wifi-security = {
              key-mgmt = "wpa-psk";
              psk = "$home";
            };
          };
...
Steps to reproduce
  1. Use the ensureProfiles config with an environmentFiles option
  2. Reboot
  3. Wireless not connected on boot
Expected behaviour

Autoconnect working on boot, just like when using NetworkManager without ensureProfiles.

Screenshots

No response

Relevant log output

Additional context

No response

System metadata
  • system: "x86_64-linux"
  • host os: Linux 6.18.38, NixOS, 26.05 (Yarara), 26.05.20260707.0ad6f47
  • multi-user?: no
  • sandbox: yes
  • version: nix-env (Nix) 2.34.7
  • nixpkgs: /nix/store/7blcfay1hap81n2bc9j4d8b1cxrvng50-source
Notify maintainers

@Janik-Haag


Note for maintainers: Please tag this issue in your pull request description. (i.e. Resolves #ISSUE.)

I assert that this issue is relevant for Nixpkgs
Is this issue important to you?

Add a 👍 reaction to issues you find important.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The relevant configuration is shown in module/network.nix, lines 27–75, using networking.networkmanager.ensureProfiles with environmentFiles. Start by reproducing the reboot failure and tracing ensureProfiles through the generated NetworkManager profiles and boot behavior. Done means the configured wireless profile autoconnects on boot while retaining the existing manual connection behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
linux
Domain
networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.