cluster/lib: implement simulacrum options

This commit is contained in:
Max Headroom 2024-07-22 00:58:50 +02:00
parent 532a569c66
commit b28898c3ae
3 changed files with 28 additions and 0 deletions

View file

@ -16,6 +16,7 @@ lib.evalModules {
./lib/port-magic-multi.nix
./lib/mesh.nix
./lib/secrets.nix
./lib/testing.nix
./import-services.nix
];

View file

@ -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;
}

9
cluster/lib/testing.nix Normal file
View file

@ -0,0 +1,9 @@
{ lib, ... }:
{
options.simulacrum = lib.mkOption {
description = "Whether we are in the Simulacrum.";
type = lib.types.bool;
default = false;
};
}