Skip to content

Add a channel: flakeref #13168

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

Open
2 tasks done
WeetHet opened this issue May 11, 2025 · 4 comments
Open
2 tasks done

Add a channel: flakeref #13168

WeetHet opened this issue May 11, 2025 · 4 comments
Labels
feature Feature request or proposal

Comments

@WeetHet
Copy link

WeetHet commented May 11, 2025

Is your feature request related to a problem?

Nix infra now supports lockable taballs protocol for nixpkgs tarballs. This means that one can use https://channels.nixos.org/nixpkgs-unstable/nixexprs.tar.xz as opposed to github:nixos/nixpkgs/nixpkgs-unstable to save 15MB on download and get additional benefits in case of nixos- tarballs, such as getting a program-not-found database bundled together with the tarball

It's however more wordy than the github: flakeref

Proposed solution

I propose adding a channel:name flakeref pointing to https://channels.nixos.org/name/nixexprs.tar.xz to shorten this

Alternative solutions

Using a nixos: or similar flakeref or leaving things as is

Additional context

Checklist


Add 👍 to issues you find important.

@WeetHet WeetHet added the feature Feature request or proposal label May 11, 2025
@roberth
Copy link
Member

roberth commented May 11, 2025

Another alternative is to use the global flake registry to provide such aliases.
Some benefits

  • Easier and quicker to achieve
  • Works for all Nix versions that support versioned tarballs
  • The scheme: part remains about the protocol as opposed to intruding on the registry's responsibilities

@WeetHet
Copy link
Author

WeetHet commented May 11, 2025

Another alternative is to use the global flake registry to provide such aliases

The issue is naming. Sadly, channel/nixpkgs-<something> is not a valid flake id and just nixpkgs-<something> tends to be overridden by configurations

@WeetHet
Copy link
Author

WeetHet commented May 11, 2025

We also have a precedent set that channel: links resolve to something like that, see

$ nix-instantiate channel:nixpkgs-unstable --eval -A hello.outPath
"/nix/store/a9l6gcmcq3mll6d15pc3nfcpbsmd2zqg-hello-2.12.1"

@lf-
Copy link
Member

lf- commented May 14, 2025

I would not call the umm. as we put it. cursed file syntax to be a good inspiration: https://gerrit.lix.systems/c/lix/+/1190

Part of the problem with trying to extend the flakeref format is that that is effectively extending the contract of libfetchers which then becomes observable as derivation API/ABI changes. I don't know if it is prudent to add more to that contract when it is currently underdocumented and full of problems. Another alternate solution might be doing the aliasing in the infrastructure: https://c.nixos.org/c/nixos-24.05.tar.xz or so.

Secondarily I think it's troublesome to create a mechanism that is only usable for nixpkgs; there are other things that one might want to release other than nixpkgs that also would benefit from short names. This does lead to thinking about the flake registry.

From a Lix perspective I think it would be acceptable to add these as aliases nixos-unstable nixpkgs-unstable, nixos-24.05-small, etc, to the flake registry, for interactive use, and we could in principle vendor the updated flake registry. This does have an unfortunate side effect of requiring flake registry changes for every NixOS release, which I think points to the flake registry being a poor mechanism as well. As ever, the flake registry is inadvisable inside of flake.nix, and the full URLs should be used there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Feature request or proposal
Projects
None yet
Development

No branches or pull requests

3 participants