summary refs log tree commit diff
diff options
context:
space:
mode:
authorRobert Hensing <robert@roberthensing.nl>2019-02-03 18:22:22 +0700
committerRobert Hensing <robert@roberthensing.nl>2019-02-03 18:22:22 +0700
commit055ac8e4955294a3ecf6663628d892a486bba06d (patch)
treecb938faaeb68152ec13d7e6dfd7599d58bb147dc
parentbd0bb9e4976eb69425ca8effc260bfe1bd47a7fc (diff)
downloadnixpkgs-055ac8e4955294a3ecf6663628d892a486bba06d.tar
nixpkgs-055ac8e4955294a3ecf6663628d892a486bba06d.tar.gz
nixpkgs-055ac8e4955294a3ecf6663628d892a486bba06d.tar.bz2
nixpkgs-055ac8e4955294a3ecf6663628d892a486bba06d.tar.lz
nixpkgs-055ac8e4955294a3ecf6663628d892a486bba06d.tar.xz
nixpkgs-055ac8e4955294a3ecf6663628d892a486bba06d.tar.zst
nixpkgs-055ac8e4955294a3ecf6663628d892a486bba06d.zip
Partially revert 755e824
Reinstates the error message that helps migration of forks.
Same should be done for super *if* it is to be removed.
-rw-r--r--pkgs/top-level/all-packages.nix16
-rw-r--r--pkgs/top-level/stage.nix5
2 files changed, 19 insertions, 2 deletions
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index adf7e603b23..01dccadd3b9 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -6,11 +6,25 @@
  * Hint: ### starts category names.
  */
 { lib, noSysDirs, config}:
-pkgs:
+res: pkgs: super:
 
 with pkgs;
 
+let
+  self =
+    builtins.trace ''
+        It seems that you are using a patched Nixpkgs that references the self
+        variable in pkgs/top-level/all-packages.nix. This variable was incorrectly
+        named, so its usage needs attention. Please use pkgs for packages or super
+        for functions.
+      ''
+      res; # Do *NOT* use res in your fork. It will be removed.
+
+  # TODO: turn self into an error
+
+in
 {
+
   # Allow callPackage to fill in the pkgs argument
   inherit pkgs;
 
diff --git a/pkgs/top-level/stage.nix b/pkgs/top-level/stage.nix
index 0991c9138bd..6ca370e0b9b 100644
--- a/pkgs/top-level/stage.nix
+++ b/pkgs/top-level/stage.nix
@@ -89,7 +89,10 @@ let
   splice = self: super: import ./splice.nix lib self (buildPackages != null);
 
   allPackages = self: super:
-    import ./all-packages.nix { inherit lib noSysDirs config; } self;
+    let res = import ./all-packages.nix
+      { inherit lib noSysDirs config; }
+      res self super;
+    in res;
 
   aliases = self: super: lib.optionalAttrs (config.allowAliases or true) (import ./aliases.nix lib self super);