Start of the move from Ansible to NixOS. Services run as native NixOS services where nixpkgs has a module and as Podman containers otherwise; there is no Docker. Shared: users with their Debian UIDs, SSH with the Ansible role's crypto settings, nftables firewall, WireGuard (ops is the hub), sops-nix secrets per host, the restic backup script with its schedule and retention, mail on unit failure. asxpio-services: Xray, SillyTavern, Minecraft (Paper) and the ACME forwarder natively; XMPP stays in containers because the server is a custom build. asxpio-ops: Postgres, Garage and Forgejo natively. Roles, buckets, keys and grants move here from the storage repo's init scripts. Services that own data wait for /var/lib/.data-in-place, so an install never creates empty state where a restore is about to land. migration/*-data.sh move the Debian-era data into the new layout. hosts/rehearsal turns the two hosts into a test pair with its own keys and dummy secrets. Everything here ran there, Postgres, Garage, Forgejo, Minecraft and SillyTavern on a restored copy of production data. Three differences from the containers showed up and are handled: Garage rejects a 0440 credential file, Geyser needs libcrypto and netlink, SillyTavern ignores the module's listen flags. Production is untouched: both servers still run Debian under Ansible. Assisted-by: Claude:fable-5-2
45 lines
1.4 KiB
Nix
45 lines
1.4 KiB
Nix
# asxpio-ops on a throwaway server: the same system with its own keys,
|
|
# its own addresses and SSH open to the world. Pairs with ./services.nix
|
|
# on a private network with the production addresses (10.10.0.10/.20).
|
|
{ lib, ... }:
|
|
{
|
|
networking.hostName = "rehearsal-ops";
|
|
sops.defaultSopsFile = ../../secrets/rehearsal-ops.yaml;
|
|
asxpio.sshFrom = [ "*" ];
|
|
|
|
# Same script and schedule, into repositories on its own disk
|
|
asxpio.backup.repositories = lib.mkForce {
|
|
hel1 = "/var/backups/test-repo-hel1";
|
|
fsn1 = "/var/backups/test-repo-fsn1";
|
|
};
|
|
systemd.network.networks."10-public".address = lib.mkForce [ "2a01:4f9:c015:f949::1/64" ];
|
|
|
|
# A restored copy of production must not mail anyone, sync mirrors or
|
|
# call webhooks
|
|
services.forgejo.settings = {
|
|
mailer.ENABLED = false;
|
|
service.ENABLE_NOTIFY_MAIL = lib.mkForce false;
|
|
mirror.ENABLED = false;
|
|
webhook.ALLOWED_HOST_LIST = "loopback";
|
|
"cron.update_mirrors".ENABLED = false;
|
|
};
|
|
|
|
asxpio.wireguard.peers = [
|
|
{
|
|
name = "asxpio-services";
|
|
publicKey = "DwCNEfzgV1fU2ZPwEwkxun/s8vMZYrzdp74ZDrrSTD4=";
|
|
allowedIPs = [
|
|
"10.20.0.20/32"
|
|
"fd69:69:69::20/128"
|
|
];
|
|
}
|
|
{
|
|
name = "laptop";
|
|
publicKey = "iTY+NChSd8pcm/vke8s8EqsxjwEJpBEc07PfEg1Q0zQ=";
|
|
allowedIPs = [
|
|
"10.20.0.2/32"
|
|
"fd69:69:69::2/128"
|
|
];
|
|
}
|
|
];
|
|
}
|