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:
parent
447ba91858
commit
4a524cf662
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user