mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-23 07:23:20 +00:00
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:
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user