summary refs log tree commit diff
path: root/pkgs/top-level/by-name-overlay.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/top-level/by-name-overlay.nix')
-rw-r--r--pkgs/top-level/by-name-overlay.nix15
1 files changed, 12 insertions, 3 deletions
diff --git a/pkgs/top-level/by-name-overlay.nix b/pkgs/top-level/by-name-overlay.nix
index 41944c4e3b0..3df9843d03d 100644
--- a/pkgs/top-level/by-name-overlay.nix
+++ b/pkgs/top-level/by-name-overlay.nix
@@ -45,6 +45,15 @@ in
 # Currently this would be hard to measure until we have more packages
 # and ideally https://github.com/NixOS/nix/pull/8895
 self: super:
-mapAttrs (name: file:
-  self.callPackage file { }
-) packageFiles
+{
+  # This attribute is necessary to allow CI to ensure that all packages defined in `pkgs/by-name`
+  # don't have an overriding definition in `all-packages.nix` with an empty (`{ }`) second `callPackage` argument.
+  # It achieves that with an overlay that modifies both `callPackage` and this attribute to signal whether `callPackage` is used
+  # and whether it's defined by this file here or `all-packages.nix`.
+  # TODO: This can be removed once `pkgs/by-name` can handle custom `callPackage` arguments without `all-packages.nix` (or any other way of achieving the same result).
+  # Because at that point the code in ./stage.nix can be changed to not allow definitions in `all-packages.nix` to override ones from `pkgs/by-name` anymore and throw an error if that happens instead.
+  _internalCallByNamePackageFile = file: self.callPackage file { };
+}
+// mapAttrs
+  (name: self._internalCallByNamePackageFile)
+  packageFiles