Reusable infrastructure components for operating the REZICS platform on NixOS and Nomad. This repository contains no production host identities, public origin addresses, encrypted secret payloads, or deployment credentials.
nixosModules.baseconfigures the shared hardened NixOS, WireGuard, Docker, and Nomad foundation.nixosModules.edgeadds the REZICS control-plane services, release gateway, reconciliation jobs, Cloudflare Tunnel unit, and Nomad Autoscaler.nixosModules.dataprovides the data-host foundation.nixosModules.retainedEdgeruns Outline and PostgreSQL backup services without importing the application release gateway, database runtime or autoscaler. Its reconciler purges the named retired application jobs and preserves the Databasus control backup and restore verification agent.nixosModules.mailexposes the opt-inservices.rezicsMailcontract: hostname, domain, forwarding addresses, ACME contact, runtime admin hash and initial provisioning files, and public interface. It runs Stalwart 0.16.25 with a JSON RocksDB descriptor and applies its Git-managed JMAP policy before opening the mail listeners. Initial passwords are hashed by Stalwart using Argon2id; existing account passwords are preserved on subsequent starts. Submission requires authentication and TLS. HTTP on 8085 is loopback-only; the administrative WebUI remains available on public HTTPS with password login.nixosModules.backupPauseexposesservices.rezicsBackupPause.enable, which persistently pauses only the retiredrezicsdatabase's backup and scheduled verification while retaining its history and the Outline schedules.packages.x86_64-linux.release-gatewaybuilds the OIDC-authenticated release gateway.packages.x86_64-linux.stalwartandstalwart-clipackage SHA-256-pinned upstream static releases, independent of the older Nixpkgs TOML module.
The consuming fleet repository owns nixosConfigurations, hardware configuration,
network identities, SOPS declarations, credential paths, and activation policy. It
pins this flake in its lock file and supplies the required module options.
The existing edge and data outputs retain their contracts. Fleet composition
selects which outputs to import; importing retainedEdge does not import edge.
Operator scripts receive private Cloudflare configuration and forwarding address
files as arguments. They never contain production origin addresses or passwords.
The Stalwart runtime provisioning JSON contains mailbox (username and initial
password) and dkim (initial JMAP signature records). Keep it outside Git and
load it through systemd credentials. stalwart-operator.py stage --dkim-file
stages this file and the admin hash; it preserves existing backup credentials.
DKIM key material is inserted once into the mail datastore. Host and routing
policy is reconciled on startup; user accounts and installed Applications remain
persistent Stalwart state. The 0.16 deployment uses a fresh db-v016 store;
the module does not migrate old TOML stores.
{
inputs.infrastructure = {
url = "github:rezics/infrastructure";
inputs.nixpkgs.follows = "nixpkgs";
};
outputs = { infrastructure, nixpkgs, ... }: {
nixosConfigurations.edge = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
infrastructure.nixosModules.edge
./hosts/edge
];
};
};
}With Nix installed, enter the pinned development shell and run the complete check:
nix develop --command task checkThis formats and evaluates the flake, builds the release gateway, validates every Nomad jobspec, checks shell scripts, runs Go tests, and enforces the repository's public-content policy.
Licensed under the GNU Affero General Public License v3.0; see LICENSE.