diff --git a/cluster/default.nix b/cluster/default.nix index 97ab73c..548c3af 100644 --- a/cluster/default.nix +++ b/cluster/default.nix @@ -16,6 +16,7 @@ lib.evalModules { ./lib/port-magic-multi.nix ./lib/mesh.nix ./lib/secrets.nix + ./lib/testing.nix ./import-services.nix ]; diff --git a/cluster/lib/service-module.nix b/cluster/lib/service-module.nix index 3ef8c98..2fb07e7 100644 --- a/cluster/lib/service-module.nix +++ b/cluster/lib/service-module.nix @@ -52,6 +52,24 @@ in })); default = {}; }; + simulacrum = { + enable = mkEnableOption "testing this service in the Simulacrum"; + deps = mkOption { + description = "Other services to include."; + type = with types; listOf str; + default = []; + }; + settings = mkOption { + description = "NixOS test configuration."; + type = types.deferredModule; + default = {}; + }; + augments = mkOption { + description = "Cluster augments (will be propagated)."; + type = types.deferredModule; + default = {}; + }; + }; }; config.otherNodes = builtins.mapAttrs (const filterGroup) config.nodes; } diff --git a/cluster/lib/testing.nix b/cluster/lib/testing.nix new file mode 100644 index 0000000..6c96b37 --- /dev/null +++ b/cluster/lib/testing.nix @@ -0,0 +1,9 @@ +{ lib, ... }: + +{ + options.simulacrum = lib.mkOption { + description = "Whether we are in the Simulacrum."; + type = lib.types.bool; + default = false; + }; +}