jeff-hykin / nix_version_search_cli

Nix Version Search CLI - user friendly way to find any version
MIT License
28 stars 3 forks source link

Printed url for flake does not work: Unexpected fragment #3

Closed clamydo closed 6 months ago

clamydo commented 9 months ago

Using an URL like spdlog.url = "https://github.com/NixOS/nixpkgs/archive/407f8825b321617a38b86a4d9be11fd76d513da2.tar.gz#spdlog", as suggested by nvs as an input of an flake results in error: unexpected fragment 'spdlog' in flake reference 'https://github.com/NixOS/nixpkgs/archive/407f8825b321617a38b86a4d9be11fd76d513da2.tar.gz#spdlog'.

Whereas nix run https://github.com/NixOS/nixpkgs/archive/407f8825b321617a38b86a4d9be11fd76d513da2.tar.gz#hello works.

jeff-hykin commented 9 months ago

Edit: I'm pretty inexperienced with nix flakes, and it looks like I screwed up the format. There might not be a way to have it directly as a nix flake input. However, there is a next-best workaround so I put that in nvs and published v1.3.3 just now

jeff-hykin commented 9 months ago

Also if a flake input doesn't work for some reason nvs --repl spdlog will show the non-flake version which still works.

clamydo commented 9 months ago

The only way I know is to provide a pinned nixpkgs as a whole (without trailing #foo) as a flake input and work from there.

See https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-flake for a reference.

jeff-hykin commented 9 months ago

👍 Sounds good. That's the format I switched it to in v1.3.3.