Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: provide links for flake: references #146

Open
ian-h-chamberlain opened this issue Aug 5, 2024 · 0 comments
Open

Feature request: provide links for flake: references #146

ian-h-chamberlain opened this issue Aug 5, 2024 · 0 comments
Labels
A-flake Area: flake related C-feature Catagory: feature

Comments

@ian-h-chamberlain
Copy link

ian-h-chamberlain commented Aug 5, 2024

Providing links for flake references like url = "github:zhaofengli/nix-homebrew"; is really convenient — would it be possible to resolve registry flakes as well? For example, I have some pinned entries that would be nice to link to:

  inputs = {
    nixpkgs.url = "flake:nixpkgs/nixos-24.05";
    nixos-unstable.url = "flake:nixpkgs/nixos-unstable";

    nixpkgs-darwin.url = "flake:nixpkgs/nixpkgs-24.05-darwin";
    nixpkgs-unstable.url = "flake:nixpkgs/nixpkgs-unstable";

    nix-homebrew = {
      url = "github:zhaofengli/nix-homebrew"; # <-- This one becomes a link, awesome!
      inputs.nixpkgs.follows = "nixpkgs-darwin";
      inputs.nix-darwin.follows = "nix-darwin";
    };
  }

These ultimately resolve to github: flake refs:

$ nix registry list  | grep -E 'nixpkgs|darwin'
user   flake:nixpkgs github:NixOS/nixpkgs/c3392ad349a5227f4a3464dce87bcc5046692fce
global flake:nix-darwin github:LnL7/nix-darwin
global flake:nixpkgs github:NixOS/nixpkgs/nixpkgs-unstable

I am guessing that some metadata about these are already evaluated at some point, since go-to-definition works on their store paths, so maybe it's just a matter of plumbing through a bit of extra metadata somewhere? Thanks!

@oxalica oxalica added C-feature Catagory: feature A-flake Area: flake related labels Aug 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-flake Area: flake related C-feature Catagory: feature
Projects
None yet
Development

No branches or pull requests

2 participants