All checks were successful
nixos / nixos (push) Successful in 55s
MIGRATION.md is now the complete plan for moving production from Ansible and Terraform to NixOS and OpenTofu: what was rehearsed and how, the preparation that needs no downtime, one runbook per host with its checks and rollback, the clean-up including the branch renames, and the rules for running restored production data on test servers. The NixOS workflow now deploys on main, ops first, building on each host. It checks /etc/NIXOS before touching a host, so it skips both servers until their conversion and cannot reach a Debian one. known_hosts moves to the repository root for it. Renovate learns the Nix files: version comments, the runner's job images and flake.lock (weekly). The Ansible patterns stay until Ansible is gone. Assisted-by: Claude:opus-5-5
77 lines
1.9 KiB
Nix
77 lines
1.9 KiB
Nix
{
|
|
description = "asxp.io servers";
|
|
|
|
inputs = {
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-26.05";
|
|
# For the few packages 26.05 has older than what production runs
|
|
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
|
|
sops-nix = {
|
|
url = "github:Mic92/sops-nix";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
};
|
|
|
|
outputs =
|
|
{
|
|
nixpkgs,
|
|
nixpkgs-unstable,
|
|
sops-nix,
|
|
...
|
|
}:
|
|
let
|
|
mkHost =
|
|
modules:
|
|
nixpkgs.lib.nixosSystem {
|
|
system = "x86_64-linux";
|
|
specialArgs.unstable = nixpkgs-unstable.legacyPackages.x86_64-linux;
|
|
modules = [
|
|
sops-nix.nixosModules.sops
|
|
./modules/hetzner.nix
|
|
./modules/base.nix
|
|
./modules/podman.nix
|
|
./modules/wireguard.nix
|
|
./modules/alert.nix
|
|
./modules/backup.nix
|
|
./modules/monitoring-agent.nix
|
|
]
|
|
++ modules;
|
|
};
|
|
in
|
|
{
|
|
# `nix develop ./nixos`: every tool the READMEs call
|
|
devShells.x86_64-linux.default =
|
|
let
|
|
pkgs = nixpkgs.legacyPackages.x86_64-linux;
|
|
in
|
|
pkgs.mkShell {
|
|
packages = with pkgs; [
|
|
opentofu
|
|
hcloud
|
|
nixos-rebuild
|
|
sops
|
|
ssh-to-age
|
|
age
|
|
restic
|
|
rclone
|
|
jq
|
|
openssh
|
|
];
|
|
};
|
|
|
|
nixosConfigurations = {
|
|
asxpio-ops = mkHost [ ./hosts/asxpio-ops ];
|
|
asxpio-services = mkHost [ ./hosts/asxpio-services ];
|
|
|
|
# Both hosts on throwaway servers, with their own keys and
|
|
# addresses: everything is tried there first.
|
|
rehearsal-ops = mkHost [
|
|
./hosts/asxpio-ops
|
|
./hosts/rehearsal/ops.nix
|
|
];
|
|
rehearsal-services = mkHost [
|
|
./hosts/asxpio-services
|
|
./hosts/rehearsal/services.nix
|
|
];
|
|
};
|
|
};
|
|
}
|