docs: update CLAUDE.md with comprehensive project analysis

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Harald Hoyer 2025-05-03 07:24:52 +02:00
parent a4d34ea7d1
commit 8d3323df80

View file

@ -1,28 +1,62 @@
# NixCfg Development Guidelines
## Project Analysis Summary
## Build and Configuration Commands
- Update NixOS: `nixos-rebuild --flake .#[hostname] switch`
- Update Darwin: `darwin-rebuild --flake .#[hostname] switch`
- Update Home Manager: `home-manager --flake .#[user]@[hostname] switch`
- Format code: `nix fmt` (uses nixfmt-rfc-style)
- Check configuration: `nix flake check`
This is a comprehensive NixOS/Nix-Darwin configuration repository that follows a structured, modular approach to
managing system configurations. Here's an overview:
## Repository Structure
- `modules/` - Reusable configuration modules
- `systems/` - System-specific configurations
- `homes/` - Home Manager user configurations
- `lib/` - Helper functions and utilities
### Project Structure and Purpose
## Style Guidelines
- Use `metacfg` namespace for all options
- Follow existing module structure: always use `mkEnableOption` + `mkIf` pattern
- Naming: use kebab-case for files/directories, camelCase for options
- Keep system-specific config in appropriate directories, extract common functionality to modules
- Include sufficient documentation in code for complex functions
- Commit messages should follow conventional commit format
This repository is a Nix Flake-based configuration setup for managing multiple systems across different architectures:
## Module Creation
- Create new modules in appropriate category under modules/
- Use existing modules as templates for structure
- Always define options with types and descriptions
- Prefer using existing NixOS/Home Manager modules over custom implementations
- **NixOS systems** (x86_64-linux, aarch64-linux)
- **macOS systems** (x86_64-darwin, aarch64-darwin)
- **Home Manager configurations** for user environments
### Key Components
1. **Flake Configuration**
- Uses Snowfall library for flake structure
- Integrates multiple inputs including:
- NixOS and Nixpkgs (stable and unstable)
- Nix-Darwin for macOS
- Home Manager for user environments
- Various specialized tools (lanzaboote, sops-nix, disko, etc.)
2. **Modular Structure**
- `modules/`: Reusable configuration modules (NixOS, Darwin, Home-Manager)
- `systems/`: System-specific configurations organized by architecture
- `homes/`: User-specific Home Manager configurations
- `lib/`: Helper functions and utilities
- `overlays/`: Nixpkgs modifications
- `packages/`: Custom package definitions
3. **Notable Features**
- Supports secure boot via Lanzaboote
- Includes specialized SGX (Software Guard Extensions) configurations
- Uses SOPS for secrets management
- Implements disk configuration via Disko
- Provides NixOS mailserver configuration
- Includes Neovim configuration via flake
- Homebrew integration for macOS
- CLAUDE.md with development guidelines
### Development Practices
Based on the CLAUDE.md file being added, the project follows these practices:
- Standardized build and configuration commands
- Consistent module structure with `mkEnableOption` and `mkIf` patterns
- Namespace convention using `metacfg`
- Organized file/directory naming (kebab-case for files, camelCase for options)
- Documented code and conventional commit format
### Usage
The project provides commands for:
- Installing systems via nixos-anywhere
- Updating NixOS and macOS systems
- Managing Home Manager configurations
- All using the flake as the central configuration source
This appears to be a well-organized, comprehensive Nix configuration setup for managing multiple systems across
different architectures with a focus on modularity, reusability, and maintainability.