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.
This commit is contained in:
Tom Hunger 2017-02-23 09:09:47 +00:00 committed by Nicolas B. Pierron
parent 447ba91858
commit 4a524cf662

View File

@ -45,7 +45,7 @@ in
overlays = dir: overlays = dir:
let content = readDir dir; in let content = readDir dir; in
map (n: import (dir + ("/" + n))) 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)); (attrNames content));
in in
if dirPath != "" then if dirPath != "" then