From 8d3323df802c7ad38ce1420948d2561caca56e26 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Sat, 3 May 2025 07:24:52 +0200 Subject: [PATCH] docs: update CLAUDE.md with comprehensive project analysis MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- CLAUDE.md | 82 +++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 58 insertions(+), 24 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 3b71f83..27eb9ef 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -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 \ No newline at end of file +- **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.