I have confirmed that this is a bug related to nh
Description
Since upgrading to v4.3.0 I have been unable to switch home-manager configurations, I believe this is due to the "improved attribute path validation" added in 542479a.
# nh home switch /mnt/d/nix#homeConfigurations.me@work.activationPackage
Error:
0: Attribute path is too specific: homeConfigurations.me@work.activationPackage. Home Manager only allows configuration names. Please either:
1. Use the flake reference without attributes (e.g., '.')
2. Specify only the configuration name (e.g., '.#me@work')
Location:
src/home.rs:271
Using only the configuration name as suggested by the error message also generates an error:
#nh home switch /mnt/d/nix#"me@work"
> Building Home-Manager configuration
warning: Git tree '/mnt/d/nix' is dirty
error: flake 'git+file:///mnt/d/nix' does not provide attribute 'packages.x86_64-linux.me@work', 'legacyPackages.x86_64-linux.me@work' or 'me@work'
┏━ 1 Errors:
┃ error: flake 'git+file:///mnt/d/nix' does not provide attribute 'packages.x86_64-linux.me@work', 'legacyPackages.x86_64-linux.me@work' or 'me@work'
┣━━━
┗━ ∑ ⚠ Exited with 1 errors reported by nix at 10:54:12 after 0s
Error:
0: Failed to build Home-Manager configuration
1: Command exited with status Exited(1)
Location:
src/commands.rs:880
And trying the configuration name within the homeConfigurations object gives a third, different error:
nh home switch /mnt/d/nix#"me@work"
> Building Home-Manager configuration
warning: Git tree '/mnt/d/nix' is dirty
error: flake 'git+file:///mnt/d/nix' does not provide attribute 'packages.x86_64-linux.me@work', 'legacyPackages.x86_64-linux.me@work' or 'me@work'
┏━ 1 Errors:
┃ error: flake 'git+file:///mnt/d/nix' does not provide attribute 'packages.x86_64-linux.me@work', 'legacyPackages.x86_64-linux.me@work' or 'me@work'
┣━━━
┗━ ∑ ⚠ Exited with 1 errors reported by nix at 10:54:12 after 0s
Error:
0: Failed to build Home-Manager configuration
1: Command exited with status Exited(1)
Location:
src/commands.rs:880
Installation Method
Stable Release (nixpkgs, pkgs.nh from nixos-unstable or nixos-yy-mm)
Installation Method (Other)
No response
NH Version
nh 4.3.0
System Information
- system:
"x86_64-linux"
- host os:
Linux 5.15.167.4-microsoft-standard-WSL2, NixOS, 25.11 (Xantusia), 25.11.20260324.1073dad
- multi-user?:
yes
- sandbox:
yes
- version:
nix-env (Nix) 2.33.3
- channels(root):
"nixos-25.05, nixos-wsl-25.05.tar.gz"
- nixpkgs:
/nix/store/i2mnjncmkjkl0gd7jhvv6vlakvr9p9pm-source
I have confirmed that this is a bug related to nh
Description
Since upgrading to v4.3.0 I have been unable to switch home-manager configurations, I believe this is due to the "improved attribute path validation" added in 542479a.
Using only the configuration name as suggested by the error message also generates an error:
And trying the configuration name within the
homeConfigurationsobject gives a third, different error:Installation Method
Stable Release (nixpkgs,
pkgs.nhfrom nixos-unstable or nixos-yy-mm)Installation Method (Other)
No response
NH Version
nh 4.3.0
System Information
"x86_64-linux"Linux 5.15.167.4-microsoft-standard-WSL2, NixOS, 25.11 (Xantusia), 25.11.20260324.1073dadyesyesnix-env (Nix) 2.33.3"nixos-25.05, nixos-wsl-25.05.tar.gz"/nix/store/i2mnjncmkjkl0gd7jhvv6vlakvr9p9pm-source