[nix] Redo and restructure the entire config

Thanks @KaitlynEthylia :)
This commit is contained in:
Alyxia Sother 2024-07-11 19:07:47 +02:00
parent 19b92cd8fd
commit 2daf5f1b05
No known key found for this signature in database
GPG key ID: 01E16C4E775A37E4
13 changed files with 378 additions and 302 deletions

15
nix/lib/importAll.nix Normal file
View file

@ -0,0 +1,15 @@
{ 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))))