iac/nixos/hosts/asxpio-ops/default.nix
Sergei Poljanski 2635b887c7
All checks were successful
nixos / nixos (push) Successful in 1m3s
nixos: drop the rehearsal pair and other migration leftovers
The test pair served the move to NixOS, which is done. Its overlays,
dummy secrets and sops recipients go; the rules for testing on a copy
of production stay in nixos/README.md, and git log finds the overlay
if it is needed again. Options that existed only for it (alert address,
Loki bucket, extra cert-push keys) are inlined, and comments still
pointing at Ansible or MIGRATION.md are corrected.

The tofu README now spells out the state bucket bootstrap: the bucket
is a resource in the state it holds, so a new project needs one local
apply first. The bucket gets prevent_destroy for the same reason.

Assisted-by: Claude:opus-5-5
2026-11-17 11:11:33 +04:00

71 lines
2 KiB
Nix

# asxpio-ops: Traefik, Forgejo, storage, the app stacks.
{ lib, ... }:
{
imports = [
./apps.nix
./crawler.nix
./forgejo.nix
./garage.nix
./monitoring
./postgres.nix
./traefik.nix
./xmpp-cert-sync.nix
];
networking.hostName = "asxpio-ops";
networking.domain = "asxp.io";
asxpio.privateIPv4 = "10.10.0.10";
system.stateVersion = "26.05";
systemd.network.networks."10-public".address = [ "2a01:4f9:c013:3258::1/64" ];
sops.defaultSopsFile = lib.mkDefault ../../secrets/asxpio-ops.yaml;
# --- WireGuard hub -------------------------------------------------------
asxpio.wireguard = {
interface = "wg0";
address = [
"10.20.0.10/24"
"fd69:69:69::1/64"
];
listenPort = 60101;
hub = true;
peers = lib.mkDefault (
map
(p: {
inherit (p) name publicKey;
allowedIPs = [
"10.20.0.${toString p.id}/32"
"fd69:69:69::${toString p.id}/128"
];
})
[
{ id = 20; name = "asxpio-services"; publicKey = "I2D4RvGHm0bW2mMlq9lPvbINHvnP9MsZg4XGMKTLiSU="; }
{ id = 2; name = "laptop"; publicKey = "6xYBPCiAa1MBusj7ilHGvwIoj26cXymvVksrOQLY52g="; }
{ id = 3; name = "aleks"; publicKey = "Csqd94oo6eRLUrlzeEkFxlW2IZtQG61ASXdK+ZjKzGI="; }
{ id = 4; name = "zerrtika"; publicKey = "uBRSmDuM25ciVaS9GxlCbjNPMUlmtphPDvtcEFzs8kI="; }
{ id = 5; name = "sanya"; publicKey = "tegWIorm7PjagnixbzQjCGLqDKVImynLNgk/bfx2PEk="; }
]
);
};
swapDevices = [
{
device = "/swapfile";
size = 2048;
}
];
# --- Backup ---------------------------------------------------------------
# Each service adds its own paths and hooks next to its definition:
# Postgres as a dump, Garage with a metadata snapshot, Forgejo's SQLite
# through the online backup API.
asxpio.backup = {
hostName = "asxpio-ops";
schedule = "*-*-* 03:30:00";
paths = [
"/etc/ssh" # the host key decrypts this host's secrets
"/opt"
];
};
}