nix: export the CI server as nixosModules.cc-ci-server
continuous-integration/drone/push Build is failing

The whole server (every service module, the harness tooling, sops wiring,
acme-dns) becomes one reusable module, nix/modules/default.nix, so another
flake can run cc-ci on a host it defines. First consumer: the
cc-ci-orchestrator repo's `#cc-ci` host, which runs the CI server and the
orchestrator together on one Hetzner machine.

Two things the modules hard-coded become options (nix/modules/options.nix):
- cc-ci.publicIPv4 — acme-dns's listen address and ns-acme glue record.
- cc-ci.sopsFile — the secrets.yaml path; defaults to the secrets/ submodule,
  but a consumer that imports cc-ci as a plain input (no private submodule)
  points it at the deployed --recursive checkout and sops-nix reads it at
  activation (validateSopsFiles off for that case).

The standalone host (nix/hosts/cc-ci-hetzner) now only carries hardware,
networking and identity and imports the module via the flake. Verified: the
`#cc-ci` system derivation is byte-identical before and after
(/nix/store/ckp1244bz86fz3qbx81n5kx60c1lak3m-…531670d.drv on both).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FqkQq3CDmFWcQ7u1LzoyRz
This commit is contained in:
2026-09-07 19:56:58 +00:00
co-authored by Claude Fable 5.1
parent 769fd29dcf
commit 9b99f81f5f
6 changed files with 118 additions and 40 deletions
+12 -33
View File
@@ -1,38 +1,23 @@
# cc-ci on Hetzner Cloud — NixOS configuration.
# Extends the shared cc-ci modules (same services as the Incus host) with
# Hetzner-specific hardware + networking. Run in parallel with the Incus cc-ci
# host during transition; make this the canonical cc-ci after cutover (plan §7).
# cc-ci on Hetzner Cloud — the canonical STANDALONE CI-server host.
# Hardware + networking + host identity only; every cc-ci service comes from the shared
# `nixosModules.cc-ci-server` module (nix/modules/default.nix), which flake.nix adds to this
# host. The same module builds the combined CI-server + orchestrator host declared in
# recipe-maintainers/cc-ci-orchestrator (`#cc-ci`), which is where cc-ci is moving (2026-09).
#
# To apply after `terraform apply` + nixos-infect:
# git clone --recursive https://git.autonomic.zone/recipe-maintainers/cc-ci.git /etc/cc-ci
# install -m600 <age-private-key> /var/lib/sops-nix/key.txt
# nixos-rebuild switch --flake /etc/cc-ci#cc-ci-hetzner
# nixos-rebuild switch --flake 'git+file:///etc/cc-ci?submodules=1#cc-ci'
{ pkgs, ... }:
{
imports = [
./hardware.nix
./networking.nix
../../modules/packages.nix
../../modules/secrets.nix
../../modules/acme-dns.nix
../../modules/swarm.nix
../../modules/docker-prune.nix
../../modules/abra.nix
../../modules/proxy.nix
../../modules/drone.nix
../../modules/drone-runner.nix
../../modules/bridge.nix
../../modules/dashboard.nix
../../modules/reports.nix
../../modules/backupbot.nix
../../modules/harness.nix
../../modules/warm-keycloak.nix
../../modules/nightly-sweep.nix
];
# Timezone (same as Incus host — see configuration.nix there for rationale).
time.timeZone = "UTC";
environment.etc."timezone".text = "UTC\n";
# This host's public address: acme-dns listens on it and publishes it as the ns-acme glue.
cc-ci.publicIPv4 = "91.98.47.73";
# Built from a --recursive clone, so the sops file is the default (the secrets/ submodule).
# Tailscale — keeps the orchestrator→cc-ci access path unchanged (direct peer).
# On the Hetzner host the auth key is also seeded via /etc/ts-auth-key.
@@ -64,15 +49,9 @@
allowedTCPPorts = [ 22 80 443 ];
};
# Phase `nixenv`: the Drone exec runner resolves recipe shell-outs from this host PATH
# (PATH=/run/current-system/sw/bin). Reference the SINGLE shared harness tool set
# (pkgs.ccciRuntimeTools — includes git-lfs, openssl, etc.) instead of a hand-maintained list,
# so the Drone path and the harness env (cc-ci-run / sweep) can never diverge. `openssh` is a
# host-only addition (ssh client), not part of the recipe-test tool set. Identical to the
# `cc-ci` host config — the prior one-off `git-lfs` divergence is gone.
environment.systemPackages = pkgs.ccciRuntimeTools ++ [ pkgs.openssh ];
nix.settings.experimental-features = [ "nix-command" "flakes" ];
# The recipe-test tool set (ccciRuntimeTools) is installed by the cc-ci-server module; the ssh
# client is a host-only addition (not part of the recipe-test tool set).
environment.systemPackages = [ pkgs.openssh ];
system.stateVersion = "24.11";
}