89 lines
2.8 KiB
Markdown
89 lines
2.8 KiB
Markdown
# CLAUDE.md
|
|
|
|
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
|
|
|
## System Overview
|
|
|
|
This is a NixOS system configuration repository using Nix flakes with home-manager integration. The configuration manages multiple machines:
|
|
- **xps13**: Dell XPS 13 laptop with Hyprland desktop environment
|
|
- **Titan**: Server configuration
|
|
- **Athena**: Server configuration
|
|
|
|
## Architecture
|
|
|
|
The configuration is organized using a modular structure:
|
|
|
|
- `flake.nix`: Main flake configuration defining system inputs and outputs for all machines
|
|
- `modules/`: Shared configuration modules
|
|
- `configuration-common.nix`: Common system settings shared across machines
|
|
- `configuration-[machine].nix`: Machine-specific system configurations
|
|
- `hardware-configuration-[machine].nix`: Hardware-specific configurations
|
|
- `home-manager-common.nix`: Common home-manager packages and settings
|
|
- `hyprland.nix`: Hyprland window manager configuration
|
|
- `waybar.nix`: Waybar status bar configuration
|
|
- `home-[machine].nix`: Machine-specific home-manager configurations
|
|
- `home/`: User dotfiles and configuration files
|
|
- `secrets/`: SOPS encrypted secrets
|
|
|
|
## Key Technologies
|
|
|
|
- **NixOS**: Declarative Linux distribution
|
|
- **Nix Flakes**: Modern Nix package management with lockfile
|
|
- **Home Manager**: Dotfile and user environment management
|
|
- **SOPS**: Secret management with encryption
|
|
- **Disko**: Declarative disk partitioning
|
|
- **Hyprland**: Wayland compositor (xps13 only)
|
|
- **Neovim**: Custom neovim configuration from external git repository
|
|
|
|
## Common Commands
|
|
|
|
### System Management
|
|
```bash
|
|
# Build and switch to new configuration (requires sudo)
|
|
sudo nixos-rebuild switch --flake .#[machine-name]
|
|
|
|
# Build without switching (test configuration)
|
|
nixos-rebuild build --flake .#[machine-name]
|
|
|
|
# Test configuration (temporary, reverts on reboot)
|
|
sudo nixos-rebuild test --flake .#[machine-name]
|
|
|
|
# Check flake for errors
|
|
nix flake check
|
|
|
|
# Update flake inputs
|
|
nix flake update
|
|
|
|
# Show available system generations
|
|
nixos-rebuild list-generations
|
|
```
|
|
|
|
### Machine-Specific Examples
|
|
```bash
|
|
# XPS 13 laptop
|
|
sudo nixos-rebuild switch --flake .#xps13
|
|
|
|
# Titan server
|
|
sudo nixos-rebuild switch --flake .#Titan
|
|
|
|
# Athena server
|
|
sudo nixos-rebuild switch --flake .#Athena
|
|
```
|
|
|
|
### Development
|
|
```bash
|
|
# Enter development shell with nix tools
|
|
nix develop
|
|
|
|
# Format nix files
|
|
nix fmt
|
|
```
|
|
|
|
## Important Notes
|
|
|
|
- All machines use the username `th3r00t`
|
|
- Neovim configuration is managed externally from `git.th3r00t.net/th3r00t/nvim-config.git`
|
|
- SOPS is used for secret management - encrypted files are in `secrets/`
|
|
- Hardware configurations are machine-specific and auto-generated
|
|
- The flake uses nixos-unstable channel
|
|
- Custom overlays are defined in flake.nix for package modifications |