2.4 KiB
2.4 KiB
NixOS Repository Quick Reference
Quick Commands
- Test build:
nixos-rebuild build --flake .#<system> - List systems:
nix flake show - Commit:
git add files && git commit -m "msg"
Systems
- warp: Server + nginx + forgejo
- skip: Server + nginx only
- framework/aurora/labrizor: Desktop systems
Key Files
flake.nix: System definitionssystems/<name>.nix: Hardware/boot configsservers/<name>.nix: Service configsusers/<name>.nix: User configs
Testing Workflow
- Always
git statusfirst - affects flake evaluation - Stage changes (
git add) before building - prevents Nix store issues - Test with
nixos-rebuild build --flake .#<system> - Check success message:
"Done. The new configuration is /nix/store/..."
Important
- Server configs may contain hardcoded credentials - use agenix or systemd credentials for production
- Always carefully inspect the NixOS wiki for instructions before adding new applications to the repo
- 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):
ssh <hostname> # Replace with actual system name
Make Configuration Changes
- Check current systems: View
flake.nixfor available system configurations - Edit local config:
cd ~/src/nixos && vim [relevant_file] - Test build:
nixos-rebuild build --flake .#<system-name> - Commit and push changes:
git add . && git commit -m "description" git push origin master - Update target systems:
ssh <hostname> 'cd ~/src/nixos && git pull && sudo nixos-rebuild switch --flake .#'
Bulk Updates
# 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
# Check service status
ssh <hostname> 'systemctl status <service>'
# View logs
ssh <hostname> 'journalctl -u <service> -f'
# Rebuild if build fails
ssh <hostname> 'cd ~/src/nixos && git pull && sudo nixos-rebuild switch --flake .#'
Repository
- Central: https://git.symbiotrip.com/jsutter/nixos
- Config reference: Check
flake.nixfor system names and module structure - Update workflow: Local edit → Push → Remote pull → Rebuild