Skip to content

Feature request: provide links for flake: references #146

@ian-h-chamberlain

Description

@ian-h-chamberlain

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-flakeArea: flake relatedC-featureCatagory: feature

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions