mirror of
https://git.oat.zone/dark-firepit/dotfiles
synced 2024-04-28 08:45:04 +02:00
26 lines
655 B
Nix
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;
|
|
}
|
|
)
|