1
0
Fork 0

Fix overlays

This commit is contained in:
Malte Brandy 2020-06-27 17:02:29 +02:00
parent c12598ee3c
commit 394d8fcec6
No known key found for this signature in database
GPG key ID: 226A2D41EF5378C9

12
overlays/default.nix Normal file
View file

@ -0,0 +1,12 @@
{ lib }:
let
overlayPath = ./.;
candidates = lib.attrNames (builtins.readDir overlayPath);
pathToOverlay = n: overlayPath + ("/" + n);
isNixFile = n: builtins.match ".*\\.nix" n != null;
isNixDir = n: builtins.pathExists (pathToOverlay n + "/default.nix");
notDefault = n: n != "default.nix";
isOverlay = n: (isNixDir n || isNixFile n) && notDefault n;
overlays = builtins.filter isOverlay candidates;
importOverlay = n: import (pathToOverlay n);
in map importOverlay overlays