4.2 KiB
4.2 KiB
Quick Start Guide for NixOS Configuration Repository
This guide provides essential information for agents to quickly understand and work with this NixOS configuration repository.
Repository at a Glance
- Type: Flake-based NixOS configuration
- Base: NixOS 25.05 stable with selective unstable packages
- Systems: framework (laptop), aurora (desktop), labrizor (desktop)
- Desktop: KDE Plasma with modular application sets
- Users: jsutter (primary), isutter, aksutter
Essential Commands
Testing Configuration
# Check flake syntax and outputs
nix flake check
# Dry run for specific system
sudo nixos-rebuild dry-run --flake .#systemname
# Show flake outputs
nix flake show
Applying Changes
# Apply to specific system
sudo nixos-rebuild switch --flake .#systemname
# Build only (don't switch)
sudo nixos-rebuild build --flake .#systemname
# Test (current generation rollback on reboot)
sudo nixos-rebuild test --flake .#systemname
Updates
# Update all flake inputs
nix flake update
# Update only unstable packages
nix flake lock --update-input nixpkgs-unstable
File Locations
| What you want to do | Where to edit |
|---|---|
| Add system packages | systems/common.nix |
| Add development tools | desktop/dev.nix |
| Add desktop apps | desktop/[category].nix |
| Modify user settings | users/[username].nix |
| System-specific settings | systems/[hostname].nix |
| Add new system | Edit flake.nix + create systems/[hostname].nix |
Adding Packages: Quick Reference
# In appropriate .nix file
{ config, pkgs, pkgs-unstable, ... }: # Add pkgs-unstable if needed
{
# Use stable packages
environment.systemPackages = with pkgs; [
firefox
git
new-package
];
# Use unstable when necessary
environment.systemPackages = with pkgs; [
pkgs-unstable.latest-tool # Comment why unstable is needed
];
}
System Status
framework (Laptop)
- Hardware: Framework AMD AI 300 series
- Special: AMD GPU optimization, power management
- Users: jsutter
aurora (Desktop)
- Hardware: Generic desktop
- Special: 3D/2D printing, multiple users
- Users: jsutter, isutter, aksutter
labrizor (Desktop)
- Hardware: Generic desktop
- Special: 3D printing
- Users: jsutter
Module Structure
Common Desktop Modules (applied to all desktop systems)
systems/common.nix- Base system configdesktop/plasma.nix- KDE Plasmadesktop/dev.nix- Development toolsdesktop/office.nix- Office applicationsdesktop/gaming.nix- Gaming platformsdesktop/media.nix- Audio/video softwaredesktop/virtualization.nix- VM/container supportdesktop/tailscale.nix- VPN for internet archivedesktop/3dprinting.nix- 3D printing toolsdesktop/2dprinting.nix- 2D printing tools
Critical Rules
- Always test before applying: Use
dry-runfirst - Use stable packages unless necessary: Document unstable usage
- Follow file placement rules: Put configs in correct directories
- Maintain security: Never commit secrets or private keys
Emergency Recovery
If system fails to boot:
# Boot from installation media
mount /dev/disk/by-partlabel/primary /mnt
cd /mnt/root/nixos
sudo nixos-rebuild switch --rollback
Common Patterns
Add New Package
- Choose appropriate file (see table above)
- Add to
environment.systemPackages - Test:
sudo nixos-rebuild dry-run --flake .#system-name - Apply:
sudo nixos-rebuild switch --flake .#system-name
Add New User
- Create
users/newuser.nixfollowing existing pattern - Add to desired system in
flake.nix - Test and apply
Add New System
- Create
systems/hostname.nixwith hardware config - Add to
flake.nixfollowing existing pattern - Test and apply
Documentation
- Project Guide:
docs/PROJECT_GUIDE.md- Comprehensive documentation - File Structure:
docs/FILE_STRUCTURE.md- Detailed file reference - Workflows:
docs/WORKFLOW.md- Step-by-step procedures - Rules:
.clinerules- Agent-specific guidelines
Get Help
- Check existing patterns in similar files
- Read
docs/PROJECT_GUIDE.mdfor detailed information - Follow
.clinerulesfor best practices - Test thoroughly before applying changes