dotfiles/nix/lib/importAll.nix
Alyxia Sother 2daf5f1b05
[nix] Redo and restructure the entire config
Thanks @KaitlynEthylia :)
2024-07-11 19:07:47 +02:00

15 lines
415 B
Nix

{ pkgs, ... }:
exclude: cwd: with builtins; with pkgs.lib; filter
(e: !elem e exclude)
(map
(p: path.append cwd p)
(attrNames (attrsets.filterAttrs
(p: t:
let
d = t == "directory";
b = baseNameOf p;
in
d && pathExists (path.append cwd (p + "/default.nix")) ||
!d && match ''.*\.nix'' b != null && b != "default.nix")
(readDir cwd))))