mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 13:41:26 +00:00
Only read overlays ending in .nix
For example, this prevents Nix from barfing on editor backup files in ~/.nixpkgs/overlays.
This commit is contained in:
parent
05ee54782e
commit
86fe7a40ac
|
@ -29,7 +29,9 @@
|
|||
dirCheck = dir: dir != "" && pathExists (dir + "/.");
|
||||
overlays = dir:
|
||||
let content = readDir dir; in
|
||||
map (n: import "${dir}/${n}") (sort lessThan (attrNames content));
|
||||
map (n: import "${dir}/${n}")
|
||||
(builtins.filter (n: builtins.match ".*\.nix" n != null)
|
||||
(sort lessThan (attrNames content)));
|
||||
in
|
||||
if dirEnv != "" then
|
||||
if dirCheck dirEnv then overlays dirEnv
|
||||
|
|
Loading…
Reference in a new issue