add Claude Code integration

- Add CLAUDE.md with comprehensive repository documentation
- Configure claude-code package in editors feature
- Add MCP nixos integration for better Nix ecosystem support
- Include Claude settings with co-authored-by disabled
- Update unfree predicate for proprietary AI tools
This commit is contained in:
♥ Minnie ♥ 2025-09-29 09:13:00 +08:00
parent d25c4ad382
commit 2a63eb381c
Signed by: jasmine
GPG key ID: 8563E358D4E8040E
3 changed files with 83 additions and 4 deletions

67
CLAUDE.md Normal file
View file

@ -0,0 +1,67 @@
# CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
## Repository Overview
This is a NixOS and Home Manager configuration using flakes architecture, managing two hosts (`fuchsia` and `viridian`) with declarative system and user configurations.
## Common Development Commands
### System Management
- `just build <hostname>` - Build system configuration without switching
- `just switch <hostname>` - Build and switch to new system configuration (requires sudo)
- `just deploy <hostname>` - Deploy configuration to remote host
### Nix Operations
- `nix build` - Build packages defined in flake
- `nix fmt` - Format Nix files using alejandra formatter
- `nix flake update` - Update all flake inputs
- `nixos-rebuild build --flake .#<hostname>` - Build specific host configuration
- `home-manager switch --flake .#sajenim@<hostname>` - Switch Home Manager configuration
### Development Environment
- `nix develop` - Enter development shell with `just` available
- `nix-shell` - Legacy shell environment
## Architecture
### Flake Structure
- **Main flake inputs**: nixpkgs (stable/unstable), home-manager, agenix/agenix-rekey, external configs
- **Outputs**: NixOS configurations, Home Manager configurations, packages, overlays, modules
- **Host configurations**: `fuchsia` (desktop) and `viridian` (server)
### Directory Organization
- `nixos/` - System-level configurations
- `common/global/` - Shared system configuration (nix settings, secrets, SSH)
- `common/users/` - User account definitions
- `common/optional/` - Optional system features (yubikey, persistence)
- `<hostname>/` - Host-specific configurations and services
- `home-manager/` - User environment configurations
- `sajenim/features/` - Modular user features (cli, desktop, editors, games)
- `sajenim/global/` - Base user configuration
- `modules/` - Custom NixOS and Home Manager modules
- `pkgs/` - Custom package definitions
- `overlays/` - Package modifications and patches
### Key Features
- **Ephemeral BTRFS**: Root filesystem is recreated on boot with opt-in persistence
- **Secret Management**: agenix for encrypted secrets, rekeyed with YubiKey
- **Modular Design**: Features organized as importable modules
- **Custom Packages**: External configurations (nixvim, xmonad-config) as flake inputs
### Host Profiles
- **fuchsia**: Desktop workstation with X11, gaming, development tools
- **viridian**: Server with multimedia stack (*arr services), web services, containers
### Service Management
- Services defined in `nixos/<hostname>/services/` and `nixos/<hostname>/multimedia/`
- Docker containers managed through `virtualisation.oci-containers`
- Traefik reverse proxy with automatic HTTPS
- Borgbackup for persistent data
### Configuration Patterns
- All `.nix` files use `default.nix` for module entry points
- Configurations use explicit imports for modular composition
- Host-specific and shared configurations clearly separated
- External dependencies managed through flake inputs

View file

@ -0,0 +1,4 @@
{
"outputStyle": "Explanatory",
"includeCoAuthoredBy": false
}

View file

@ -14,6 +14,10 @@
# Typesetting
pandoc
texliveFull
# AI-powered coding assistant and CLI tool
claude-code
unstable.mcp-nixos
]
++ [
# Our personal neovim configuration.
@ -27,13 +31,17 @@
])
]); # https://github.com/theCapypara/nix-jetbrains-plugins
# Allow unfree packages for jetbrains IDEs
# Allow unfree packages for proprietary software
nixpkgs.config.allowUnfreePredicate = pkg:
builtins.elem (lib.getName pkg) [
"claude-code"
"idea-ultimate"
"idea-ultimate-with-plugins"
"idea-ultimate-with-plugins"
];
# Copy our vim configuration file for jetbrains IDEs
home.file.".ideavimrc".source = ./ideavimrc;
# Copy our configuration files to home directory
home.file = {
".ideavimrc".source = ./ideavimrc;
".claude/settings.json".source = ./claude-settings.json;
};
}