cluster/lib: implement simulacrum options

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

View file

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

View file

@ -52,6 +52,24 @@ in
})); }));
default = {}; 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; 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;
};
}