diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2017-01-31 15:20:28 +0100 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2017-02-01 16:07:54 +0100 |
commit | 86fe7a40acc0e68e60905798b2d692c2e9a6c33e (patch) | |
tree | 93bfaea57e16710c3acb253651b7ee2e43083174 /pkgs/top-level/impure.nix | |
parent | 05ee54782ea783d876b7661838b1ed78fa1257e7 (diff) | |
download | nixpkgs-86fe7a40acc0e68e60905798b2d692c2e9a6c33e.tar nixpkgs-86fe7a40acc0e68e60905798b2d692c2e9a6c33e.tar.gz nixpkgs-86fe7a40acc0e68e60905798b2d692c2e9a6c33e.tar.bz2 nixpkgs-86fe7a40acc0e68e60905798b2d692c2e9a6c33e.tar.lz nixpkgs-86fe7a40acc0e68e60905798b2d692c2e9a6c33e.tar.xz nixpkgs-86fe7a40acc0e68e60905798b2d692c2e9a6c33e.tar.zst nixpkgs-86fe7a40acc0e68e60905798b2d692c2e9a6c33e.zip |
Only read overlays ending in .nix
For example, this prevents Nix from barfing on editor backup files in ~/.nixpkgs/overlays.
Diffstat (limited to 'pkgs/top-level/impure.nix')
-rw-r--r-- | pkgs/top-level/impure.nix | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/pkgs/top-level/impure.nix b/pkgs/top-level/impure.nix index 60a55c657c0..d8201a3569f 100644 --- a/pkgs/top-level/impure.nix +++ b/pkgs/top-level/impure.nix @@ -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 |