- Formalize tripartite project organization (guides/, plans/, discussions/) - Localize homelab architectural discussions and restructure dynu-monitor into a trade-off discussion and active Rust daemon plan - Author core operational runbooks: onboarding services, managing secrets/Authelia users, and server maintenance - Rewrite projects/homelab/README with 4-tier architecture, Gitea forge links, open discussions, and active WIP tracking - Standardize subproject nesting under nixos/ and update AGENTS.md conventions
3.0 KiB
type, project, tags
| type | project | tags | |||||
|---|---|---|---|---|---|---|---|
| guide | homelab |
|
🛠️ Server Maintenance and System Updates Runbook
This runbook outlines routine maintenance procedures for the Homelab Core appliance, including NixOS system upgrades, service health verification, garbage collection, and Docker pruning.
🔄 Updating the NixOS Server Appliance
The server operating system is defined entirely inside ~/Core.
Step 1: Update Flake Inputs
To fetch the latest versions of Nixpkgs and sops-nix:
cd ~/Core
nix flake update
Step 2: Validate the Build Dryly
Always dry-build before switching to catch compilation, syntax, or package evaluation errors:
nix flake check
nix build .#nixosConfigurations.server.config.system.build.toplevel --no-link
Step 3: Switch to the New System Generation
Once the dry build completes cleanly:
sudo nixos-rebuild switch --flake ~/Core#server
# (or simply run: nix-switch)
🏥 Post-Update Health Checklist
Run this quick verification checklist following any system switch or server reboot:
-
Systemd Daemon Health: Ensure no core background units failed:
systemctl --failed -
Core Homelab Stack: Verify Traefik, Authelia, and the control plane containers are active:
systemctl status homeserver-core.service -
Dynamic DNS (Dynu) Monitor: Ensure the IP change detector timer and service are active:
systemctl status dynu-monitor.timer systemctl status dynu-monitor.service -
GitOps Webhook Dispatcher: Verify the webhook listener is listening on port 9000:
systemctl status homelab-gitops.service -
Secrets Integrity: Verify rendered environment files were generated in RAM:
sudo ls -la /run/secrets/rendered/ -
Application Workload Status: Inspect the status of all application stacks:
appctl list
🧹 Disk Space Reclamation & Garbage Collection
Over time, older Nix generations, build artifacts, and Docker layers accumulate on disk. Follow this clean-up routine:
1. Collect Nix Garbage
To prune unreachable store paths and older generations:
# Delete older system generations (older than 7 days)
sudo nix-env --delete-generations +7d --profile /nix/var/nix/profiles/system
# Prune the store
sudo nix-collect-garbage -d
2. Prune Unused Docker Resources
Remove dangling container images, stopped containers, and build cache:
# Prune dangling images and build cache safely
docker system prune -a --volumes --filter "until=168h"
(Only prunes containers stopped for longer than 7 days).
🚨 Emergency System Rollback
If a newly applied NixOS generation causes system issues:
# Roll back to the previous generation immediately
sudo nixos-rebuild switch --rollback
(Or select the previous generation from the systemd-boot menu upon reboot).