module-eval: evaluate shared fixture configs once
Thirty-three module-eval fixtures were a second (or later) full `nixosSystem` evaluation of a config another fixture already evaluated: 16 shapes defined identically in two to seven cluster files, plus duplicates inside agent-queue-bao, core-toggle and swarm-services-switch. Each cluster imports ./lib.nix itself, so nothing was shared between them. nix/module-eval/shared.nix now defines each of those 16 shapes once. nix/checks.nix instantiates it a single time and passes it as `shared` to the 23 clusters that read one, and each cluster rebinds the fixture under its existing local name. Assertions are unchanged. Case text changes only in core-toggle, where two cases built the forge-host fixture inline and now read the file's `forgeHere`, and in two inline `let` bindings (bao-otel-collector, grafana) that now take the shared fixture. Six folds are value-equal rather than textually equal: they drop an explicit `deploy.hive-controller.enable = false` or `deploy.swarm-otel.enable = false` that equals what the option already resolves to for that config. Nothing under nix/host-modules sets either option apart from the `mkDefault allSwarmServices` on swarm-otel, and the only option-priority read there is `domain.highestPrio`. Part of #5171.
This commit is contained in:
parent
53d0d59be0
commit
18ed3f5040
25 changed files with 201 additions and 147 deletions
|
|
@ -6,6 +6,7 @@
|
|||
lib,
|
||||
self,
|
||||
nixosSystem,
|
||||
shared,
|
||||
}:
|
||||
let
|
||||
inherit
|
||||
|
|
@ -26,25 +27,15 @@ let
|
|||
|
||||
# A dedicated services host with hives elsewhere: the swarm-services
|
||||
# toggle and no hive, the recipe docs/swarm/services.md gives.
|
||||
swarmServicesOnly = hive {
|
||||
deploy.hive-controller.enable = false;
|
||||
deploy.allSwarmServices = true;
|
||||
};
|
||||
swarmServicesOnly = shared.servicesHere;
|
||||
|
||||
# A services host with hives elsewhere and the store elsewhere too: no hive
|
||||
# and no store identity minted here.
|
||||
swarmServicesOnlyNoStore = hive {
|
||||
deploy.hive-controller.enable = false;
|
||||
deploy.allSwarmServices = true;
|
||||
deploy.bao.enable = false;
|
||||
};
|
||||
swarmServicesOnlyNoStore = swarmServicesBaoElsewhere;
|
||||
|
||||
# A dedicated secret-store host: no hive, and the store's browser UI the
|
||||
# only swarm name its gateway fronts.
|
||||
storeOnlyNoHive = hive {
|
||||
deploy.hive-controller.enable = false;
|
||||
deploy.bao.enable = true;
|
||||
};
|
||||
storeOnlyNoHive = shared.baoOnly;
|
||||
|
||||
# The homeserver on a host without a hive.
|
||||
matrixNoHive = hive {
|
||||
|
|
@ -123,7 +114,7 @@ let
|
|||
deploy.forgejo.enable = true;
|
||||
deploy.forgejo.mirrors = [ aMirror ];
|
||||
};
|
||||
forgeOnly = hive { deploy.forgejo.enable = true; };
|
||||
forgeOnly = shared.forgeHere;
|
||||
forgeWithController = hive {
|
||||
deploy.swarm-controller.enable = true;
|
||||
deploy.forgejo.enable = true;
|
||||
|
|
@ -138,7 +129,7 @@ let
|
|||
# The controller with every shared service on another host, and the same
|
||||
# controller hosting them all: the swarm UI's links must not tell the two
|
||||
# apart.
|
||||
controllerAlone = hive { deploy.swarm-controller.enable = true; };
|
||||
inherit (shared) controllerAlone;
|
||||
controllerWithServices = hive {
|
||||
deploy.swarm-controller.enable = true;
|
||||
deploy.allSwarmServices = true;
|
||||
|
|
|
|||
Loading…
Reference in a new issue