This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
When the user provides design guidance or asks for changes based on design principles, architectural decisions, or organizational preferences, you should:
- Implement the requested changes
- Update this CLAUDE.md file to incorporate that understanding for future interactions
- Add the new guidance to the appropriate section to ensure consistency in future decisions
This ensures that design decisions and architectural preferences are captured and applied consistently across all interactions.
This is a NixOS configuration repository managed using flakes and nixos-unified. It contains system and home-manager configurations for multiple machines, with a modular structure separating concerns between NixOS system configuration and home-manager user configuration.
just- The justfile contains some handy commandsnix develop- Enter the development shellnixos-rebuild test- Test the configuration
CRITICAL: Always verify changes work before considering them complete. Never tell the user you're done without running the build check first.
- Git tracking: If you created ANY new files (especially
.nixfiles), rungit add <file>IMMEDIATELY - Nix flakes can only see git-tracked files. This is MANDATORY before any build attempt. Do not git add files which are only modified. - Test changes: Run
nixos-rebuild testto switch to the configuration (doesn't set as default boot). - Verify functionality: Test that your changes work as expected or outline what should be tested manually
Don't mark work as complete if the configuration doesn't build or if functionality is broken.
This system uses impermanence - the root filesystem is wiped on reboot and only explicitly persisted paths survive via bind mounts from /persist/system/.
When changing what's persisted in modules/nixos/impermanence.nix:
- Activating the new config creates bind mounts that hide (not erase) existing data
- If data appears "lost" after activation, unmount the bind mount to access the hidden data:
sudo umount ~/.some-path - Copy the hidden data to the persist location, then remount
Data on the ephemeral root is only truly lost on reboot.
configurations/- Host-specific configurationshome/- Home-manager configurations (bbrian.nix, root.nix)nixos/- NixOS system configurations by hostname (am/, torag/)
modules/- Reusable configuration modulesflake-parts/- Flake-parts modules (devshell, neovim, toplevel)home/- Home-manager modules (applications, development tools, scripts)nixos/- NixOS system modules (boot, networking, security, etc.)
flake.nix- Main flake configuration with inputs and outputsmodules/home/hyprland/hyprland.nix- Hyprland window manager configurationmodules/home/hyprland/waybar.nix- Waybar status bar configurationmodules/home/nvim/nixvim.nix- Main neovim configuration
The repository uses nixos-unified for configuration management with:
- Auto-wiring of configurations based on directory structure
- Separation of system (NixOS) and user (home-manager) configurations
- Modular approach with reusable modules in
modules/ - Host-specific configurations in
configurations/
- Modules should be general and reusable: Code in
modules/should not contain hostname conditionals or machine-specific logic - Machine-specific configuration belongs in
configurations/: Any configuration that depends on the hostname or is specific to a machine should be placed inconfigurations/nixos/[hostname]/orconfigurations/home/[username].nix - No hostname conditionals in modules: Avoid
if config.networking.hostName == "..."patterns in modules as they break modularity and reusability - Composition over conditionals: Let machine configurations compose and override module defaults rather than embedding conditionals in shared modules
This ensures modules remain clean, testable, and reusable across different machines while keeping machine-specific details properly isolated.
When adding configurations, consider the functional purpose rather than just the setting type:
- Application-specific settings (including cron jobs, systemd services) should be placed in the relevant application module (e.g., nvim-related cron jobs go in
modules/home/nvim/) - General system settings should be placed in appropriate system modules
- Scripts and utilities should be in
modules/home/scripts/regardless of their trigger mechanism
am- Primary desktop with AMD GPU, dual monitor setup (HDMI-1 primary 2560x1440, DP-2 secondary 1920x1080)torag- Secondary machine configuration
- Haskell development setup with GHC
- Neovim configuration with Nixvim
- Custom scripts for system rebuilding and tmux integration
- Hyprland - Wayland compositor with custom configuration in
modules/home/hyprland/- Waybar - Status bar (replaces Xmobar)
- Hyprlock - Screen locker
- Hypridle - Idle management
- Hyprpaper - Wallpaper manager
- Rofi - Application launcher (Wayland-compatible)
The configuration emphasizes reproducibility, modularity, and integration between system and user environments through the Nix ecosystem.