infrastructure/lib/default.nix
Fabian Hauser fef2377502
All checks were successful
CI / build (push) Successful in 13m53s
Commit files for public release
2024-10-02 16:57:36 +03:00

18 lines
482 B
Nix

{ pkgs, ... }:
let
lib = pkgs.lib;
foldersWithNix =
path:
let
folders = lib.attrNames (lib.filterAttrs (n: t: t == "directory") (builtins.readDir path));
isFolderWithDefaultNix = folder: lib.pathExists (lib.path.append path "./${folder}/default.nix");
in
lib.filter isFolderWithDefaultNix folders;
in
{
inherit foldersWithNix;
loadSubmodulesFrom =
path: map (folder: lib.path.append path "./${folder}/default.nix") (foldersWithNix path);
}