diff --git a/checks/mycelium/default.nix b/checks/mycelium/default.nix index f601e74b4..2f3af1d3e 100644 --- a/checks/mycelium/default.nix +++ b/checks/mycelium/default.nix @@ -47,7 +47,7 @@ nixosLib.runTest ( server.succeed("systemctl status mycelium") # Check that mycelium is listening on its default port - server.succeed("${pkgs.iproute2}/bin/ss -tulpn | grep -q 'mycelium'") + server.wait_until_succeeds("${pkgs.iproute2}/bin/ss -tulpn | grep -q 'mycelium'", 10) ''; } ) diff --git a/clanServices/importer/README.md b/clanServices/importer/README.md new file mode 100644 index 000000000..6859a2c5e --- /dev/null +++ b/clanServices/importer/README.md @@ -0,0 +1,26 @@ +The importer module allows users to configure importing modules in a flexible and structured way. +It exposes the `extraModules` functionality of the inventory, without any added configuration. + +## Usage: + +```nix +inventory.instances = { + + zone1 = { + module.name = "@clan/importer"; + roles.default.tags = [ "zone1" ]; + roles.default.extraModules = [ "modules/zone1.nix" ]; + }; + + base = { + module.name = "@clan/importer"; + roles.default.tags = [ "all" ]; + roles.default.extraModules = [ "modules/base.nix" ]; + }; + +}; +``` + +This will import the module `modules/base.nix` to all machines that have the `all` tag, +which by default is every machine managed by the clan. +And also import for all machines tagged with `zone1` the module at `modules/zone1.nix`. diff --git a/clanServices/importer/default.nix b/clanServices/importer/default.nix new file mode 100644 index 000000000..e561fa5a2 --- /dev/null +++ b/clanServices/importer/default.nix @@ -0,0 +1,10 @@ +{ ... }: +{ + _class = "clan.service"; + manifest.name = "clan-core/importer"; + manifest.description = "Convenient, structured module imports for hosts."; + manifest.categories = [ "Utility" ]; + manifest.readme = builtins.readFile ./README.md; + + roles.default = { }; +} diff --git a/clanServices/importer/flake-module.nix b/clanServices/importer/flake-module.nix new file mode 100644 index 000000000..829039cc0 --- /dev/null +++ b/clanServices/importer/flake-module.nix @@ -0,0 +1,6 @@ +{ lib, ... }: +{ + clan.modules = { + importer = lib.modules.importApply ./default.nix { }; + }; +}