about summary refs log tree commit diff
path: root/nix/nix-1p
diff options
context:
space:
mode:
authorvpfeiffer <violetpfeiffer@gmail.com>2022-10-02T15·32+0000
committerclbot <clbot@tvl.fyi>2022-10-05T11·14+0000
commit55ea15ab83e5cc8390eb330568ffe33bf4eb7281 (patch)
treee8e790c4c4dee519992ad6b2b9e9095d094e2826 /nix/nix-1p
parent3530404a4a1cc363d87e559ac24780aa318adb19 (diff)
docs(nix/nix-1p): Update to use final and prev r/5036
The convention has changed to use `final` instead of `self` and `prev`
instead of `super`. This new convention is much easier to understand
especially for users that are new to Nix and Nixpkgs.

This change is notable in the Nixpkgs project code. I added a note
mentioning that the official documentation hasn't been update with
this information. The documentation is currently undergoing an
overhaul and that is why I believe this hasn't been reflected in the
nixpkgs documentation as of yet.

Imported-From: https://github.com/tazjin/nix-1p/pull/9/commits
Change-Id: I901df69a564969b1784b3d7ac629cfaf85093acb
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6859
Reviewed-by: Profpatsch <mail@profpatsch.de>
Reviewed-by: tazjin <tazjin@tvl.su>
Autosubmit: tazjin <tazjin@tvl.su>
Tested-by: BuildkiteCI
Diffstat (limited to 'nix/nix-1p')
-rw-r--r--nix/nix-1p/README.md12
1 files changed, 7 insertions, 5 deletions
diff --git a/nix/nix-1p/README.md b/nix/nix-1p/README.md
index bdb49c7defe7..e7cf1e2d90d0 100644
--- a/nix/nix-1p/README.md
+++ b/nix/nix-1p/README.md
@@ -569,20 +569,22 @@ but have the modification above be reflected in the imported package set:
 
 ```nix
 let
-  overlay = (self: super: {
-    someProgram = super.someProgram.overrideAttrs(old: {
+  overlay = (final: prev: {
+    someProgram = prev.someProgram.overrideAttrs(old: {
       configureFlags = old.configureFlags or [] ++ ["--mimic-threaten-tag"];
     });
   });
 in import <nixpkgs> { overlays = [ overlay ]; }
 ```
 
-The overlay function receives two arguments, `self` and `super`. `self` is
+The overlay function receives two arguments, `final` and `prev`. `final` is
 the [fixed point][fp] of the overlay's evaluation, i.e. the package set
-*including* the new packages and `super` is the "original" package set.
+*including* the new packages and `prev` is the "original" package set.
 
 See the Nix manual sections [on overrides][] and [on overlays][] for more
-details.
+details (note: the convention has moved away from using `self` in favor of
+`final`, and `prev` instead of `super`, but the documentation has not been
+updated to reflect this).
 
 [currying]: https://en.wikipedia.org/wiki/Currying
 [builtins]: https://nixos.org/nix/manual/#ssec-builtins