summary refs log tree commit diff
path: root/pkgs/top-level/impure.nix
diff options
context:
space:
mode:
authorTom Hunger <tehunger@gmail.com>2017-02-23 09:09:47 +0000
committerNicolas B. Pierron <nicolas.b.pierron@gmail.com>2017-02-25 02:32:04 +0100
commit4a524cf66246212fb2e6d96ee57a65c911d8860e (patch)
treed57c6325785472aecc660594080f40ee86d38bda /pkgs/top-level/impure.nix
parent447ba918588604d2a5da9e4f1573e89df086a747 (diff)
downloadnixlib-4a524cf66246212fb2e6d96ee57a65c911d8860e.tar
nixlib-4a524cf66246212fb2e6d96ee57a65c911d8860e.tar.gz
nixlib-4a524cf66246212fb2e6d96ee57a65c911d8860e.tar.bz2
nixlib-4a524cf66246212fb2e6d96ee57a65c911d8860e.tar.lz
nixlib-4a524cf66246212fb2e6d96ee57a65c911d8860e.tar.xz
nixlib-4a524cf66246212fb2e6d96ee57a65c911d8860e.tar.zst
nixlib-4a524cf66246212fb2e6d96ee57a65c911d8860e.zip
Allow directories with a default.nix to be imported as an overlay. Closes #23016.
Note that ${} substitution doesn't work because of the "cannot refer
to other paths" constraint. The paranthesis are needed to enforce
right-first evaluation.
Diffstat (limited to 'pkgs/top-level/impure.nix')
-rw-r--r--pkgs/top-level/impure.nix2
1 files changed, 1 insertions, 1 deletions
diff --git a/pkgs/top-level/impure.nix b/pkgs/top-level/impure.nix
index 61ef729fa104..c0f4e0fa089e 100644
--- a/pkgs/top-level/impure.nix
+++ b/pkgs/top-level/impure.nix
@@ -45,7 +45,7 @@ in
       overlays = dir:
         let content = readDir dir; in
         map (n: import (dir + ("/" + n)))
-          (builtins.filter (n: builtins.match ".*\.nix" n != null)
+          (builtins.filter (n: builtins.match ".*\.nix" n != null || pathExists (dir + ("/" + n + "/default.nix")))
             (attrNames content));
     in
       if dirPath != "" then