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:
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