Watch
0
0
Fork
You've already forked hyperhive
0
hyperhive/nix/module-eval/shared.nix
atlas d0fa1f98a1 module-eval: three duplicate nixosSystem fixtures come from shared.nix
builder.nix's bare, servicesHere and natsHere were exact copies of
shared.bareWithController, swarm-services-switch's swarmServicesHere and
nats-authelia's natsOldPath. The last two move into shared.nix; each file
rebinds them under its local name, so no case changes.
2026-10-15 08:29:58 +02:00

107 lines
3.4 KiB
Nix

# The fixtures more than one `checks.module-eval-*` cluster reads, each
# evaluated once. ../checks.nix imports this file once and hands the result to
# every cluster that uses one; a cluster rebinds the fixture under its own
# local name.
#
# ⚠️ Sharing only pays when ../checks.nix instantiates this file ONCE: a
# cluster that ran `import ./shared.nix` itself would get its own copy of
# every fixture, the same as defining them locally. The cost is that each
# fixture here stays live for the whole evaluation rather than one cluster's.
#
# Holds only configs that are identical across their users. A cluster whose
# claim needs one more option set defines its own fixture.
{
pkgs,
lib,
self,
nixosSystem,
}:
let
inherit
(import ./lib.nix {
inherit
pkgs
lib
self
nixosSystem
;
})
hive
hiveWithController
agent
agentWith
;
in
{
agentBare = agent { };
agentWithBao = agentWith { services.hyperhive.agent.bao.addr = "https://bao.t.local:8200"; };
bare = hive { };
bareWithController = hiveWithController { };
allLocal = hiveWithController { deploy.singleHostSwarm = true; };
autheliaOnly = hive { deploy.authelia.enable = true; };
forgeHere = hive { deploy.forgejo.enable = true; };
baoOnly = hive { deploy.bao.enable = true; };
servicesHere = hive { deploy.allSwarmServices = true; };
# The all-swarm-services switch on the controller's host, the services box
# shape that hives elsewhere join.
swarmServicesWithController = hiveWithController { deploy.allSwarmServices = true; };
# The queue's two old `swarm.nats` paths that still rename, `enable` and
# `authPackage`, with no store identity.
natsOldPath = hive {
swarm.nats.enable = true;
swarm.nats.authPackage = pkgs.emptyDirectory;
};
controllerAlone = hive { deploy.swarm-controller.enable = true; };
matrixNoBaoIdentity = hiveWithController { deploy.matrix.enable = true; };
baoWithMatrix = hiveWithController {
deploy.bao.enable = true;
deploy.matrix.enable = true;
};
# A second job declared as bare `host:port`, so a case can read one rendered
# scrape list where the store's entry carries a path and this one carries
# none.
baoWithCollector = hive {
deploy.bao.enable = true;
deploy.swarm-otel.enable = true;
swarm.otel.scrapeTargets.plain = "127.0.0.1:9999";
};
# `clientSecretFile` is what ../host-modules/otel.nix's identity assertion
# demands of any hive with the tier on.
baoWithHiveOtel = hive {
deploy.bao.enable = true;
otel.enable = true;
otel.clientSecretFile = "/var/lib/hive-otel-oidc/client.secret";
};
# The swarm collector with the IdP on another host and the store leaf placed
# by hand, without and with the collector's own OIDC pair.
otelReaderMissingLeaf = hive {
deploy.swarm-otel.enable = true;
swarm.authelia.url = "https://auth.example.invalid";
deploy.bao.clientCertFile = "/etc/pki/bao-client.pem";
deploy.bao.clientKeyFile = "/etc/pki/bao-client-key.pem";
};
otelReaderNamedInFull = hive {
deploy.swarm-otel.enable = true;
swarm.authelia.url = "https://auth.example.invalid";
deploy.bao.clientCertFile = "/etc/pki/bao-client.pem";
deploy.bao.clientKeyFile = "/etc/pki/bao-client-key.pem";
deploy.bao.otelOidcClientCertFile = "/etc/pki/bao-otel-oidc.pem";
deploy.bao.otelOidcClientKeyFile = "/etc/pki/bao-otel-oidc-key.pem";
};
}