From 2e6f88a2d9b4c896d45cad54fdd23936e6f0a258 Mon Sep 17 00:00:00 2001 From: Julian Sutter Date: Mon, 16 Feb 2026 21:05:19 -0800 Subject: [PATCH] Add remote NixOS system management instructions to agents.md --- agents.md | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/agents.md b/agents.md index d255344..bfe5ee0 100644 --- a/agents.md +++ b/agents.md @@ -26,3 +26,51 @@ - Server configs may contain hardcoded credentials - use agenix or systemd credentials for production - Both warp and skip build successfully - Repository root: `/home/jsutter/src/nixos` + +## Remote System Management + +### Access Systems +SSH to machines using hostnames (resolve via local `/etc/hosts` or DNS): +```bash +ssh # Replace with actual system name +``` + +### Make Configuration Changes +1. **Check current systems:** View `flake.nix` for available system configurations +2. **Edit local config:** `cd ~/src/nixos && vim [relevant_file]` +3. **Test build:** `nixos-rebuild build --flake .#` +4. **Commit and push changes:** + ```bash + git add . && git commit -m "description" + git push origin master + ``` +5. **Update target systems:** + ```bash + ssh 'cd ~/src/nixos && git pull && sudo nixos-rebuild switch --flake .#' + ``` + +### Bulk Updates +```bash +# Update multiple systems +for host in host1 host2 host3; do + ssh $host 'cd ~/src/nixos && git pull && sudo nixos-rebuild switch --flake .#' & +done +wait # Wait for all updates to complete +``` + +### Quick Management +```bash +# Check service status +ssh 'systemctl status ' + +# View logs +ssh 'journalctl -u -f' + +# Rebuild if build fails +ssh 'cd ~/src/nixos && git pull && sudo nixos-rebuild switch --flake .#' +``` + +### Repository +- **Central:** https://git.symbiotrip.com/jsutter/nixos +- **Config reference:** Check `flake.nix` for system names and module structure +- **Update workflow:** Local edit → Push → Remote pull → Rebuild