diff options
| author | Natasha Moongrave <natasha@256phi.eu> | 2026-04-06 19:02:41 +0200 |
|---|---|---|
| committer | Natasha Moongrave <natasha@256phi.eu> | 2026-04-07 10:28:34 +0200 |
| commit | 6e4f4fd0d45539094fc9e6a41bb579556ab6ec6f (patch) | |
| tree | 2ace335cbb8fd67537ffa342cda3281ffe849ff0 /CLAUDE.md | |
| parent | 13cc3ccc154c143c36fe474ddb93e0b62be56acc (diff) | |
Updated config
Diffstat (limited to 'CLAUDE.md')
| -rw-r--r-- | CLAUDE.md | 93 |
1 files changed, 60 insertions, 33 deletions
@@ -4,7 +4,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co ## Project Overview -NixOS flake configuration for multiple machines (kronos laptop, herra desktop) using NixOS 25.11 and Home Manager 25.11. Features a layered architecture with swappable desktop rices. +NixOS flake configuration for multiple machines (kronos, herra, mystra) using NixOS 25.11 and Home Manager 25.11. Features a layered architecture with swappable desktop rices. ## Common Commands @@ -30,38 +30,43 @@ nix flake lock --update-input nixpkgs # Build for specific host sudo nixos-rebuild switch --flake .#kronos sudo nixos-rebuild switch --flake .#herra +sudo nixos-rebuild switch --flake .#mystra ``` ## Architecture ``` -flake.nix # Entry point +flake.nix # Entry point - assigns rices to hosts ↓ -hosts/{kronos,herra}/ # Per-machine (hostname + hardware) +hosts/{kronos,herra,mystra}/ # Per-machine (hostname + hardware) ↓ -system/ # System-wide config - ├─ boot, audio, bluetooth, networking, graphics - ├─ packages, programs, services, users, nix - ├─ desktop.nix # X11 + i3wm - └─ stylix.nix # Theming +system/ # System-wide config (base only) + └─ boot, audio, bluetooth, networking, graphics + packages, programs, services, users, nix ↓ -home/mun/ # User config - ├─ programs/ # git, ssh, zsh - └─ (imports active rice) +home/rices/{rice}/system.nix # Rice-level system config + └─ desktop.nix (X11 + i3wm) # Desktop environment + stylix.nix (theming) # Colors, fonts, cursor ↓ -home/rices/{nord-blue,original}/ # Desktop themes +home/mun/ # User config + ├─ programs/ # git, ssh, zsh + └─ (imports rice via specialArgs) + ↓ +home/rices/{rice}/default.nix # Rice home-manager modules + └─ alacritty, i3, nvim, helix, picom, etc. ``` ## Key Files -- `flake.nix` - Defines inputs (nixpkgs, nixpkgs-unstable, home-manager, stylix, fenix, crane, nixowos) and outputs -- `hosts/kronos/configuration.nix` - Laptop-specific config (minimal: just hostname) -- `hosts/herra/configuration.nix` - Desktop config (dual-boot with Windows 11, uses GRUB OS prober) -- `system/default.nix` - System module orchestrator +- `flake.nix` - Entry point: defines inputs and outputs, assigns rices to hosts in `nixosConfigurations` (e.g., `kronos = mkSystem "kronos" "nord-blue"`) +- `hosts/*/configuration.nix` - Per-machine config (hostname, hardware imports, machine-specific overrides) +- `hosts/herra/configuration.nix` - Desktop: dual-boot with Windows 11 (GRUB OS prober), Zen kernel override +- `system/default.nix` - System module orchestrator (imports base system modules only, no desktop/stylix) - `system/packages.nix` - System-wide packages -- `home/mun/default.nix` - User orchestrator (imports active rice, user packages, programs) -- `home/rices/nord-blue/variables.nix` - Active rice color definitions -- `home/rices/nord-blue/default.nix` - Active rice module orchestrator +- `home/mun/default.nix` - User orchestrator: imports user programs and rice via `${rice}` specialArg +- `home/rices/*/system.nix` - Rice-level system config (desktop environment + stylix theming) +- `home/rices/*/default.nix` - Rice home-manager modules orchestrator +- `home/rices/*/variables.nix` - Rice color definitions (optional, some rices use system.nix for colors) ## Adding Configurations @@ -73,24 +78,32 @@ home/rices/{nord-blue,original}/ # Desktop themes **New user program:** Create in `home/mun/programs/`, add to `home/mun/default.nix` imports -**New rice module:** Create in active rice directory (`home/rices/nord-blue/`), add to its `default.nix` imports +**New rice module:** Create in target rice directory (e.g., `home/rices/nord-blue/mymodule.nix`), add to that rice's `default.nix` imports -**New rice:** Create `home/rices/my-rice/` with `default.nix` (imports modules) and `variables.nix` (colors, wallpaper) +**New rice:** +1. Create `home/rices/my-rice/` directory +2. Create `system.nix` with desktop environment and stylix config +3. Create `default.nix` (imports home-manager modules) +4. Create app-specific configs (i3.nix, terminal.nix, etc.) +5. Optional: create `variables.nix` for shared color variables ## Switching Rices -Edit `home/mun/default.nix` to change the rice import: +Rices are assigned per-host in `flake.nix`. Edit the `nixosConfigurations` section: + ```nix -imports = [ - ./programs/zsh.nix - ./programs/ssh.nix - ./programs/git.nix - ../rices/nord-blue # Current: alacritty, i3, nvim, helix, picom, fastfetch - # ../rices/original # Alternative: kitty, i3, polybar, rofi, dunst, neovim, nnn, picom -]; +nixosConfigurations = { + kronos = mkSystem "kronos" "nord-blue"; # Laptop uses nord-blue + herra = mkSystem "herra" "cosmic"; # Desktop uses cosmic + mystra = mkSystem "mystra" "nord-blue"; # Another machine uses nord-blue +}; ``` -Then: `sudo nixos-rebuild switch` +Then rebuild: `sudo nixos-rebuild switch` + +Each rice is imported twice: +1. **System-level**: `home/rices/${rice}/system.nix` imported in flake (desktop + stylix) +2. **Home-level**: `home/rices/${rice}` imported in `home/mun/default.nix` via specialArgs (app configs) ## Important Architecture Details @@ -98,8 +111,22 @@ Then: `sudo nixos-rebuild switch` **NixOwOs Integration:** Enabled in `home/mun/default.nix` for NixOS branding/theming (os-release customization, overlays) -**Machine Separation:** Host configs are intentionally minimal (hostname + hardware). All shared system config lives in `system/`, all shared user config in `home/mun/` +**Machine Separation:** Host configs are intentionally minimal (hostname + hardware-configuration import + optional overrides). All shared system config lives in `system/`, all shared user config in `home/mun/` + +**Rice Architecture:** Rices span both system and home-manager: +- `system.nix` in each rice configures desktop environment (X11 + i3wm) and stylix theming +- `default.nix` in each rice imports home-manager modules (terminal, editor, compositor, etc.) +- System-level desktop/stylix was moved from `system/` to per-rice to allow different DEs per rice + +**Stylix:** System-level theming framework imported at flake level, configured in each rice's `system.nix` (base16 colors, fonts, cursor, opacity, wallpaper) -**Rice Philosophy:** Rices are purely home-manager level. Desktop environment (X11 + i3wm base) is defined in `system/desktop.nix`, rices only configure appearance/theming +**mkSystem Helper:** The `mkSystem` function in flake.nix takes (hostname, rice) and: +1. Imports host config from `hosts/${hostname}/configuration.nix` +2. Imports base system modules from `system/` +3. Imports rice system config from `home/rices/${rice}/system.nix` +4. Passes rice name to home-manager via specialArgs for user-level rice import -**Stylix:** System-level theming framework imported at flake level, configured in `system/stylix.nix` +**Available Rices:** +- `nord-blue` - Complete: alacritty, i3, nvim, helix, picom, fastfetch +- `original` - Complete: kitty, i3, polybar, rofi, dunst, neovim, nnn, picom +- `cosmic` - Minimal/incomplete: only fluxbox.nix (work in progress) |
