add core configuration

This commit is contained in:
Chance 2025-03-29 21:03:07 -04:00
parent ad124505da
commit c556ce55b6
Signed by untrusted user: caznix
GPG key ID: 489D213143D753FD
94 changed files with 2816 additions and 959 deletions

View file

@ -0,0 +1,17 @@
{lib, ...}: let
# recursively construct attr-set of a directory
getDir = dir:
lib.mapAttrs (file: type:
if type == "directory"
then getDir "${dir}/${file}"
else type) (
builtins.readDir dir
);
files = dir: lib.collect lib.isString (lib.mapAttrsRecursive (path: type: lib.concatStringsSep "/" path) (getDir dir));
validFiles = dir:
map (file: ./. + "/${file}") (
lib.filter (file: lib.hasSuffix ".nix" file && file != "default.nix") (files dir)
);
in {
imports = validFiles ./.;
}