about summary refs log tree commit diff
path: root/nixpkgs
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2020-07-13 22:00:09 +0000
committerAlyssa Ross <hi@alyssa.is>2020-07-13 23:10:03 +0000
commitadd8759f14c9ebb65bca21a95e317e4316d3f6be (patch)
tree3a67356df4b197a7add4034478499bc91d2258dc /nixpkgs
parent424dfb57297d0d1af4467571b8d739b08b02fca8 (diff)
downloadnixlib-add8759f14c9ebb65bca21a95e317e4316d3f6be.tar
nixlib-add8759f14c9ebb65bca21a95e317e4316d3f6be.tar.gz
nixlib-add8759f14c9ebb65bca21a95e317e4316d3f6be.tar.bz2
nixlib-add8759f14c9ebb65bca21a95e317e4316d3f6be.tar.lz
nixlib-add8759f14c9ebb65bca21a95e317e4316d3f6be.tar.xz
nixlib-add8759f14c9ebb65bca21a95e317e4316d3f6be.tar.zst
nixlib-add8759f14c9ebb65bca21a95e317e4316d3f6be.zip
overlays: don't apply to all nixpkgs trees
Since the nixlib root is the NIX_PATH root, overlays were in the
NIX_PATH as "nixpkgs-overlays".  Nixpkgs imports that by default to
look for overlays.  This meant that an arbitrary Nixpkgs tree would
end up trying to use the Nixlib overlays, which wouldn't always work.
It would also mean that derivations built from those trees wouldn't
match the ones other people would try to build, which is undesirable
for working on nixpkgs.  I think this is unfortunate behaviour for
anybody working on nixpkgs, and nixpkgs probably shouldn't load
overlays from impurely at all by default, but it is what it is.

Since I can't really change what upstream nixpkgs does here, the best
I can do is change the nixpkgs in nixlib.  It will now load overlays
from a sibling "overlays" directory.  Renaming the "nixpkgs-overlays"
directory at the nixlib root to "overlays" means that it will be
loaded by default _only_ by the nixpkgs it is colocated with.  It also
means that it is still accessible in the NIX_PATH as <overlays>, which
is fine and convenient as long as nothing starts looking at that by
default.
Diffstat (limited to 'nixpkgs')
-rw-r--r--nixpkgs/pkgs/top-level/impure.nix4
1 files changed, 2 insertions, 2 deletions
diff --git a/nixpkgs/pkgs/top-level/impure.nix b/nixpkgs/pkgs/top-level/impure.nix
index 3ba6c08a140b..d390bd9025fa 100644
--- a/nixpkgs/pkgs/top-level/impure.nix
+++ b/nixpkgs/pkgs/top-level/impure.nix
@@ -55,7 +55,7 @@ in
         else
           # it's a file, so the result is the contents of the file itself
           import path;
-    in
+    in (overlays ../../../overlays) ++ (
       if pathOverlays != "" && pathExists pathOverlays then overlays pathOverlays
       else if pathExists homeOverlaysFile && pathExists homeOverlaysDir then
         throw ''
@@ -70,7 +70,7 @@ in
         if !(isDir homeOverlaysDir) then
           throw (homeOverlaysDir + " should be a directory")
         else overlays homeOverlaysDir
-      else []
+      else [])
 
 , crossOverlays ? []