Update CLAUDE.md
This commit is contained in:
38
CLAUDE.md
38
CLAUDE.md
@@ -10,7 +10,7 @@ This is a NixOS configuration repository using flakes, managing multiple machine
|
|||||||
|
|
||||||
### Flake Structure
|
### Flake Structure
|
||||||
- **flake.nix**: Main entry point defining inputs (nixpkgs, home-manager, plasma-manager, etc.) and outputs for multiple NixOS configurations
|
- **flake.nix**: Main entry point defining inputs (nixpkgs, home-manager, plasma-manager, etc.) and outputs for multiple NixOS configurations
|
||||||
- **Machines**: `nix-book`, `boxy`, `wixos` (WSL configuration)
|
- **Machines**: `nix-book`, `boxy`, `wixos` (WSL configuration), `zix790prors`, `live-usb`, `johno-macbookpro` (Darwin/macOS)
|
||||||
- **Home configurations**: Standalone home-manager configuration for user `johno`
|
- **Home configurations**: Standalone home-manager configuration for user `johno`
|
||||||
|
|
||||||
### Directory Structure
|
### Directory Structure
|
||||||
@@ -28,6 +28,12 @@ The repository uses a custom "roles" system where each role is a NixOS module wi
|
|||||||
- `roles.users`: User account management
|
- `roles.users`: User account management
|
||||||
- `roles.virtualisation`: Virtualization setup
|
- `roles.virtualisation`: Virtualization setup
|
||||||
- `roles.kodi`: Kodi media center
|
- `roles.kodi`: Kodi media center
|
||||||
|
- `roles.nvidia`: NVIDIA GPU configuration
|
||||||
|
- `roles.printing`: Printing support (CUPS)
|
||||||
|
- `roles.spotifyd`: Spotify daemon
|
||||||
|
- `roles.btrfs`: Btrfs filesystem configuration
|
||||||
|
- `roles.nfs-mounts`: NFS mount configuration
|
||||||
|
- `roles.darwin`: macOS-specific configurations
|
||||||
|
|
||||||
Example role usage in machine configuration:
|
Example role usage in machine configuration:
|
||||||
```nix
|
```nix
|
||||||
@@ -60,8 +66,9 @@ The repository also uses a modular home-manager role system for user-space confi
|
|||||||
**Role-Based Home Configurations:**
|
**Role-Based Home Configurations:**
|
||||||
- `home-desktop.nix`: Full-featured desktop for development workstations
|
- `home-desktop.nix`: Full-featured desktop for development workstations
|
||||||
- `home-media-center.nix`: Living room media consumption and gaming setup (boxy)
|
- `home-media-center.nix`: Living room media consumption and gaming setup (boxy)
|
||||||
- `home-laptop-compact.nix`: Essential tools only, excludes office/media for storage constraints (nix-book)
|
- `home-laptop-compact.nix`: Essential tools only, excludes office/media for storage constraints (nix-book)
|
||||||
- `home-live-usb.nix`: Minimal setup for live environments, no persistent services
|
- `home-live-usb.nix`: Minimal setup for live environments, no persistent services
|
||||||
|
- `home-darwin-work.nix`: macOS work laptop configuration
|
||||||
|
|
||||||
**Machine-Specific Role Usage:**
|
**Machine-Specific Role Usage:**
|
||||||
- **nix-book**: Compact laptop → excludes office/media roles due to SSD space constraints
|
- **nix-book**: Compact laptop → excludes office/media roles due to SSD space constraints
|
||||||
@@ -69,10 +76,13 @@ The repository also uses a modular home-manager role system for user-space confi
|
|||||||
- **zix790prors**: All-purpose workstation → full desktop experience with all roles enabled
|
- **zix790prors**: All-purpose workstation → full desktop experience with all roles enabled
|
||||||
- **wixos**: WSL2 development → full desktop experience, inherits from zix790prors Windows host
|
- **wixos**: WSL2 development → full desktop experience, inherits from zix790prors Windows host
|
||||||
- **live-usb**: Temporary environment → only base + desktop roles, no persistent services
|
- **live-usb**: Temporary environment → only base + desktop roles, no persistent services
|
||||||
|
- **johno-macbookpro**: macOS work laptop → Darwin-specific configuration with development tools
|
||||||
|
|
||||||
## Common Commands
|
## Common Commands
|
||||||
|
|
||||||
### Building and Switching Configurations
|
### Building and Switching Configurations
|
||||||
|
|
||||||
|
**NixOS (Linux):**
|
||||||
```bash
|
```bash
|
||||||
# Build and switch to a specific machine configuration
|
# Build and switch to a specific machine configuration
|
||||||
sudo nixos-rebuild switch --flake .#<hostname>
|
sudo nixos-rebuild switch --flake .#<hostname>
|
||||||
@@ -84,12 +94,22 @@ nixos-rebuild build --flake .#<hostname>
|
|||||||
home-manager switch --flake .#johno
|
home-manager switch --flake .#johno
|
||||||
```
|
```
|
||||||
|
|
||||||
|
**Darwin (macOS):**
|
||||||
|
```bash
|
||||||
|
# Build and switch to Darwin configuration
|
||||||
|
darwin-rebuild switch --flake .#johno-macbookpro
|
||||||
|
|
||||||
|
# Build without switching
|
||||||
|
darwin-rebuild build --flake .#johno-macbookpro
|
||||||
|
```
|
||||||
|
|
||||||
### Available Machine Configurations
|
### Available Machine Configurations
|
||||||
- `nix-book`: Compact laptop with storage constraints, uses `home/home-laptop-compact.nix`
|
- `nix-book`: Compact laptop with storage constraints, uses `home/home-laptop-compact.nix`
|
||||||
- `boxy`: Shared living room media center/gaming desktop with AMD GPU, uses `home/home-media-center.nix`
|
- `boxy`: Shared living room media center/gaming desktop with AMD GPU, uses `home/home-media-center.nix`
|
||||||
- `zix790prors`: Powerful all-purpose workstation (gaming, 3D modeling, development), dual-boots Windows 11 with shared btrfs /games partition, uses `home/home-desktop.nix`
|
- `zix790prors`: Powerful all-purpose workstation (gaming, 3D modeling, development), dual-boots Windows 11 with shared btrfs /games partition, uses `home/home-desktop.nix`
|
||||||
- `wixos`: WSL2 development environment running in Windows partition of zix790prors, uses `home/home-desktop.nix`
|
- `wixos`: WSL2 development environment running in Windows partition of zix790prors, uses `home/home-desktop.nix`
|
||||||
- `live-usb`: Bootable ISO configuration, uses `home/home-live-usb.nix`
|
- `live-usb`: Bootable ISO configuration, uses `home/home-live-usb.nix`
|
||||||
|
- `johno-macbookpro`: macOS work laptop, uses `home/home-darwin-work.nix`
|
||||||
|
|
||||||
### Flake Operations
|
### Flake Operations
|
||||||
```bash
|
```bash
|
||||||
@@ -110,14 +130,28 @@ sudo ./bootstrap.sh <hostname>
|
|||||||
```
|
```
|
||||||
This script pulls from the remote git repository and applies the configuration.
|
This script pulls from the remote git repository and applies the configuration.
|
||||||
|
|
||||||
|
### Build Live USB ISO
|
||||||
|
Use the provided script to build a bootable ISO:
|
||||||
|
```bash
|
||||||
|
./build-liveusb.sh
|
||||||
|
```
|
||||||
|
Creates an ISO suitable for Ventoy and other USB boot tools in `./result/iso/`.
|
||||||
|
|
||||||
## Development Workflow
|
## Development Workflow
|
||||||
|
|
||||||
### Adding New Machines
|
### Adding New Machines
|
||||||
|
|
||||||
|
**NixOS:**
|
||||||
1. Create new directory in `machines/<hostname>/`
|
1. Create new directory in `machines/<hostname>/`
|
||||||
2. Add `configuration.nix` with role assignments
|
2. Add `configuration.nix` with role assignments
|
||||||
3. Include hardware-configuration.nix (generated by nixos-generate-config)
|
3. Include hardware-configuration.nix (generated by nixos-generate-config)
|
||||||
4. Add nixosConfiguration to flake.nix outputs
|
4. Add nixosConfiguration to flake.nix outputs
|
||||||
|
|
||||||
|
**Darwin (macOS):**
|
||||||
|
1. Create new directory in `machines/<hostname>/`
|
||||||
|
2. Add `configuration.nix` with Darwin role assignments
|
||||||
|
3. Add darwinConfiguration to flake.nix outputs
|
||||||
|
|
||||||
### Adding New Roles
|
### Adding New Roles
|
||||||
1. Create directory in `roles/<role-name>/`
|
1. Create directory in `roles/<role-name>/`
|
||||||
2. Create `default.nix` with module definition using mkEnableOption
|
2. Create `default.nix` with module definition using mkEnableOption
|
||||||
|
|||||||
Reference in New Issue
Block a user