diff --git a/doc/overlays.xml b/doc/overlays.xml index d194c6bfc892..abaa264addb7 100644 --- a/doc/overlays.xml +++ b/doc/overlays.xml @@ -13,8 +13,8 @@ to bind the dependencies of all packages.
Installing Overlays -Overlays are looked for in the following order, the first valid one is -considered, and all the rest are ignored: +The set of overlays are looked for in the following order, only the +first one present is considered, and all the rest are ignored: diff --git a/pkgs/top-level/impure.nix b/pkgs/top-level/impure.nix index 1aa55f7293ba..60a55c657c0c 100644 --- a/pkgs/top-level/impure.nix +++ b/pkgs/top-level/impure.nix @@ -31,7 +31,9 @@ let content = readDir dir; in map (n: import "${dir}/${n}") (sort lessThan (attrNames content)); in - if dirCheck dirEnv then overlays dirEnv + if dirEnv != "" then + if dirCheck dirEnv then overlays dirEnv + else throw "The environment variable NIXPKGS_OVERLAYS does not name a valid directory." else if dirCheck dirHome then overlays dirHome else []