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:
parent
a4d34ea7d1
commit
8d3323df80
82
CLAUDE.md
82
CLAUDE.md
|
@ -1,28 +1,62 @@
|
||||||
# NixCfg Development Guidelines
|
## Project Analysis Summary
|
||||||
|
|
||||||
## Build and Configuration Commands
|
This is a comprehensive NixOS/Nix-Darwin configuration repository that follows a structured, modular approach to
|
||||||
- Update NixOS: `nixos-rebuild --flake .#[hostname] switch`
|
managing system configurations. Here's an overview:
|
||||||
- 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`
|
|
||||||
|
|
||||||
## Repository Structure
|
### Project Structure and Purpose
|
||||||
- `modules/` - Reusable configuration modules
|
|
||||||
- `systems/` - System-specific configurations
|
|
||||||
- `homes/` - Home Manager user configurations
|
|
||||||
- `lib/` - Helper functions and utilities
|
|
||||||
|
|
||||||
## Style Guidelines
|
This repository is a Nix Flake-based configuration setup for managing multiple systems across different architectures:
|
||||||
- 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
|
|
||||||
|
|
||||||
## Module Creation
|
- **NixOS systems** (x86_64-linux, aarch64-linux)
|
||||||
- Create new modules in appropriate category under modules/
|
- **macOS systems** (x86_64-darwin, aarch64-darwin)
|
||||||
- Use existing modules as templates for structure
|
- **Home Manager configurations** for user environments
|
||||||
- Always define options with types and descriptions
|
|
||||||
- Prefer using existing NixOS/Home Manager modules over custom implementations
|
### 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.
|
||||||
|
|
Loading…
Reference in a new issue