mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 21:50:55 +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 + "/.");
|
dirCheck = dir: dir != "" && pathExists (dir + "/.");
|
||||||
overlays = dir:
|
overlays = dir:
|
||||||
let content = readDir dir; in
|
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
|
in
|
||||||
if dirEnv != "" then
|
if dirEnv != "" then
|
||||||
if dirCheck dirEnv then overlays dirEnv
|
if dirCheck dirEnv then overlays dirEnv
|
||||||
|
|
Loading…
Reference in a new issue