aboutsummaryrefslogtreecommitdiff
path: root/doc/manual
diff options
context:
space:
mode:
authorDelan Azabani <delan@azabani.com>2024-06-22 23:00:59 +0800
committerDelan Azabani <delan@azabani.com>2024-06-29 05:11:31 +0000
commitb2944d93a6d95810f0aef09e9ac44b95e2712554 (patch)
tree90a3c92b959aa27b742c7b6423c0337dd8a5f869 /doc/manual
parent5dc85e8b72d1ba433f69200537146275ff1c4a03 (diff)
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
Diffstat (limited to 'doc/manual')
-rw-r--r--doc/manual/change-authors.yml5
-rw-r--r--doc/manual/rl-next/registry-add-shorthand-only.md10
2 files changed, 15 insertions, 0 deletions
diff --git a/doc/manual/change-authors.yml b/doc/manual/change-authors.yml
index 5894ce821..28a20b25f 100644
--- a/doc/manual/change-authors.yml
+++ b/doc/manual/change-authors.yml
@@ -44,6 +44,11 @@ cole-h:
display_name: Cole Helbling
github: cole-h
+delan:
+ display_name: delan
+ forgejo: delan
+ github: delan
+
edolstra:
display_name: Eelco Dolstra
github: edolstra
diff --git a/doc/manual/rl-next/registry-add-shorthand-only.md b/doc/manual/rl-next/registry-add-shorthand-only.md
new file mode 100644
index 000000000..72f972b0a
--- /dev/null
+++ b/doc/manual/rl-next/registry-add-shorthand-only.md
@@ -0,0 +1,10 @@
+---
+synopsis: "`nix registry add` now requires a shorthand flakeref on the 'from' side"
+cls: 1494
+credits: delan
+category: 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.