Skip to content

nh v4: Ignores custom --configuration flag #262

@RAPSNX

Description

@RAPSNX

I use a custom attribute for my homeConfiguration.
It looks like this:

homeConfigurations."my-user@my-config" = ...

What worked till nh v3.6.0

I don't use the original hostname of my machine for as config attribute, so I need to overwrite it with -c flag.
nh home switch -c "my-user@my-config" .

This build and switch my homeConfigurations successfully.

** ⚠ What fails with nh v4.0.0**

nh home switch -c "my-user@my-config" . --verbose

I use a custom name instead of the real hostname, because it's a sensitve information.

The HomeRebuildArgs.configuration does get the config specified by the flag, but it gets ignored and don't build a cmd for it.

Output:

TRACE nh::logging:86: Logging OK
DEBUG nh:42: Main {
    verbose: true,
    command: Home(
        HomeArgs {
            subcommand: Switch(
                HomeRebuildArgs {
                    common: CommonRebuildArgs {
                        dry: false,
                        ask: false,
                        installable: Flake {
                            reference: ".",
                            attribute: [],
                        },
                        no_nom: false,
                        out_link: None,
                    },
                    update_args: UpdateArgs {
                        update: false,
                        update_input: None,
                    },
                    configuration: Some(
                        "my-user@my-config",
                    ),
                    specialisation: None,
                    no_specialisation: false,
                    extra_args: [],
                    backup_extension: None,
                },
            ),
        },
    ),
}
DEBUG nh:43: NH_VERSION=4.0.0 NH_REV=None
DEBUG nh::home:53: out_path=("/var/folders/2w/5hwytyps2s3cqj9nxgpdjrm00000gq/T/nh-osYu3Qdd/result", TempDir { path: "/var/folders/2w/5hwytyps2s3cqj9nxgpdjrm00000gq/T/nh-osYu3Qdd" })
DEBUG nh::commands:120: cmd=Exec { nix eval --apply ' x: x ? "my-user@real-hostname" ' '.#homeConfigurations' }
DEBUG nh::commands:120: cmd=Exec { nix eval --apply ' x: x ? "my-user" ' '.#homeConfigurations' }
Error:
   0: Couldn't find home-manager configuration, tried .#homeConfigurations.my-user@real-hostname, .#homeConfigurations.real-user

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions