Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 0 additions & 42 deletions .serena/memories/code_style_and_conventions.md

This file was deleted.

34 changes: 18 additions & 16 deletions .serena/memories/core.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,24 @@ nix-darwin system configuration flake for macOS (aarch64-darwin). Manages two ma
- `maclop` — personal laptop, username: `derangga`
- `worklop` — work laptop, username: `sociolla`

Both hosts currently set `terminal = "ghostty"` in `flake.nix`.

## Entry Points
- `flake.nix` — defines `darwinConfigurations` for both hosts via `mkDarwinConfig`
- `darwin/configuration.nix` — system-level packages, fonts, defaults
- `home/home.nix` — home-manager entry, imports `modules/default.nix`
- `modules/default.nix` — root home-manager module, imports all sub-modules + `hosts/${hostname}.nix`
- `flake.nix` — defines `darwinConfigurations` for both hosts via `mkDarwinConfig { hostname, username, terminal }`
- `darwin/configuration.nix` — system-level packages, fonts, defaults; imports `darwin/homebrew` + `darwin/terminal.nix`
- `modules/default.nix` — home-manager entry point (imported directly via `home-manager.users.${username} = import ./modules;` in `flake.nix`, no separate `home/home.nix`)

## Key Module Directories
- `modules/aerospace/` — window manager
- `modules/catppuccin/` — theme (flavor: macchiato)
- `modules/git/` — git config (hostname-conditional user.name)
- `modules/llm-agents/` — AI tools (claude-code, opencode, beads, rtk, serena) via flake inputs
- `modules/nixvim/` — Neovim via nixvim flake (plugins, keymaps, autocmds, options)
- `modules/presenterm/` — presentation tool + mermaid-cli
- `modules/sketchybar/` — menu bar, Lua-based config
- `modules/starship/` — shell prompt (nosymbol + powerline variants)
- `modules/terminal/` — Ghostty + Kitty terminal configs, GLSL shaders
- `modules/hosts/` — host-specific home-manager config
## Key Module Directories (modules/)
- `aerospace/` — window manager
- `catppuccin/` — theme (flavor: macchiato), one `catppuccin.<app>.enable` line per themed program
- `ghost/` — Ghostty face shader driven by herdr AI state (background in the separate Claude auto-memory system's `ghost-in-the-machine` note, not a Serena memory)
- `git/` — git config (hostname-conditional user.name)
- `llm-agents/` — AI tools (claude-code, opencode, beads, beads-viewer, gitnexus, herdr, hunk, rtk, serena, fff-mcp) via flake inputs
- `nixvim/` — Neovim via nixvim flake (plugins/, docs/, autocmds.nix, keymaps.nix, options.nix) — NOT LazyVim
- `presenterm/` — presentation tool + mermaid-cli
- `sketchybar/` — menu bar, Lua-based config (imported as `./sketchybar/config.nix`)
- `starship/` — shell prompt: `no-version.nix` (active, imported in modules/default.nix) + `powerline.nix` (alternate, unused)
- `terminal/` — Ghostty + Kitty terminal configs (`ghostty.nix`, `kitty.nix`, `options.nix`, `shaders/`), selected via the `terminal` specialArg
- `hosts/` — host-specific home-manager config (`maclop.nix`, `worklop.nix`), imported as `./hosts/${hostname}.nix`

See `mem:tech_stack` for flake inputs. See `mem:conventions` for code style. See `mem:suggested_commands` for CLI usage. See `mem:task_completion` for task checklist.
See `mem:tech_stack` for flake inputs and packages. See `mem:conventions` for code style. See `mem:suggested_commands` for CLI usage. See `mem:task_completion` for task checklist.
19 changes: 0 additions & 19 deletions .serena/memories/project_overview.md

This file was deleted.

43 changes: 23 additions & 20 deletions .serena/memories/project_structure.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
nix/
├── flake.nix # Entry point; defines maclop + worklop darwinConfigurations
├── flake.lock
├── home/home.nix # home-manager entry; imports modules/default.nix
├── README.md # User-facing docs (app table, usage, config steps)
├── darwin/
│ ├── configuration.nix # System-level config (packages, fonts, defaults)
│ ├── terminal.nix # Terminal-related system config
Expand All @@ -15,30 +15,33 @@ nix/
│ └── worklop.nix # Work machine Homebrew casks/formulae
└── modules/
├── default.nix # Root home-manager module; imports all sub-modules + host config
├── aerospace/config.nix # Aerospace window manager
├── catppuccin/config.nix # Catppuccin theme settings
├── git/config.nix # Git config (per-hostname user.name)
├── neovim/config.nix # Neovim (LazyVim-based)
│ └── lazyvim/ # LazyVim Lua config (plugins, keymaps, etc.)
├── presenterm/config.nix # Presenterm + mermaid-cli; config.yaml + puppeteer.json
├── sketchybar/config.nix # Sketchybar menu bar (Lua-based config)
│ └── lua/ # Full Lua sketchybar config (items, widgets, helpers)
├── aerospace/ # Aerospace window manager
├── catppuccin/default.nix # Catppuccin theme settings (per-app enable flags)
├── ghost/ # Ghostty face shader driven by herdr AI state; script/ (Go) + .glsl shader
├── git/ # Git config (per-hostname user.name)
├── llm-agents/default.nix # Claude Code, OpenCode, Beads, RTK, Serena, herdr, hunk, fff-mcp
├── nixvim/ # Neovim via nixvim flake (NOT LazyVim)
│ ├── plugins/ # Plugin configurations (completion, lsp, ui, etc.)
│ └── docs/ # Neovim docs
├── presenterm/ # Presenterm + mermaid-cli; config.yaml + puppeteer.json
├── sketchybar/ # Sketchybar menu bar (Lua-based config), config.nix + lua/
├── starship/
│ ├── nosymbol.nix # Starship prompt (no-symbol variant)
│ └── powerline.nix # Starship prompt (powerline variant)
│ ├── no-version.nix # Starship prompt (active variant, imported in modules/default.nix)
│ └── powerline.nix # Starship prompt (alternate variant, unused)
├── terminal/
│ ├── default.nix # Terminal module entry
│ ├── ghostty.nix # Ghostty terminal config
│ ├── kitty.nix # Kitty terminal config
│ ├── options.nix # Terminal options/selector
│ └── shaders/ # GLSL shaders for terminal eye candy
│ ├── default.nix # Terminal module entry
│ ├── ghostty.nix # Ghostty terminal config
│ ├── kitty.nix # Kitty terminal config
│ ├── options.nix # Terminal options/selector (driven by `terminal` specialArg)
│ └── shaders/ # GLSL shaders for terminal eye candy
└── hosts/
├── maclop.nix # Personal: flutter, cocoapods, vscode, OBS catppuccin
└── worklop.nix # Work: pm2
├── maclop.nix # Personal host overrides
└── worklop.nix # Work host overrides
```

## modules/default.nix Programs (shared across hosts)
bat, btop, claude-code, eza, fzf, gh, gh-dash, lazygit, opencode, tmux, yazi, zed-editor, zoxide, zsh (Oh-My-Zsh)
atuin, bat, btop, eza, gh, gh-dash, lazygit, tmux, vscode, yazi, zoxide, zsh (Oh-My-Zsh)
Plus imports: aerospace, catppuccin, ghost, git, llm-agents, terminal, nixvim, presenterm, starship/no-version.nix, sketchybar/config.nix, hosts/${hostname}.nix

## System Packages (darwin/configuration.nix)
bun, cargo, fnm, ffmpeg, gnupg, go, mkalias, nixd, pnpm, rustc, rust-analyzer, tree, uv
ffmpeg, gnupg, mkalias, tree
49 changes: 0 additions & 49 deletions .serena/memories/style_and_conventions.md

This file was deleted.

15 changes: 0 additions & 15 deletions .serena/memories/task_completion_checklist.md

This file was deleted.

21 changes: 12 additions & 9 deletions .serena/memories/tech_stack.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,26 @@
## Flake Inputs
- `nixpkgs` → `nixpkgs-unstable`
- `nix-darwin` → master branch
- `nix-homebrew` — Homebrew integration
- `home-manager` (follows nixpkgs)
- `catppuccin/nix` (follows nixpkgs)
- `nix-homebrew` — Homebrew integration
- `nixvim` — Neovim configured entirely in Nix
- `fff-nvim` — Neovim plugin (custom flake input)
- `llm-agents` → `github:numtide/llm-agents.nix` — provides claude-code, opencode, beads, rtk
- `serena` → `git+https://github.com/oraios/serena` — MCP server for semantic code tools
- `nixvim` — Neovim configured entirely in Nix (follows nixpkgs)
- `fff-nvim` — `github:dmtrKovalenko/fff.nvim`, only its `fff-mcp` package is used (follows nixpkgs)
- `llm-agents` → `github:numtide/llm-agents.nix` (follows nixpkgs)
- `serena` → `git+https://github.com/oraios/serena` (follows nixpkgs)

## System Packages (darwin/configuration.nix)
bun, cargo, fnm, ffmpeg, gnupg, go, mkalias, nixd, pnpm, rustc, rust-analyzer, tree, uv
ffmpeg, gnupg, mkalias, tree
(bun, cargo, fnm, go, orbstack, rust-analyzer, rustc live in `modules/default.nix` `home.packages`, not here)

## Home-manager Programs (modules/default.nix, shared)
bat, btop, eza, fzf, gh, gh-dash, lazygit, tmux, yazi, zed-editor (package=null), zoxide, zsh (Oh-My-Zsh)
atuin (replaced fzf — shell history/Ctrl-R search), bat, btop, eza, gh, gh-dash, lazygit, tmux, vscode, yazi, zoxide, zsh (Oh-My-Zsh, `git` plugin only)
Plus `services.jankyborders` (window border styling).

## AI/LLM Tools (modules/llm-agents/default.nix)
Sourced from `llm-agents.packages.${system}` and `serena.packages.${system}`:
claude-code, opencode, beads, rtk, serena
`home.packages` sourced from `llm-agents.packages.${system}` and `serena.packages.${system}`, plus `fff-nvim.packages.${system}.fff-mcp`:
fff-mcp, beads, beads-viewer, claude-code, gitnexus, herdr, hunk, opencode, rtk, serena
Also writes `xdg.configFile` for `herdr/config.toml` and `hunk/config.toml`, and two `home.activation` scripts that patch `~/.claude.json` (fff MCP entry) and append the fff-usage line to `~/.claude/CLAUDE.md`.

## Target Platform
`aarch64-darwin` (Apple Silicon Macs)
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ All the following applications are managed via home-manager and will be configur
### Shell & Terminal
| Application | Description |
|---|---|
| Zsh + Oh My Zsh | Shell with git and fzf plugins |
| Zsh + Oh My Zsh | Shell with git plugin; Atuin powers history search (Ctrl-R) |
| Starship | Cross-shell prompt |
| Kitty | GPU-accelerated terminal |
| Ghostty | Fast terminal emulator |
Expand Down Expand Up @@ -78,10 +78,10 @@ Sourced from [numtide/llm-agents.nix](https://github.com/numtide/llm-agents.nix)
### CLI Utilities
| Application | Description |
|---|---|
| atuin | Shell history search (SQLite-backed, Ctrl-R) |
| bat | `cat` clone with syntax highlighting |
| btop | Resource monitor |
| eza | Modern `ls` replacement |
| fzf | Fuzzy finder |
| yazi | Terminal file manager |
| zoxide | Smarter `cd` with frecency-based navigation |
| gh | GitHub CLI |
Expand Down
1 change: 1 addition & 0 deletions modules/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

./aerospace
./catppuccin
./ghost
./git
./llm-agents
./terminal
Expand Down
15 changes: 15 additions & 0 deletions modules/ghost/NOTICE
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
ghost-in-the-machine.glsl in this directory is vendored, unmodified, from
pi-ghost-in-the-machine by Iury Souza:
https://github.com/iurysza/pi-ghost-in-the-machine

That shader is itself derived from claude-terminal-face by isoden:
https://github.com/isoden/claude-terminal-face

Both original works are distributed under the MIT License, as is this
derivative. The FORCED_STATE and sidebar-placement constants are substituted at
build time by ../ghost/default.nix rather than edited in place, so the vendored
file matches upstream byte for byte.

Everything else here is new: herdr socket subscription in place of both the Pi
extension and the polling sidebar watcher, herdr's own agent_status as the
state source in place of agent-side hooks, and Nix packaging.
79 changes: 79 additions & 0 deletions modules/ghost/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
{
config,
lib,
pkgs,
terminal,
...
}:
lib.mkIf (terminal == "ghostty") (
let
stateDir = "${config.home.homeDirectory}/.local/state/ghost-in-the-machine";

# Face placement. The shader centres the face inside herdr's sidebar, so
# sidebarCols must match herdr's own sidebar_width (see session.json) or the
# face drifts out over terminal text. cellWidth is upstream's value for
# their font; retune by eye with `ghost-watch idle`.
sidebarCols = 26;
cellWidth = 16;

variants = pkgs.runCommand "ghost-variants" { } ''
mkdir -p "$out"
for pair in idle:0 thinking:1 working:2 done:3 error:4; do
name="''${pair%%:*}"
forced="''${pair##*:}"
${pkgs.gawk}/bin/awk \
-v forced="$forced" \
-v cols="${toString sidebarCols}" \
-v cell="${toString cellWidth}" '
$0 == "const int FORCED_STATE = -1;" {
print "const int FORCED_STATE = " forced ";"; next
}
/^const float SIDEBAR_COLS/ {
print "const float SIDEBAR_COLS = " cols ".0;"; next
}
/^const float SIDEBAR_CELL_WIDTH/ {
print "const float SIDEBAR_CELL_WIDTH = " cell ".0;"; next
}
{ print }
' ${./ghost-in-the-machine.glsl} > "$out/$name.glsl"
done
grep -q "FORCED_STATE = 2;" "$out/working.glsl" || {
echo "substitution missed FORCED_STATE; upstream shader changed" >&2
exit 1
}
'';

# Stdlib only, hence vendorHash = null -- no vendor dir, no network fetch.
ghostWatch = pkgs.buildGoModule {
pname = "ghost-watch";
version = "0";
src = ./script;
vendorHash = null;
# There are no go tests; the self-check is the check, and it is hermetic.
doCheck = false;
postInstall = "$out/bin/ghost-watch --selfcheck";
};
in
{
home.packages = [ ghostWatch ];

home.activation.ghostStateDir = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
$DRY_RUN_CMD mkdir -p ${lib.escapeShellArg stateDir}
'';

launchd.agents.ghost-in-the-machine = {
enable = true;
config = {
ProgramArguments = [ "${ghostWatch}/bin/ghost-watch" ];
EnvironmentVariables = {
GHOST_VARIANTS = "${variants}";
GHOST_FRAGMENT = "${stateDir}/ghostty.conf";
};
KeepAlive = true;
RunAtLoad = true;
ProcessType = "Background";
StandardErrorPath = "${stateDir}/watch.log";
};
};
}
)
Loading
Loading