···11+# CLAUDE.md
22+33+This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
44+55+## Repository Overview
66+77+This is lassulus's personal NixOS/nix-darwin configuration repository, built on clan-core for managing multiple machines. It includes:
88+- Multiple machine configurations in `machines/`
99+- Configuration modules in `2configs/` and `3modules/`
1010+- Custom packages in `5pkgs/`
1111+- packages which could in theory be upstreamed to nixkgs should go into the pkgs folder, in the tools folder we add tools we write ourself which are more complex or not upstreamable
1212+1313+## Key Architecture Components
1414+1515+### Machine Management
1616+- **Clan-core**: Primary framework for managing multiple machines
1717+- **Secrets**: Uses password-store for secrets management via clan.core.vars
1818+1919+### Network Overlays
2020+The repository manages multiple overlay networks:
2121+- **Tor**: Anonymous network access
2222+2323+### Module System
2424+- `2configs/`: Main configuration modules
2525+- `2configs/default.nix`: imported by all machines
2626+- `3modules/`: Custom NixOS module definitions
2727+- Stockholm modules are also imported for krebs infrastructure
2828+2929+## Common Development Commands
3030+3131+```bash
3232+# Enter development shell
3333+nix develop
3434+3535+# Deploy to a specific machine
3636+clan machines update <MACHINE_NAME>
3737+3838+# Format code
3939+nix fmt
4040+4141+# Build NixOS configuration
4242+nix build .#nixosConfigurations.<machine-name>.config.system.build.toplevel
4343+4444+# Build Darwin configuration
4545+nix build .#darwinConfigurations.barnacle.system
4646+4747+# Deploy/rebuild Darwin configuration (for barnacle)
4848+sudo darwin-rebuild switch --flake .#barnacle
4949+5050+# Access machines via SSH
5151+ssh <machine-name>.r # via retiolum
5252+ssh <machine-name>.s # via spora
5353+ssh <machine-name>.n # via nether
5454+torify ssh $(pass show machines/<machine-name>/tor-hostname) # via tor
5555+```
5656+5757+## Important: Git Staging for Flake Evaluation
5858+5959+**CRITICAL**: New nix files must be staged (git add) before they are available in flake evaluation. When creating new packages, modules, or any nix files, always run `git add <files>` before testing with `nix build`, `nix run`, etc.
6060+6161+## Machine Facts and Secrets via vars
6262+6363+- SSH public keys
6464+- Network identities (retiolum, mycelium, zerotier)
6565+- Syncthing IDs
6666+- DKIM keys (for mail servers)
6767+6868+Secrets are managed via password-store and uploaded to `/run/secrets` on deployment.
6969+7070+## Adding New Machines
7171+7272+1. Create directory `machines/<name>/`
7373+2. Add `config.nix`, `physical.nix`, and optionally `disk.nix`
7474+3. Generate facts using clan-cli
7575+4. Add to inventory in `flake.nix`
7676+5. Deploy using `nix run .#deploy -- <name>`
7777+7878+## Pre-Commit
7979+8080+**CRITICAL**: Always run `nix fmt` before committing to ensure all files pass the treefmt formatting check in CI.
8181+8282+## Commit Message Guidelines
8383+8484+- Use simple, descriptive commit messages without attribution footers
8585+- Use flake attribute paths as prefixes (e.g., `tools.mutt:` not just `mutt:`)
8686+- For flake.lock updates, use: "flake.lock: update"
8787+- Follow existing patterns seen in git log
-83
CLAUDE.md
···11-# CLAUDE.md
22-33-This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
44-55-## Repository Overview
66-77-This is lassulus's personal NixOS/nix-darwin configuration repository, built on clan-core for managing multiple machines. It includes:
88-- Multiple machine configurations in `machines/`
99-- Configuration modules in `2configs/` and `3modules/`
1010-- Custom packages in `5pkgs/`
1111-- packages which could in theory be upstreamed to nixkgs should go into the pkgs folder, in the tools folder we add tools we write ourself which are more complex or not upstreamable
1212-1313-## Key Architecture Components
1414-1515-### Machine Management
1616-- **Clan-core**: Primary framework for managing multiple machines
1717-- **Secrets**: Uses password-store for secrets management via clan.core.vars
1818-1919-### Network Overlays
2020-The repository manages multiple overlay networks:
2121-- **Tor**: Anonymous network access
2222-2323-### Module System
2424-- `2configs/`: Main configuration modules
2525-- `2configs/default.nix`: imported by all machines
2626-- `3modules/`: Custom NixOS module definitions
2727-- Stockholm modules are also imported for krebs infrastructure
2828-2929-## Common Development Commands
3030-3131-```bash
3232-# Enter development shell
3333-nix develop
3434-3535-# Deploy to a specific machine
3636-clan machines update <MACHINE_NAME>
3737-3838-# Format code
3939-nix fmt
4040-4141-# Build NixOS configuration
4242-nix build .#nixosConfigurations.<machine-name>.config.system.build.toplevel
4343-4444-# Build Darwin configuration
4545-nix build .#darwinConfigurations.barnacle.system
4646-4747-# Deploy/rebuild Darwin configuration (for barnacle)
4848-sudo darwin-rebuild switch --flake .#barnacle
4949-5050-# Access machines via SSH
5151-ssh <machine-name>.r # via retiolum
5252-ssh <machine-name>.s # via spora
5353-ssh <machine-name>.n # via nether
5454-torify ssh $(pass show machines/<machine-name>/tor-hostname) # via tor
5555-```
5656-5757-## Important: Git Staging for Flake Evaluation
5858-5959-**CRITICAL**: New nix files must be staged (git add) before they are available in flake evaluation. When creating new packages, modules, or any nix files, always run `git add <files>` before testing with `nix build`, `nix run`, etc.
6060-6161-## Machine Facts and Secrets via vars
6262-6363-- SSH public keys
6464-- Network identities (retiolum, mycelium, zerotier)
6565-- Syncthing IDs
6666-- DKIM keys (for mail servers)
6767-6868-Secrets are managed via password-store and uploaded to `/run/secrets` on deployment.
6969-7070-## Adding New Machines
7171-7272-1. Create directory `machines/<name>/`
7373-2. Add `config.nix`, `physical.nix`, and optionally `disk.nix`
7474-3. Generate facts using clan-cli
7575-4. Add to inventory in `flake.nix`
7676-5. Deploy using `nix run .#deploy -- <name>`
7777-7878-## Commit Message Guidelines
7979-8080-- Use simple, descriptive commit messages without attribution footers
8181-- Use flake attribute paths as prefixes (e.g., `tools.mutt:` not just `mutt:`)
8282-- For flake.lock updates, use: "flake.lock: update"
8383-- Follow existing patterns seen in git log