nix: export the CI server as nixosModules.cc-ci-server
continuous-integration/drone/push Build is failing
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:
@@ -16,7 +16,7 @@
|
||||
sops-nix.inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
outputs = { nixpkgs, sops-nix, ... }:
|
||||
outputs = { self, nixpkgs, sops-nix, ... }:
|
||||
let
|
||||
system = "x86_64-linux";
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
@@ -35,13 +35,25 @@
|
||||
];
|
||||
in
|
||||
{
|
||||
# The whole CI server as one reusable module (nix/modules/default.nix): every service,
|
||||
# the harness tooling, sops wiring and acme-dns — but no hardware, networking, tailscale
|
||||
# node, root keys or stateVersion. sops-nix's module comes bundled so a consumer only has
|
||||
# to import this and set `cc-ci.publicIPv4` (+ `cc-ci.sopsFile` when it is not built from
|
||||
# a --recursive clone). A consuming flake MUST make its `cc-ci` input follow its own
|
||||
# `nixpkgs` and `sops-nix`, otherwise two sops-nix module trees collide.
|
||||
# Consumer: recipe-maintainers/cc-ci-orchestrator `#cc-ci` (CI server + orchestrator on
|
||||
# one Hetzner host, 2026-09).
|
||||
nixosModules.cc-ci-server = {
|
||||
imports = [ sops-nix.nixosModules.sops ./nix/modules ];
|
||||
};
|
||||
|
||||
nixosConfigurations = {
|
||||
# Canonical live host target: the Hetzner cc-ci server.
|
||||
# Use `.#cc-ci` for the current production host.
|
||||
cc-ci = nixpkgs.lib.nixosSystem {
|
||||
inherit system;
|
||||
modules = [
|
||||
sops-nix.nixosModules.sops
|
||||
self.nixosModules.cc-ci-server
|
||||
./nix/hosts/cc-ci-hetzner/configuration.nix
|
||||
];
|
||||
};
|
||||
@@ -61,7 +73,7 @@
|
||||
cc-ci-hetzner = nixpkgs.lib.nixosSystem {
|
||||
inherit system;
|
||||
modules = [
|
||||
sops-nix.nixosModules.sops
|
||||
self.nixosModules.cc-ci-server
|
||||
./nix/hosts/cc-ci-hetzner/configuration.nix
|
||||
];
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user