From 68d3712078ce3b4c3b102670d321da6238b31c2c Mon Sep 17 00:00:00 2001 From: pinpox Date: Thu, 5 Jun 2025 19:16:10 +0200 Subject: [PATCH] Expose all clanServices//flake-module.nix --- clanServices/flake-module.nix | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/clanServices/flake-module.nix b/clanServices/flake-module.nix index af54d23b0..97a4c9115 100644 --- a/clanServices/flake-module.nix +++ b/clanServices/flake-module.nix @@ -1,18 +1,21 @@ { ... }: { - imports = [ - ./admin/flake-module.nix - ./deltachat/flake-module.nix - ./ergochat/flake-module.nix - ./garage/flake-module.nix - ./heisenbridge/flake-module.nix - ./importer/flake-module.nix - ./localsend/flake-module.nix - ./mycelium/flake-module.nix - ./auto-upgrade/flake-module.nix - ./hello-world/flake-module.nix - ./wifi/flake-module.nix - ./borgbackup/flake-module.nix - ./zerotier/flake-module.nix - ]; + 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; }