Skip to content

"Improved attribute path validation" on NixOS-WSL breaks building home-manager configuration #606

@girlpunk

Description

@girlpunk

I have confirmed that this is a bug related to nh

  • This is a bug, and not an user error or a support request. I understand that my issue will be closed if it is not a bug in NH.
  • I have checked the issues tab and confirmed that my issue has not yet been reported. I understand that my issue will be closed if it is a duplicate.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug (requires confirmation)User might have misclassified, or might be an AI hallucination. We literally don't know.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions