customer-portal/nix/modules/flake-module.nix
chris b509508ee6
All checks were successful
Test action / Print hello world (push) Successful in 6m22s
too lazy to think of a message, so enjoy this pointless text. Good luck future me...
2025-09-23 11:13:23 +00:00

21 lines
652 B
Nix
Executable file

{ ... }:
{
imports =
let
# Get all subdirectories in the current directory
dirContents = builtins.readDir ./.;
# Filter to include only directories that have a flake-module.nix file
# and exclude special directories like 'result'
validModuleDirs = builtins.filter (
name:
name != "result"
&& dirContents.${name} == "directory"
&& builtins.pathExists (./. + "/${name}/flake-module.nix")
) (builtins.attrNames dirContents);
# Create import paths for each valid directory
imports = map (name: ./. + "/${name}/flake-module.nix") validModuleDirs;
in
imports;
}