diff --git a/modules/clan/flake-module.nix b/modules/clan/flake-module.nix new file mode 100644 index 0000000..1cf471b --- /dev/null +++ b/modules/clan/flake-module.nix @@ -0,0 +1,26 @@ +{ + inputs, + ... +}: +{ + 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) ++ [ + inputs.clan-core.flakeModules.testModule + ]; + in + imports; +} diff --git a/modules/clan/gw-router/default.nix b/modules/clan/gw-router/default.nix new file mode 100644 index 0000000..f5d823c --- /dev/null +++ b/modules/clan/gw-router/default.nix @@ -0,0 +1,37 @@ +{ ... }: +{ + _class = "clan.service"; + manifest.name = "gw-router"; + manifest.description = "A gateway router service to configure most of a router features"; + manifest.readme = "A gateway router service to configure most of a router features"; + manifest.categories = [ "System" ]; + + roles.default = { + description = "A router role for managing a node as a router"; + + interface = + { lib, config, ... }: + { + options = { + + }; + }; + + perInstance = + { settings, ... }: + { + nixosModule = + { + config, + pkgs, + lib, + ... + }: + let + in + { + + }; + }; + }; +} diff --git a/modules/clan/gw-router/flake-module.nix b/modules/clan/gw-router/flake-module.nix new file mode 100644 index 0000000..1f95cdc --- /dev/null +++ b/modules/clan/gw-router/flake-module.nix @@ -0,0 +1,19 @@ +{ self, inputs, ... }: +let + module = ./default.nix; +in +{ + clan.modules = { + gw-router = module; + }; + # perSystem = + # { ... }: + # { + # clan.nixosTests.service-headplane = { + # imports = [ ./tests/vm/default.nix ]; + # _module.args = { inherit self inputs; }; + # + # clan.modules."@clan/headplane" = module; + # }; + # }; +}