nix why-depends and other commands you have to give two installables can't take store path installables when -f is used anywhere #927

Open
opened 2025-07-21 18:34:12 +00:00 by jade · 0 comments
Owner

When the CLI parser is expecting an attribute path, it can't take store path installables at the moment, unlike when it is expecting a flake installable. This means that nix why-depends .#hsPkgs.aeson /nix/store/... works, but nix why-depends -f . hsPkgs.aeson /nix/store/... gives an error like the following:

$ nix why-depends --precise -f '<nixpkgs>' hello /nix/store/bblr8ccnd4baxm4cf7g1igfz6ya8v93m-curl-8.14.1-bin
error: attribute '/nix/store/bblr8ccnd4baxm4cf7g1igfz6ya8v93m-curl-8' in selection path '/nix/store/bblr8ccnd4baxm4cf7g1igfz6ya8v93m-curl-8.14.1-bin' not found inside path '', whose contents are: { _type = 
"pkgs"; "7z2hashcat" = «thunk»; AAAAAASomeThingsFailToEvaluate = «thunk»; AMB-plugins = «thunk»; ArchiSteamFarm = «thunk»; AusweisApp2 = «thunk»; BeatSaberModManager = «thunk»; CHOWTapeModel = «thunk»; Chow
Centaur = «thunk»; ChowKick = «thunk»; «25138 attributes elided» }

No idea if there is any workaround to this, I suspect not? There's not a way to get it out of --file mode, right?

Anyway this is a: nix (Lix, like Nix) 2.94.0-dev-pre20250715-8f325fe.

When the CLI parser is expecting an attribute path, it can't take store path installables at the moment, unlike when it is expecting a flake installable. This means that `nix why-depends .#hsPkgs.aeson /nix/store/...` works, but `nix why-depends -f . hsPkgs.aeson /nix/store/...` gives an error like the following: ``` $ nix why-depends --precise -f '<nixpkgs>' hello /nix/store/bblr8ccnd4baxm4cf7g1igfz6ya8v93m-curl-8.14.1-bin error: attribute '/nix/store/bblr8ccnd4baxm4cf7g1igfz6ya8v93m-curl-8' in selection path '/nix/store/bblr8ccnd4baxm4cf7g1igfz6ya8v93m-curl-8.14.1-bin' not found inside path '', whose contents are: { _type = "pkgs"; "7z2hashcat" = «thunk»; AAAAAASomeThingsFailToEvaluate = «thunk»; AMB-plugins = «thunk»; ArchiSteamFarm = «thunk»; AusweisApp2 = «thunk»; BeatSaberModManager = «thunk»; CHOWTapeModel = «thunk»; Chow Centaur = «thunk»; ChowKick = «thunk»; «25138 attributes elided» } ``` No idea if there is any workaround to this, I suspect not? There's not a way to get it out of --file mode, right? Anyway this is a: `nix (Lix, like Nix) 2.94.0-dev-pre20250715-8f325fe`.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: lix-project/lix#927
No description provided.