lix/doc/manual/rl-next/registry-add-shorthand-only.md
Delan Azabani b2944d93a6 Reject fully-qualified URLs in 'from' argument of nix registry add
We previously allowed you to map any flake URL to any other flake URL,
including shorthand flakerefs, indirect flake URLs like `flake:nixpkgs`,
direct flake URLs like `github:NixOS/nixpkgs`, or local paths.

But flake registry entries mapping from direct flake URLs often come
from swapping the 'from' and 'to' arguments by accident, and even when
created intentionally, they may not actually work correctly.

This patch rejects those URLs (and fully-qualified flake: URLs), making
it harder to swap the arguments by accident.

Fixes #181.

Change-Id: I24713643a534166c052719b8770a4edfcfdb8cf3
2024-06-29 05:11:31 +00:00

522 B

synopsis cls credits category
`nix registry add` now requires a shorthand flakeref on the 'from' side 1494 delan Improvements

The 'from' argument must now be a shorthand flakeref like nixpkgs or nixpkgs/nixos-20.03, making it harder to accidentally swap the 'from' and 'to' arguments.

Registry entries that map from other flake URLs can still be specified in registry.json, the nix.registry option in NixOS, or the --override-flake option in the CLI, but they are not guaranteed to work correctly.