print a deprecation warning for the cursed channel: "file" syntax #345

Open
opened 2024-05-23 23:28:12 +00:00 by qyriad · 7 comments
Owner

File arguments like in nix-build and nix build -f, when prefixed by channel:, redirect to a hardcoded URL pattern of the form https://nixos.org/channels/FOO/nixexprs.tar.xz. We should deprecate and lint on this because oh my gods

Brought up in https://gerrit.lix.systems/c/lix/+/1186/comment/b725fef2_4076655f/
cc @jade

File arguments like in `nix-build` and `nix build -f`, when prefixed by `channel:`, redirect to a hardcoded URL pattern of the form `https://nixos.org/channels/FOO/nixexprs.tar.xz`. We should deprecate and lint on this because oh my gods Brought up in https://gerrit.lix.systems/c/lix/+/1186/comment/b725fef2_4076655f/ cc @jade
qyriad added the
Area/evaluator
label 2024-05-23 23:28:12 +00:00
Owner

I actually use this personally; mostly in the form of NIX_PATH=nixpkgs=channel:nixos-unstable nix-shell -p foo for fetching something from nixos-unstable quickly. I don't strongly mind it being deprecated but it's useful to point out that people do use it :p

I actually use this personally; mostly in the form of `NIX_PATH=nixpkgs=channel:nixos-unstable nix-shell -p foo` for fetching something from `nixos-unstable` quickly. I don't strongly mind it being deprecated but it's useful to point out that people do use it :p
Owner

Yes, and it is in nix.dev. We should nevertheless deprecate it because it's super questionable.

Yes, and it is in nix.dev. We should nevertheless deprecate it because it's super questionable.
Owner

yeah; I'm not too fussed since it's nixpkgs-specific; it might be a good first example for #342 (aka a nix-shell but nixpkgs-specific, including easy channel selection) even.

yeah; I'm not too fussed since it's nixpkgs-specific; it might be a good first example for #342 (aka a `nix-shell` but nixpkgs-specific, including easy channel selection) even.
Owner

That specific use might actually be a rare case where the local flake registry could be useful for creating a shorthand rererence

That specific use might actually be a rare case where the local flake registry could be useful for creating a shorthand rererence
Owner

This is a reasonable use case, but the name channel: is very cursed, and perhaps should be nixpkgs: or something like that. I dunno. I understand it is a useful thing to have, but the actual implementation as hardcoding the authority being nixos on it is kind of dubious tbh.

This is a reasonable use case, but the name `channel:` is very cursed, and perhaps should be `nixpkgs:` or something like that. I dunno. I understand it is a useful thing to have, but the actual implementation as hardcoding the authority being nixos on it is kind of dubious tbh.
Owner

this actually sounds like something that should perhaps be generalized instead of removed: maybe add an option to define custom urn schemes as regex replacements, and make channel just one of them that's shipped in nixpkgs by default?

this actually sounds like something that should perhaps be generalized instead of removed: maybe add an option to define custom urn schemes as regex replacements, and make `channel` just one of them that's shipped in nixpkgs by default?
Author
Owner

That would be reasonable

That would be reasonable
Sign in to join this conversation.
No milestone
No project
No assignees
5 participants
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#345
No description provided.