# CLAUDE.md This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. ## Project Overview NixOS flake configuration for multiple machines (kronos laptop, herra desktop) using NixOS 25.11 and Home Manager 25.11. Features a layered architecture with swappable desktop rices. ## Common Commands ```bash # Apply configuration sudo nixos-rebuild switch # Test without applying sudo nixos-rebuild test # Validate flake syntax nix flake check # Preview changes sudo nixos-rebuild dry-run ``` ## Architecture ``` flake.nix # Entry point ↓ hosts/{kronos,herra}/ # Per-machine (hostname + hardware) ↓ system/ # System-wide config ├─ boot, audio, bluetooth, networking, graphics ├─ packages, programs, services, users, nix ├─ desktop.nix # X11 + i3wm └─ stylix.nix # Theming ↓ home/mun/ # User config ├─ programs/ # git, ssh, zsh └─ (imports active rice) ↓ home/rices/{nord-blue,original}/ # Desktop themes ``` ## Key Files - `flake.nix` - Defines inputs (nixpkgs, home-manager, stylix, fenix) - `hosts/kronos/configuration.nix` - Laptop config - `hosts/herra/configuration.nix` - Desktop config (dual-boot) - `system/default.nix` - System module orchestrator - `system/packages.nix` - System-wide packages - `home/mun/default.nix` - User orchestrator (imports active rice) - `home/rices/nord-blue/variables.nix` - Active rice colors ## Adding Configurations **New system package:** Add to `system/packages.nix` **New system module:** Create in `system/`, add to `system/default.nix` imports **New user program:** Create in `home/mun/programs/`, add to `home/mun/default.nix` imports **New rice module:** Create in active rice directory, add to its `default.nix` **New rice:** Create `home/rices/my-rice/` with `default.nix` and `variables.nix` ## Switching Rices Edit `home/mun/default.nix` to change the rice import: ```nix ../rices/nord-blue # or ../rices/original ``` Then: `sudo nixos-rebuild switch`