1
0
Fork 0
mirror of https://git.oat.zone/dark-firepit/dotfiles synced 2024-04-28 08:45:04 +02:00
git.oat.zone--dark-firepit-.../lib/default.nix
System administrator ec00c09f2e Dotfiles
2022-01-11 17:44:40 +00:00

26 lines
655 B
Nix

# _ _ _
# | (_) |__
# | | | '_ \
# | | | |_) |
# |_|_|_.__/
#
{ inputs, lib, pkgs, ... }:
lib.extend (lib: super:
let
inherit (builtins) attrNames map readDir;
inherit (lib) filterAttrs foldr hasSuffix;
importLib = file: import file { inherit inputs lib pkgs; };
merge = foldr (a: b: a // b) {};
importLibs = libs: merge (map importLib libs);
isLib = name: type: type == "regular" && name != "default.nix" && hasSuffix ".nix" name;
libPath = name: "${toString ./.}/${name}";
libsInFolder = map libPath (attrNames (filterAttrs isLib (readDir ./.)));
in {
_ = importLibs libsInFolder;
}
)