nixos/networkmanager: wireless autoconnect not working on boot with ensureProfiles
Nobody has claimed this yet.
- 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
- Use the
ensureProfilesconfig with anenvironmentFilesoption - Reboot
- 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
- I assert that this is a bug and not a support request.
- I assert that this is not a duplicate of an existing issue.
- I assert that I have read the NixOS Code of Conduct and agree to abide by it.
- I assert that I have read the automation/AI policy and that this issue report complies with it.
Is this issue important to you?
Add a 👍 reaction to issues you find important.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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