keep the mirror hint off forge errors, forward the hyperhive mirror from any controller host
This commit is contained in:
parent
a6b5bafa83
commit
52cdfe84a0
1 changed files with 70 additions and 36 deletions
|
|
@ -1,13 +1,15 @@
|
|||
# Glue: wire the forge and the swarm-controller together when one host runs both.
|
||||
# Glue: wire the swarm-controller's forge seeding to the forge options.
|
||||
#
|
||||
# ONE PAIRING PER FILE — forge ← swarm-controller, and nothing else. Deleting
|
||||
# this leaves the controller seeding no pull-mirrors, the forge resolving
|
||||
# workflow actions from `data.forgejo.org` and a fresh swarm without the hyperhive
|
||||
# repo its meta flake pins.
|
||||
#
|
||||
# ⚠️ Gated on BOTH services being here: the mirrors reach a controller on this
|
||||
# host only, and the forge's own `config` block hangs off
|
||||
# `deploy.forgejo.enable`. The forge's `mirrors` warning covers the split case.
|
||||
# ⚠️ The mirror list is forwarded wherever the controller runs: it creates the
|
||||
# mirrors through the forge's API, so the forge may be on another host. The
|
||||
# list is that of the controller's own host; the forge's `mirrors` warning
|
||||
# covers a list declared on a forge host without one. `actionsFromSelf` changes
|
||||
# the forge's own settings, so it follows only a forge beside the controller.
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
|
|
@ -17,20 +19,25 @@ let
|
|||
deployCfg = config.services.hyperhive.deploy;
|
||||
in
|
||||
{
|
||||
config = lib.mkIf (deployCfg.forgejo.enable && deployCfg.swarm-controller.enable) {
|
||||
# The controller seeds the `actions/*` mirrors, so a forge beside one can
|
||||
# resolve actions from itself. `mkDefault`: an operator's explicit value wins.
|
||||
services.hyperhive.deploy.forgejo.actionsFromSelf = lib.mkDefault true;
|
||||
config = lib.mkMerge [
|
||||
(lib.mkIf deployCfg.swarm-controller.enable {
|
||||
# The meta flake pins the hyperhive repo on the swarm's forge, and a fresh
|
||||
# forge has none. The controller creates the mirror only if
|
||||
# `hyperhive/hyperhive` is absent, so a swarm that hosts the real repo is
|
||||
# not touched. `mkDefault`: an operator's explicit value wins.
|
||||
services.hyperhive.deploy.forgejo.hyperhiveUpstream =
|
||||
lib.mkDefault "https://forge.darkest.space/hyperhive/hyperhive";
|
||||
|
||||
# The meta flake pins the hyperhive repo on this forge, and a fresh forge has
|
||||
# none. The controller creates the mirror only if `hyperhive/hyperhive` is
|
||||
# absent, so a swarm that hosts the real repo is not touched.
|
||||
services.hyperhive.deploy.forgejo.hyperhiveUpstream =
|
||||
lib.mkDefault "https://forge.darkest.space/hyperhive/hyperhive";
|
||||
# JSON-encoded list of { upstream, dest }, seeded by the controller's
|
||||
# forge-objects pass (`swarm-controller/src/forge/objects.rs`).
|
||||
systemd.services.swarm-controller.environment.SWARM_CONTROLLER_FORGE_MIRRORS =
|
||||
builtins.toJSON deployCfg.forgejo.effectiveMirrors;
|
||||
})
|
||||
|
||||
# JSON-encoded list of { upstream, dest }, seeded by the controller's
|
||||
# forge-objects pass (`swarm-controller/src/forge/objects.rs`).
|
||||
systemd.services.swarm-controller.environment.SWARM_CONTROLLER_FORGE_MIRRORS =
|
||||
builtins.toJSON deployCfg.forgejo.effectiveMirrors;
|
||||
};
|
||||
(lib.mkIf (deployCfg.forgejo.enable && deployCfg.swarm-controller.enable) {
|
||||
# The controller seeds the `actions/*` mirrors, so a forge beside one can
|
||||
# resolve actions from itself. `mkDefault`: an operator's explicit value wins.
|
||||
services.hyperhive.deploy.forgejo.actionsFromSelf = lib.mkDefault true;
|
||||
})
|
||||
];
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue