Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 32b64b7f56 |
@@ -1,48 +0,0 @@
|
||||
# caveman
|
||||
|
||||
Talk like smart caveman. Same brain, fewer tokens.
|
||||
|
||||
## What it does
|
||||
|
||||
Compress every model response to caveman-style prose. Drops articles, filler, pleasantries, and hedging. Keeps every technical detail, code block, error string, and symbol exact. Cuts 65% of output tokens (measured) with full accuracy preserved. Mode persists for the whole session until changed or stopped.
|
||||
|
||||
Six intensity levels:
|
||||
|
||||
| Level | What change |
|
||||
|-------|-------------|
|
||||
| `lite` | Drop filler/hedging. Sentences stay full. Professional but tight. |
|
||||
| `full` | Default. Drop articles, fragments OK, short synonyms. |
|
||||
| `ultra` | Bare fragments. Abbreviations (DB, auth, fn). Arrows for causality. |
|
||||
| `wenyan-lite` | Classical Chinese register, light compression. |
|
||||
| `wenyan-full` | Maximum 文言文. 80-90% character reduction. |
|
||||
| `wenyan-ultra` | Extreme classical compression. |
|
||||
|
||||
Auto-clarity rule: caveman drops to normal prose for security warnings, irreversible-action confirmations, multi-step sequences where fragment ambiguity risks misread, and when user repeats a question. Resumes after the clear part.
|
||||
|
||||
## How to invoke
|
||||
|
||||
```
|
||||
/caveman # full mode (default)
|
||||
/caveman lite # lighter compression
|
||||
/caveman ultra # extreme compression
|
||||
/caveman wenyan # classical Chinese
|
||||
stop caveman # back to normal prose
|
||||
```
|
||||
|
||||
## Example output
|
||||
|
||||
Question: "Why does my React component re-render?"
|
||||
|
||||
Normal prose:
|
||||
> Your component re-renders because you create a new object reference each render. Wrapping it in `useMemo` will fix the issue.
|
||||
|
||||
Caveman (full):
|
||||
> New object ref each render. Inline object prop = new ref = re-render. Wrap in `useMemo`.
|
||||
|
||||
Caveman (ultra):
|
||||
> Inline obj prop → new ref → re-render. `useMemo`.
|
||||
|
||||
## See also
|
||||
|
||||
- [`SKILL.md`](./SKILL.md) — full LLM-facing instructions
|
||||
- [Caveman README](../../README.md) — repo overview, install, benchmarks
|
||||
@@ -1,88 +0,0 @@
|
||||
---
|
||||
name: caveman
|
||||
description: >
|
||||
Ultra-compressed communication mode. Cuts output tokens 65% (measured) by speaking like caveman
|
||||
while keeping full technical accuracy. Supports intensity levels: lite, full (default), ultra,
|
||||
wenyan-lite, wenyan-full, wenyan-ultra.
|
||||
Use when user says "caveman mode", "talk like caveman", "use caveman", "less tokens",
|
||||
"be brief", or invokes /caveman. Also auto-triggers when token efficiency is requested.
|
||||
---
|
||||
|
||||
Respond terse like smart caveman. All technical substance stay. Only fluff die.
|
||||
|
||||
## Persistence
|
||||
|
||||
ACTIVE EVERY RESPONSE. No revert after many turns. No filler drift. Still active if unsure. Off only: "stop caveman" / "normal mode".
|
||||
|
||||
Default: **full**. Switch: `/caveman lite|full|ultra|wenyan-lite|wenyan-full|wenyan-ultra|off`.
|
||||
|
||||
## Rules
|
||||
|
||||
Drop: articles (a/an/the), filler (just/really/basically/actually/simply), pleasantries (sure/certainly/of course/happy to), hedging. Fragments OK. Short synonyms (big not extensive, fix not "implement a solution for"). No tool-call narration, no decorative tables/emoji, no dumping long raw error logs unless asked — quote shortest decisive line. Standard well-known tech acronyms OK (DB/API/HTTP); never invent new abbreviations (cfg/impl/req/res/fn) — tokenizer split them same as full word: zero token saved, reader still decode. Full word cheaper AND clearer. No causal arrows (→) either — own token, save nothing. Technical terms exact. Code blocks unchanged. Errors quoted exact.
|
||||
|
||||
Never drop not/never/no/only/except — flip meaning worse than any token saved. Numbers, units exact.
|
||||
|
||||
Tool calls: fire direct. No preamble, plan, or progress note before or between calls. After result: next call direct or final answer — never announce next call. Text before call only to clarify, warn security/irreversible, or resolve ambiguity.
|
||||
|
||||
Preserve user's dominant language exactly — reply in the language user writes, never switch regardless of example text or multilingual context elsewhere. Compress the style, not the language. Every emitted line in that language — openings, pre-tool status lines, all — not just final reply. ALWAYS keep technical terms, code, API names, CLI commands, commit-type keywords (feat/fix/...), and exact error strings verbatim — unless user explicitly ask for translation.
|
||||
|
||||
'Drop articles' = article languages only. Where small markers carry case/role (particles, postpositions), keep them — grammar, not filler; compress politeness/filler instead.
|
||||
|
||||
No self-reference. Never name or announce the style. No "caveman mode on", "me caveman think", no third-person caveman tags. Output caveman-only — never normal answer plus "Caveman:" recap. Exception: user explicitly ask what the mode is.
|
||||
|
||||
Pattern: `[thing] [action] [reason]. [next step].`
|
||||
|
||||
Not: "Sure! I'd be happy to help you with that. The issue you're experiencing is likely caused by..."
|
||||
Yes: "Bug in auth middleware. Token expiry check use `<` not `<=`. Fix:"
|
||||
|
||||
## Intensity
|
||||
|
||||
| Level | What change |
|
||||
|-------|------------|
|
||||
| **lite** | No filler/hedging. Keep articles + full sentences. Professional but tight |
|
||||
| **full** | Drop articles, fragments OK, short synonyms. Classic caveman. No tool-call narration, no decorative tables/emoji, no long raw error-log dumps unless asked. Standard acronyms OK; no invented abbreviations |
|
||||
| **ultra** | Strip conjunctions when cause-then-effect stay unambiguous. One word when one word enough. State each fact once. NO prose abbreviations (cfg/impl/req/res/fn/auth), NO arrows (X → Y) — measured zero token saving under tokenizer, cost decode clarity. Code symbols, function names, API names, error strings: never touch |
|
||||
| **wenyan-lite** | Semi-classical. Drop filler/hedging but keep grammar structure, classical register |
|
||||
| **wenyan-full** | Maximum classical terseness. Fully 文言文. 80-90% character reduction — chars, not tokens. Classical sentence patterns, verbs precede objects, subjects often omitted, classical particles (之/乃/為/其) |
|
||||
| **wenyan-ultra** | Extreme abbreviation while keeping classical Chinese feel. Maximum compression, ultra terse |
|
||||
|
||||
Example — "Why React component re-render?"
|
||||
- lite: "Your component re-renders because you create a new object reference each render. Wrap it in `useMemo`."
|
||||
- full: "New object ref each render. Inline object prop = new ref = re-render. Wrap in `useMemo`."
|
||||
- ultra: "Inline obj prop, new ref, re-render. `useMemo`."
|
||||
- wenyan-lite: "組件頻重繪,以每繪新生對象參照故。以 useMemo 包之。"
|
||||
- wenyan-full: "每繪新生對象參照,故重繪;以 useMemo 包之則免。"
|
||||
- wenyan-ultra: "新參照則重繪。useMemo 包之。"
|
||||
|
||||
Example — "Explain database connection pooling."
|
||||
- lite: "Connection pooling reuses open connections instead of creating new ones per request. Avoids repeated handshake overhead."
|
||||
- full: "Pool reuse open DB connections. No new connection per request. Skip handshake overhead."
|
||||
- ultra: "Pool reuse open DB connections. No per-request handshake."
|
||||
- wenyan-full: "池蓄已開之連,不逐請而新開,省握手之費。"
|
||||
- wenyan-ultra: "池蓄連,免逐請新開,省握手。"
|
||||
|
||||
Classical chars = wenyan modes only. Never swap a word to a classical char to shrink at non-wenyan levels.
|
||||
|
||||
## Auto-Clarity
|
||||
|
||||
Drop caveman when:
|
||||
- Security warnings
|
||||
- Irreversible action confirmations
|
||||
- Multi-step sequences where fragment order or omitted conjunctions risk misread
|
||||
- Compression itself creates technical ambiguity (e.g., `"migrate table drop column backup first"` — order unclear without articles/conjunctions)
|
||||
- User asks to clarify or repeats question
|
||||
|
||||
Resume caveman after clear part done.
|
||||
|
||||
Example shows FORMAT only — write warning in session language, not example's.
|
||||
|
||||
Example — destructive op:
|
||||
> **Warning:** This will permanently delete all rows in the `users` table and cannot be undone.
|
||||
> ```sql
|
||||
> DROP TABLE users;
|
||||
> ```
|
||||
> Caveman resume. Verify backup exist first.
|
||||
|
||||
## Boundaries
|
||||
|
||||
Persisted outside chat: write normal prose — code, comments, commits, docs, issue/PR/MR text, memory files, third-party messages (/caveman-compress exempt). "stop caveman" or "normal mode": revert. Level persist until changed or session end.
|
||||
@@ -1,67 +0,0 @@
|
||||
---
|
||||
name: karpathy-guidelines
|
||||
description: Behavioral guidelines to reduce common LLM coding mistakes. Use when writing, reviewing, or refactoring code to avoid overcomplication, make surgical changes, surface assumptions, and define verifiable success criteria.
|
||||
license: MIT
|
||||
---
|
||||
|
||||
# Karpathy Guidelines
|
||||
|
||||
Behavioral guidelines to reduce common LLM coding mistakes, derived from [Andrej Karpathy's observations](https://x.com/karpathy/status/2015883857489522876) on LLM coding pitfalls.
|
||||
|
||||
**Tradeoff:** These guidelines bias toward caution over speed. For trivial tasks, use judgment.
|
||||
|
||||
## 1. Think Before Coding
|
||||
|
||||
**Don't assume. Don't hide confusion. Surface tradeoffs.**
|
||||
|
||||
Before implementing:
|
||||
- State your assumptions explicitly. If uncertain, ask.
|
||||
- If multiple interpretations exist, present them - don't pick silently.
|
||||
- If a simpler approach exists, say so. Push back when warranted.
|
||||
- If something is unclear, stop. Name what's confusing. Ask.
|
||||
|
||||
## 2. Simplicity First
|
||||
|
||||
**Minimum code that solves the problem. Nothing speculative.**
|
||||
|
||||
- No features beyond what was asked.
|
||||
- No abstractions for single-use code.
|
||||
- No "flexibility" or "configurability" that wasn't requested.
|
||||
- No error handling for impossible scenarios.
|
||||
- If you write 200 lines and it could be 50, rewrite it.
|
||||
|
||||
Ask yourself: "Would a senior engineer say this is overcomplicated?" If yes, simplify.
|
||||
|
||||
## 3. Surgical Changes
|
||||
|
||||
**Touch only what you must. Clean up only your own mess.**
|
||||
|
||||
When editing existing code:
|
||||
- Don't "improve" adjacent code, comments, or formatting.
|
||||
- Don't refactor things that aren't broken.
|
||||
- Match existing style, even if you'd do it differently.
|
||||
- If you notice unrelated dead code, mention it - don't delete it.
|
||||
|
||||
When your changes create orphans:
|
||||
- Remove imports/variables/functions that YOUR changes made unused.
|
||||
- Don't remove pre-existing dead code unless asked.
|
||||
|
||||
The test: Every changed line should trace directly to the user's request.
|
||||
|
||||
## 4. Goal-Driven Execution
|
||||
|
||||
**Define success criteria. Loop until verified.**
|
||||
|
||||
Transform tasks into verifiable goals:
|
||||
- "Add validation" → "Write tests for invalid inputs, then make them pass"
|
||||
- "Fix the bug" → "Write a test that reproduces it, then make it pass"
|
||||
- "Refactor X" → "Ensure tests pass before and after"
|
||||
|
||||
For multi-step tasks, state a brief plan:
|
||||
```
|
||||
1. [Step] → verify: [check]
|
||||
2. [Step] → verify: [check]
|
||||
3. [Step] → verify: [check]
|
||||
```
|
||||
|
||||
Strong success criteria let you loop independently. Weak criteria ("make it work") require constant clarification.
|
||||
@@ -1,88 +0,0 @@
|
||||
# Database (local only, not git)
|
||||
# br migrated the bd dolt database to a local SQLite file that kept the name "dolt"
|
||||
dolt*
|
||||
embeddeddolt/
|
||||
|
||||
# br (beads_rust) runtime artifacts
|
||||
.br_recovery/
|
||||
.br_history/
|
||||
.br-wal-index-*/
|
||||
|
||||
# br merge artifacts (temporary files from 3-way merge)
|
||||
beads.base.jsonl
|
||||
beads.base.meta.json
|
||||
beads.left.jsonl
|
||||
beads.left.meta.json
|
||||
beads.right.jsonl
|
||||
beads.right.meta.json
|
||||
sync_base.jsonl
|
||||
|
||||
# Runtime files
|
||||
bd.sock
|
||||
bd.sock.startlock
|
||||
sync-state.json
|
||||
last-touched
|
||||
.exclusive-lock
|
||||
|
||||
# Daemon runtime (lock, log, pid)
|
||||
daemon.*
|
||||
|
||||
# Interactions log (runtime, not versioned)
|
||||
interactions.jsonl
|
||||
|
||||
# Push state (runtime, per-machine)
|
||||
push-state.json
|
||||
|
||||
# Lock files (various runtime locks)
|
||||
*.lock
|
||||
|
||||
# Credential key (encryption key for federation peer auth — never commit)
|
||||
.beads-credential-key
|
||||
|
||||
# Local version tracking (prevents upgrade notification spam after git ops)
|
||||
.local_version
|
||||
|
||||
# Worktree redirect file (contains relative path to main repo's .beads/)
|
||||
# Must not be committed as paths would be wrong in other clones
|
||||
redirect
|
||||
|
||||
# Sync state (local-only, per-machine)
|
||||
# These files are machine-specific and should not be shared across clones
|
||||
.sync.lock
|
||||
export-state/
|
||||
export-state.json
|
||||
|
||||
# Ephemeral store (SQLite - wisps/molecules, intentionally not versioned)
|
||||
ephemeral.sqlite3
|
||||
ephemeral.sqlite3-journal
|
||||
ephemeral.sqlite3-wal
|
||||
ephemeral.sqlite3-shm
|
||||
|
||||
# Dolt server management (auto-started by bd)
|
||||
dolt-server.pid
|
||||
dolt-server.log
|
||||
dolt-server.lock
|
||||
dolt-server.port
|
||||
dolt-server.activity
|
||||
|
||||
# Corrupt backup directories (created by bd doctor --fix recovery)
|
||||
*.corrupt.backup/
|
||||
|
||||
# Backup data (auto-exported JSONL, local-only)
|
||||
backup/
|
||||
|
||||
# Per-project environment file (Dolt connection config, GH#2520)
|
||||
.env
|
||||
|
||||
# Legacy files (from pre-Dolt versions)
|
||||
*.db
|
||||
*.db?*
|
||||
*.db-journal
|
||||
*.db-wal
|
||||
*.db-shm
|
||||
db.sqlite
|
||||
bd.db
|
||||
# NOTE: Do NOT add negation patterns here.
|
||||
# They would override fork protection in .git/info/exclude.
|
||||
# Config files (metadata.json, config.yaml) are tracked by git by default
|
||||
# since no pattern above ignores them.
|
||||
@@ -1,29 +0,0 @@
|
||||
# Beads - AI-Native Issue Tracking
|
||||
|
||||
This repository uses [beads_rust](https://github.com/Dicklesworthstone/beads_rust) (`br`) for issue tracking. Issues live next to the code in `.beads/`, so no web UI is needed.
|
||||
|
||||
## Where the state lives
|
||||
|
||||
- `.beads/issues.jsonl` — the versioned source of truth. It is committed to git, so issue state travels with `git push`.
|
||||
- `.beads/dolt` — the local SQLite database used by `br` (runtime only, not versioned).
|
||||
- `.beads/config.yaml` — project settings.
|
||||
|
||||
`br` never runs git commands. After `br sync --flush-only` you must run `git add .beads/ && git commit` yourself.
|
||||
|
||||
## Essential commands
|
||||
|
||||
```bash
|
||||
br robot-docs guide # session context and command reference (run first)
|
||||
br ready # unblocked, non-deferred issues
|
||||
br list # all issues
|
||||
br show <issue-id> # issue detail
|
||||
br create "Title" # create an issue
|
||||
br update <id> --claim # claim work before starting
|
||||
br close <id> # close an issue
|
||||
br sync --flush-only # export the database to issues.jsonl
|
||||
```
|
||||
|
||||
## Learn more
|
||||
|
||||
- **Repository**: https://github.com/Dicklesworthstone/beads_rust
|
||||
- **Agent guide**: `br robot-docs guide`
|
||||
@@ -1,8 +0,0 @@
|
||||
# Beads Project Configuration
|
||||
# issue_prefix: nix-overlay
|
||||
# default_priority: 2
|
||||
# default_type: task
|
||||
|
||||
# Remote for beads state. The JSONL export in .beads/issues.jsonl is committed
|
||||
# to git, so `git push` is what carries issue state to the shared repository.
|
||||
sync.remote: "git+ssh://git@git.millerson.name:22002/alex/millerson-overlay.nix.git"
|
||||
File diff suppressed because one or more lines are too long
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"database": "dolt",
|
||||
"jsonl_export": "issues.jsonl"
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
{
|
||||
"hooks": {
|
||||
"PreCompact": [
|
||||
{
|
||||
"hooks": [
|
||||
{
|
||||
"command": "br robot-docs guide",
|
||||
"type": "command"
|
||||
}
|
||||
],
|
||||
"matcher": ""
|
||||
}
|
||||
],
|
||||
"SessionStart": [
|
||||
{
|
||||
"hooks": [
|
||||
{
|
||||
"command": "br robot-docs guide",
|
||||
"type": "command"
|
||||
}
|
||||
],
|
||||
"matcher": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
# CodeGraph data files — local to each machine, not for committing.
|
||||
# Ignore everything in .codegraph/ except this file itself, so transient
|
||||
# files (the database, daemon.pid, sockets, logs) never show up in git.
|
||||
*
|
||||
!.gitignore
|
||||
@@ -1,20 +0,0 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
branches: [main]
|
||||
|
||||
jobs:
|
||||
check:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: cachix/install-nix-action@v27
|
||||
with:
|
||||
nix_path: nixpkgs=channel:nixos-unstable
|
||||
- name: Flake check (formatting + evaluation)
|
||||
run: nix flake check
|
||||
- name: Build all packages (best-effort, may time out)
|
||||
run: nix build .#packages || true
|
||||
-16
@@ -1,16 +0,0 @@
|
||||
.qoder
|
||||
.qwen
|
||||
.claude/
|
||||
result
|
||||
result-*
|
||||
.direnv/
|
||||
.tasks/
|
||||
|
||||
# Beads runtime files (local only, not versioned)
|
||||
.dolt/
|
||||
*.db
|
||||
.beads-credential-key
|
||||
logs/
|
||||
.beads.gate.lock
|
||||
.marmel/
|
||||
.worktrees/
|
||||
@@ -1,2 +0,0 @@
|
||||
/cache
|
||||
/project.local.yml
|
||||
@@ -1,23 +0,0 @@
|
||||
# nix-overlay — package conventions
|
||||
|
||||
## Directory pattern (every package)
|
||||
`packages/<name>/default.nix` (wrapper, receives blueprint args) + `packages/<name>/package.nix` (the derivation, `pkgs.callPackage`-style argsets).
|
||||
|
||||
Wrapper variants:
|
||||
- Plain: `{ pkgs, ... }: pkgs.callPackage ./package.nix { }`
|
||||
- Needs blueprint extras: pass `perSystem`, `inputs`, etc. through explicitly.
|
||||
- Alternate nixpkgs (freetoken): wrapper ignores `pkgs` for the derivation and calls `inputs.nixpkgs-torch211.legacyPackages.${pkgs.stdenv.hostPlatform.system}.callPackage ./package.nix { }`.
|
||||
|
||||
## Derivedivation requirements
|
||||
- Use `stdenv.mkDerivation rec { pname; version; }` or `rustPlatform.buildRustPackage` (Rust: `cargoHash`; Go/Python equivalents as needed).
|
||||
- `meta.description` required (feeds the default meta-package listing).
|
||||
- `meta.mainProgram` set for CLI-providing packages.
|
||||
- Organizational attrs via `passthru`: `category` (e.g. "AI Coding Agents"), `hideFromDocs = true` to exclude from docs listing.
|
||||
- No `with pkgs;` at top level of Nix files (scope issues).
|
||||
- No hardcoded system paths/system assumptions.
|
||||
|
||||
## Adding a package (sequence)
|
||||
mkdir → package.nix → default.nix wrapper → `git add packages/<name>/` (required for blueprint discovery) → `nix build .#<name>` → update README Available Packages table → commit (conventional-commit format).
|
||||
|
||||
## Naming
|
||||
- Package dir name = flake output attr name (kebab-case).
|
||||
@@ -1,30 +0,0 @@
|
||||
# nix-overlay — core
|
||||
|
||||
Nix flake overlay (numtide/blueprint-based) exposing extra packages for Nix/NixOS.
|
||||
Repo: `git+https://git.millerson.name/alex/millerson-overlay.nix.git`
|
||||
|
||||
## Source map
|
||||
- `flake.nix` — inputs + outputs; blueprint drives perSystem outputs; overlays/modules added manually on top.
|
||||
- `overlays/default.nix` — binary-cache-friendly: maps blueprint's pre-built `packages` under namespace `millerson-nix-overlay`.
|
||||
- `overlays/shared-nixpkgs.nix` — builds `packages/` tree against consumer's `final` via `mkPackagesFor`; shares deps, cache only hits on matching nixpkgs rev.
|
||||
- `packages/<name>/default.nix` + `package.nix` — every package follows this wrapper/derivation split. See `mem:conventions` for patterns.
|
||||
- `packages/default/` — meta-package; generates name\tdesc list from `perSystem.self`, filtering `passthru.hideFromDocs`.
|
||||
- `packages/flake-inputs/` — dummy derivation referencing all flake inputs so they get cached. `hideFromDocs = true`.
|
||||
- `treefmt.toml` — nixfmt for `*.nix`, flake.lock excluded.
|
||||
- `AGENTS.md` — agent workflow rules (beads tracking, mandatory skills, caveman comms).
|
||||
|
||||
## Project-wide invariants
|
||||
- All overlay packages live under the single attrset `millerson-nix-overlay` (not top-level attrs).
|
||||
- Blueprint discovers packages from the **git index**, not the working dir: new `packages/<name>/` must be `git add`-ed before `nix build .#<name>` sees it.
|
||||
- Three nixpkgs inputs; some packages deliberately build against non-default ones. See pins in `mem:tech_stack`.
|
||||
- Everything under `packages/` uses `pkgs.callPackage ./package.nix { }` wrapper pattern; `default.nix` receives blueprint args (pkgs, perSystem, inputs, ...).
|
||||
|
||||
## Task workflow (from AGENTS.md, enforced)
|
||||
Runnable commands (build/format/update/bd/push): `mem:suggested_commands`. Exact done-checklist: `mem:task_completion`.
|
||||
|
||||
|
||||
- ALL task tracking via `br` (beads): `br ready`, `br update <id> --claim`, `br close <id>`. NEVER TodoWrite/markdown TODOs.
|
||||
- `br robot-docs guide` before starting work; persistent knowledge goes into issue notes (`br update <id> --append-notes "..."`) instead of MEMORY.md files.
|
||||
- Session not complete until `git push` succeeds. `br` never runs git: run `br sync --flush-only`, then `git add .beads/ && git commit` before the push.
|
||||
- Commits use conventional-commit format.
|
||||
- For nixpkgs/option lookups use the `nix` skill; for flake/devShell ops the `nix-flakes` skill; comms in caveman mode.
|
||||
@@ -1,33 +0,0 @@
|
||||
# Memory Maintenance
|
||||
|
||||
## Discovery Model
|
||||
|
||||
- Core principle: progressive discovery through references, building a graph of memories.
|
||||
- Initially, agents are provided with the list of all memories (names only).
|
||||
- Agents should read `mem:core` as the top-level entry point (graph root).
|
||||
This memory should contain references to other memories covering major project domains.
|
||||
The referenced memories shall, in turn, shall contain references to even more specific memories, and so on.
|
||||
The depth of the graph shall depend on the project complexity.
|
||||
- Use topics/folders to group related memories in order to make the content structure explicit.
|
||||
Folders can mirror project structure (e.g. modules like frontend/backend) or topics like debugging, architecture, etc.
|
||||
- Memory references must use a mem: prefix inside backticks, e.g. `mem:frontend/core`.
|
||||
The surrounding text should clearly indicate when to read the memory/which content to expect.
|
||||
The text should provide more precise guidance than the memory name alone,
|
||||
i.e. avoid a reference like "frontend debugging: `mem:frontend/debugging` and instead make clear which aspects of frontend debugging are covered.
|
||||
- Memories themselves should not contain information about when to read them; this is the responsibility of the referring memory.
|
||||
|
||||
## Style
|
||||
|
||||
Dense agent notes, not prose docs. Prefer invariants, terse bullets.
|
||||
Avoid obvious context, rationale, and examples unless they prevent likely mistakes.
|
||||
Keep guidance durable and generalizable, not task-local.
|
||||
|
||||
## Add/update threshold
|
||||
|
||||
Add or update memories only with stable, non-obvious project conventions that avoid complex rediscovery in the future.
|
||||
Do not add: quick-read facts; generic language/framework knowledge; one-off task notes; volatile line-level details; behavior likely to change soon.
|
||||
|
||||
## Maintenance Actions
|
||||
|
||||
- Renaming memories: References are updated automatically if handled via Serena's memory rename tool.
|
||||
- Checking for stale memories (e.g. after deletion): Call `serena memories check` for a report.
|
||||
@@ -1,34 +0,0 @@
|
||||
# nix-overlay — commands
|
||||
|
||||
All run from repo root (`nix-overlay/`).
|
||||
|
||||
## Build / run
|
||||
- `nix build .#<package>` — build one package (must be `git add`-ed first if new; blueprint reads git index).
|
||||
- `nix run .#<package>` — run a package CLI (needs `meta.mainProgram`).
|
||||
- `nix build .#default` — build the meta-package (package listing).
|
||||
- `nix flake show` — inspect flake outputs (also index-limited).
|
||||
- `nix flake check` — full check incl. formatting.
|
||||
- `nix develop` — dev shell from blueprint.
|
||||
|
||||
## Format
|
||||
- `nix fmt` (treefmt → nixfmt on *.nix). Same as `nix flake check`'s format gate.
|
||||
|
||||
## Package updates
|
||||
- `nix-update <package>` — bump version + hashes (cargoHash etc.).
|
||||
- `nix-update <package> --version <v>` — specific version.
|
||||
- `nix-update skillsmcp --version=branch=main` — for commit-pinned pkgs; or `--commit <sha>`.
|
||||
|
||||
## Beads (mandatory task tracking)
|
||||
- `br robot-docs guide` — session context, run before any work.
|
||||
- `br ready` / `br show <id>` / `br update <id> --claim` / `br close <id>`.
|
||||
- `br update <id> --append-notes "..."` — persistent knowledge instead of MEMORY.md.
|
||||
- `br sync --flush-only` — export issue state to `.beads/issues.jsonl`; runs no git commands.
|
||||
|
||||
## Session completion push
|
||||
```
|
||||
git pull --rebase && br sync --flush-only && git add .beads/ && git commit -m "sync beads" && git push
|
||||
git status # must show "up to date with origin"
|
||||
```
|
||||
|
||||
## Serena
|
||||
- `serena memories check` — verify memory references after edits/deletes.
|
||||
@@ -1,11 +0,0 @@
|
||||
# nix-overlay — task completion
|
||||
|
||||
Done when ALL of these pass/hold:
|
||||
|
||||
1. Build passes: `nix build .#<package>` (or `nix flake check` for cross-cutting changes). Never leave a package committed that doesn't build.
|
||||
2. Formatting: `nix fmt` clean (nixfmt; `flake.lock` excluded).
|
||||
3. New package is staged (`git add packages/<name>/`) before build — blueprint index requirement.
|
||||
4. README.md Available Packages table updated if package added/changed visibly.
|
||||
5. Commit: conventional commit format (use conventional-commit / caveman-commit skill). No work left uncommitted.
|
||||
6. Beads: work claimed via `br update <id> --claim` before, `br close <id>` after.
|
||||
7. Pushed: `git pull --rebase && br sync --flush-only && git add .beads/ && git commit -m "sync beads" && git push` then `git status` shows "up to date with origin". Do not stop before push succeeds.
|
||||
@@ -1,11 +0,0 @@
|
||||
# nix-overlay — tech stack
|
||||
|
||||
- Language: Nix. Build system: Nix flake via `numtide/blueprint` (with `flake-parts`, `systems` for multi-system).
|
||||
- Formatting: `treefmt-nix` → `nixfmt` on `*.nix` (`flake.lock` excluded in `treefmt.toml`).
|
||||
- Multi-input nixpkgs setup (flake.nix) — pins matter, do not "unify" them:
|
||||
- `nixpkgs` = nixos-unstable (default; blueprint follows it).
|
||||
- `nixpkgs-latest` = nixos-unstable — needed by packages requiring newer toolchains: rustc >= 1.95 (mcp-gateway >= 3.4.0), go >= 1.26.3 (kubernetes-mcp-server >= 0.0.66).
|
||||
- `nixpkgs-torch211` = pinned rev `549bd84d6279f9852cae6225e372cc67fb91a4c1` — freetoken pins torch>=2.11,<2.12 / triton==3.6.0; nixos-unstable ships torch 2.13/triton 3.7, so freetoken builds via `inputs.nixpkgs-torch211.legacyPackages.${system}.callPackage` (see `packages/freetoken/default.nix`).
|
||||
- `bun2nix` pinned to branch `staging-2.1.0` until catalog support (bun2nix#86) lands on default branch (TODO #4001).
|
||||
- Package kinds in `packages/`: mostly Rust (rustPlatform.buildRustPackage), Go, Python/torch, Node/bun; each self-contained in its own dir.
|
||||
- `flake.lock` managed only via `nix flake update` — never hand-edited.
|
||||
@@ -1,187 +0,0 @@
|
||||
# the name by which the project can be referenced within Serena/when chatting with the LLM.
|
||||
project_name: "nix-overlay"
|
||||
|
||||
# list of language servers to start when using the LSP backend; choose from:
|
||||
# ada al angular ansible astro
|
||||
# bash bsl clojure cpp cpp_ccls
|
||||
# crystal csharp csharp_omnisharp cue dart
|
||||
# deno elixir elm erlang fortran
|
||||
# fsharp gdscript gleam go groovy
|
||||
# haskell haxe hlsl html java
|
||||
# json julia julia_fatou kotlin latex
|
||||
# lean4 lua lua_emmylua luau markdown
|
||||
# matlab msl nextflow nix ocaml
|
||||
# pascal perl php php_devsense php_phpactor
|
||||
# php_phpantom powershell python python_basedpyright python_jedi
|
||||
# python_pyrefly python_ty qml r rego
|
||||
# ruby ruby_solargraph rust scala scss
|
||||
# solidity svelte swift systemverilog terraform
|
||||
# toml typescript typescript_tsgo typescript_vts vue
|
||||
# vbnet wolfram yaml zig
|
||||
# (This list may be outdated; generated with scripts/print_language_list.py;
|
||||
# For the current list, see values of the LanguageServerId enum here:
|
||||
# https://github.com/oraios/serena/blob/main/src/solidlsp/ls_config.py)
|
||||
# For some languages, there are several alternative language servers, e.g. csharp_omnisharp, ruby_solargraph.)
|
||||
# Note:
|
||||
# - For C, use cpp
|
||||
# - For JavaScript, use typescript
|
||||
# - For Angular projects, use angular (subsumes typescript+html; requires `npm install` in the project root)
|
||||
# - For Astro projects, use astro (subsumes typescript/javascript for .astro projects; requires npm)
|
||||
# - For Svelte projects, use svelte (subsumes typescript/javascript for .svelte projects; requires npm)
|
||||
# - For Deno projects, use deno (serves the same .ts/.js files as typescript; requires the deno CLI on PATH)
|
||||
# - For SCSS / Sass / plain CSS, use scss (some-sass-language-server handles all three)
|
||||
# - For Free Pascal/Lazarus, use pascal
|
||||
# - External Python adapters may add further registered IDs; install the adapter package first
|
||||
# and then use its ID here, for example: example
|
||||
# Special requirements:
|
||||
# Some language servers require additional setup/installations.
|
||||
# See here for details: https://oraios.github.io/serena/01-about/020_programming-languages.html#language-servers
|
||||
# When using multiple language servers, the first language server that supports a given file will be used for that file.
|
||||
# The first language server is the default language and the respective language server will be used as a fallback.
|
||||
# Note that when using the JetBrains backend, language servers are not used and this list is correspondingly ignored.
|
||||
language_servers:
|
||||
- nix
|
||||
|
||||
# the encoding used by text files in the project
|
||||
# For a list of possible encodings, see https://docs.python.org/3.11/library/codecs.html#standard-encodings
|
||||
encoding: "utf-8"
|
||||
|
||||
# optional shell command to run before the language backend (LSP or JetBrains) is initialised.
|
||||
# the command runs in the project root directory and is only executed if the project is trusted
|
||||
# (see trusted_project_path_patterns in the global configuration).
|
||||
# serena waits for the command to exit: a non-zero exit code is logged as an error but does not
|
||||
# abort activation. a per-project timeout (activation_command_timeout, default 180s) is the safety
|
||||
# backstop for non-terminating commands; on expiry the process is killed and activation continues.
|
||||
# example: activation_command: "npx nx run-many -t build"
|
||||
activation_command:
|
||||
|
||||
# maximum time in seconds to wait for activation_command to complete before killing it (default 180s).
|
||||
# must be a positive number.
|
||||
activation_command_timeout: 180.0
|
||||
|
||||
# line ending convention to use when writing source files.
|
||||
# Possible values: unset (use global setting), "lf", "crlf", or "native" (platform default)
|
||||
# This does not affect Serena's own files (e.g. memories and configuration files), which always use native line endings.
|
||||
line_ending:
|
||||
|
||||
# The language backend to use for this project.
|
||||
# If not set, the global setting from serena_config.yml is used.
|
||||
# Valid values: LSP, JetBrains
|
||||
# Note: the backend is fixed at startup. If a project with a different backend
|
||||
# is activated post-init, an error will be returned.
|
||||
language_backend:
|
||||
|
||||
# whether to use project's .gitignore files to ignore files
|
||||
ignore_all_files_in_gitignore: true
|
||||
|
||||
# advanced configuration option allowing to configure language server-specific options.
|
||||
# Maps the language key to the options.
|
||||
# The settings are considered only if the project is trusted (see global configuration to define trusted projects).
|
||||
# See https://oraios.github.io/serena/02-usage/050_configuration.html#language-server-specific-settings
|
||||
ls_specific_settings: {}
|
||||
|
||||
# list of workspace folder paths (LSP backend only).
|
||||
# These folders will be used to build up Serena's symbol index.
|
||||
# Paths must be within the project root and should thus be relative to the project root.
|
||||
# Furthermore, the paths should not be filtered by ignore settings.
|
||||
# Default setting: The entire project root folder (".") is considered.
|
||||
# In (large) monorepos, this can be used to index only subfolders of the project root, e.g.
|
||||
# ls_workspace_folders:
|
||||
# - "./subproject1"
|
||||
# - "./subproject2"
|
||||
ls_workspace_folders:
|
||||
- "."
|
||||
|
||||
# list of additional workspace folder paths for cross-package reference support.
|
||||
# Paths can be absolute or relative to the project root.
|
||||
# Each folder is registered as an LSP workspace folder, enabling language servers to discover
|
||||
# symbols and references across package boundaries, but these folders are not indexed by Serena,
|
||||
# i.e. the respective symbols will not be found using Serena's symbol search tools.
|
||||
# Example:
|
||||
# additional_workspace_folders:
|
||||
# - ../sibling-package
|
||||
# - ../shared-lib
|
||||
ls_additional_workspace_folders: []
|
||||
|
||||
# list of additional paths to ignore in this project.
|
||||
# Same syntax as gitignore, so you can use * and **.
|
||||
# Important: quote patterns that start with `*`, otherwise YAML treats them as aliases.
|
||||
# Example:
|
||||
# ignored_paths:
|
||||
# - "examples/**"
|
||||
# - ".worktrees/**"
|
||||
# - "**/bin/**"
|
||||
# - "**/obj/**"
|
||||
# Note: global ignored_paths from serena_config.yml are also applied additively.
|
||||
ignored_paths: []
|
||||
|
||||
# whether the project is in read-only mode
|
||||
# If set to true, all editing tools will be disabled and attempts to use them will result in an error
|
||||
# Added on 2025-04-18
|
||||
read_only: false
|
||||
|
||||
# list of tool names to exclude.
|
||||
# This extends the existing exclusions (e.g. from the global configuration)
|
||||
# Find the list of tools here: https://oraios.github.io/serena/01-about/035_tools.html
|
||||
excluded_tools: []
|
||||
|
||||
# list of tools to include that would otherwise be disabled (particularly optional tools that are disabled by default).
|
||||
# This extends the existing inclusions (e.g. from the global configuration).
|
||||
# Find the list of tools here: https://oraios.github.io/serena/01-about/035_tools.html
|
||||
included_optional_tools: []
|
||||
|
||||
# fixed set of tools to use as the base tool set (if non-empty), replacing Serena's default set of tools.
|
||||
# This cannot be combined with non-empty excluded_tools or included_optional_tools.
|
||||
# Find the list of tools here: https://oraios.github.io/serena/01-about/035_tools.html
|
||||
fixed_tools: []
|
||||
|
||||
# list of mode names that are to be activated by default, overriding the setting in the global configuration.
|
||||
# The full set of modes to be activated is base_modes (from global config) + default_modes + added_modes.
|
||||
# If the setting is undefined/empty, the default_modes from the global configuration (serena_config.yml) apply.
|
||||
# Otherwise, this overrides the setting from the global configuration (serena_config.yml).
|
||||
# Therefore, you can set this to [] if you do not want the default modes defined in the global config to apply
|
||||
# for this project.
|
||||
# This setting can, in turn, be overridden by CLI parameters (--mode).
|
||||
# See https://oraios.github.io/serena/02-usage/050_configuration.html#modes
|
||||
default_modes:
|
||||
|
||||
# list of mode names to be activated additionally for this project, e.g. ["query-projects"]
|
||||
# The full set of modes to be activated is base_modes (from global config) + default_modes + added_modes.
|
||||
# See https://oraios.github.io/serena/02-usage/050_configuration.html#modes
|
||||
added_modes:
|
||||
|
||||
# initial prompt for the project. It will always be given to the LLM upon activating the project
|
||||
# (contrary to the memories, which are loaded on demand).
|
||||
initial_prompt: ""
|
||||
|
||||
# time budget (seconds) per tool call for the retrieval of additional symbol information
|
||||
# such as docstrings or parameter information.
|
||||
# This overrides the corresponding setting in the global configuration; see the documentation there.
|
||||
# If null or missing, use the setting from the global configuration.
|
||||
symbol_info_budget:
|
||||
|
||||
# list of regex patterns which, when matched, mark a memory entry as read‑only.
|
||||
# Extends the list from the global configuration, merging the two lists.
|
||||
read_only_memory_patterns: []
|
||||
|
||||
# list of regex patterns for memories to completely ignore.
|
||||
# Matching memories will not appear in list_memories or activate_project output
|
||||
# and cannot be accessed via read_memory or write_memory.
|
||||
# To access ignored memory files, use the read_file tool on the raw file path.
|
||||
# Extends the list from the global configuration, merging the two lists.
|
||||
# Example: ["_archive/.*", "_episodes/.*"]
|
||||
ignored_memory_patterns: []
|
||||
|
||||
# list of APIs (facades or facade methods, e.g. "lsp" or "lsp.get_diagnostics_for_symbol") to include in the REPL
|
||||
# that would otherwise be disabled (particularly optional methods, which are disabled by default).
|
||||
# This extends the existing inclusions (e.g. from the global configuration).
|
||||
included_apis: []
|
||||
|
||||
# list of APIs (facades or facade methods, e.g. "lsp" or "lsp.find_symbol") to exclude from the REPL.
|
||||
# This extends the existing exclusions (e.g. from the global configuration).
|
||||
excluded_apis: []
|
||||
|
||||
# The interface through which the agent (LLM) accesses Serena's functionality (overrides the global setting).
|
||||
# Valid values: tools, REPL (see the global configuration for details); leave empty to use the global setting.
|
||||
# Note: the interface is fixed at startup. If a project is activated post-init, its setting is not applied.
|
||||
agent_interface:
|
||||
@@ -1,301 +0,0 @@
|
||||
## Project Overview
|
||||
|
||||
This is a **Nix flake overlay** repository that provides additional packages for Nix/NixOS users. It uses [numtide/blueprint](https://github.com/numtide/blueprint) as its foundation, which simplifies flake development by providing sensible defaults and automatic package discovery.
|
||||
|
||||
**Repository URL**: `git+https://git.millerson.name/alex/millerson-overlay.nix.git`
|
||||
|
||||
## Key Concepts
|
||||
|
||||
1. Don't assume. Don't hide confusion. Surface tradeoffs.
|
||||
2. Minimum code that solves the problem. Nothing speculative.
|
||||
3. NEVER touch AGENTS.md without user request.
|
||||
4. Touch only what you must. Clean up only your own mess.
|
||||
5. Define success criteria. Loop until verified.
|
||||
|
||||
|
||||
## Before Starting Any Work
|
||||
|
||||
**MANDATORY** — Before making code changes:
|
||||
|
||||
1. **Run `br robot-docs guide`** — Get full workflow context and available commands
|
||||
2. **Check for existing issues** — Run `br ready` to find available work
|
||||
3. **Claim the task** — Use `br update <id> --claim` before starting
|
||||
4. **Track via `br` ONLY** — NEVER use TodoWrite, TaskCreate, or markdown TODO lists. All task tracking goes through `br`.
|
||||
|
||||
Violating this rule means the agent is working outside the project's workflow. Stop and re-claim via `br` first.
|
||||
|
||||
### Required Skills
|
||||
|
||||
Always use these skills when working with this repository:
|
||||
- **nix** - For nixpkgs package lookups, option searches, and NixOS/Home Manager queries
|
||||
- **nix-flakes** - For reproducible builds, flake management, and devShell operations
|
||||
- **karpathy-guidelines** - For high-quality task execution best practices
|
||||
|
||||
### Blueprint Framework
|
||||
|
||||
This project uses `numtide/blueprint` which:
|
||||
- Automatically discovers packages in the `packages/` directory
|
||||
- Provides `perSystem` outputs for multi-system builds
|
||||
- Handles formatting, checking, and devShell generation
|
||||
- Exposes `mkPackagesFor` function to build packages against any nixpkgs instance
|
||||
|
||||
Unstaged files are invisible to `nix build`, `nix flake show`, and `nix run`.
|
||||
|
||||
### Two Overlay Strategies
|
||||
|
||||
1. **`overlays.default`** - Binary-cache-friendly
|
||||
- Uses packages built against this flake's nixpkgs revision
|
||||
- Better for binary cache hits when using the same nixpkgs
|
||||
|
||||
2. **`overlays.shared-nixpkgs`** - Dependency-sharing
|
||||
- Builds packages against the consumer's nixpkgs (`final`)
|
||||
- Shares dependencies with the rest of the system
|
||||
- No second nixpkgs evaluation
|
||||
- Trade-off: binary cache only hits when consumer's nixpkgs matches ours
|
||||
|
||||
## Repository Structure
|
||||
|
||||
```
|
||||
nix-overlay/
|
||||
├── flake.nix # Main flake definition with inputs and outputs
|
||||
├── overlays/
|
||||
│ ├── default.nix # Overlay using pre-built packages (binary cache friendly)
|
||||
│ └── shared-nixpkgs.nix # Overlay building against consumer's nixpkgs
|
||||
├── packages/
|
||||
│ ├── default/ # Meta-package listing all visible packages
|
||||
│ │ ├── default.nix
|
||||
│ │ └── package.nix
|
||||
│ └── flake-inputs/ # Utility to cache all flake inputs
|
||||
│ └── default.nix
|
||||
├── README.md # User-facing documentation
|
||||
├── AGENTS.md # This file - AI agent instructions
|
||||
├── LICENSE
|
||||
└── flake.lock
|
||||
```
|
||||
|
||||
## Adding a New Package
|
||||
|
||||
When adding a new package:
|
||||
|
||||
1. **Create the directory**: `mkdir -p packages/<package-name>`
|
||||
|
||||
2. **Create `package.nix`** with the actual derivation
|
||||
|
||||
3. **Create `default.nix`** as a wrapper:
|
||||
```nix
|
||||
{ pkgs, ... }:
|
||||
pkgs.callPackage ./package.nix { }
|
||||
```
|
||||
|
||||
3.5. **Stage the package**: `git add packages/<package-name>/`
|
||||
Blueprint discovers packages from the git index, not the working directory.
|
||||
Without this step, the package won't appear in flake outputs.
|
||||
|
||||
4. **Test the package**:
|
||||
```bash
|
||||
nix build .#<package-name>
|
||||
nix run .#<package-name>
|
||||
```
|
||||
|
||||
5. **Update README.md** to document the new package in the Available Packages table
|
||||
|
||||
6. **Set appropriate metadata**:
|
||||
- `meta.description` - Required, shown in package listings
|
||||
- `meta.mainProgram` - Set for packages providing a CLI executable
|
||||
- `meta.passthru.category` - Optional, used for organization (e.g., "AI Coding Agents")
|
||||
- `meta.passthru.hideFromDocs` - Set to `true` to exclude from documentation
|
||||
|
||||
## Common Tasks
|
||||
|
||||
### Updating a Package Version
|
||||
|
||||
1. Update `version` in `package.nix`
|
||||
2. Update `src.hash` (use `nix-prefetch-github` or let Nix tell you the correct hash)
|
||||
3. Update `cargoHash` for Rust packages (build will fail and tell you the correct hash)
|
||||
4. Test: `nix build .#<package-name>`
|
||||
5. Update README if needed
|
||||
|
||||
### Testing Changes
|
||||
|
||||
```bash
|
||||
# Build specific package
|
||||
nix build .#mcp-gateway
|
||||
|
||||
# Build all packages for current system
|
||||
nix build .#packages
|
||||
|
||||
# Enter dev shell
|
||||
nix develop
|
||||
|
||||
# Check formatting
|
||||
nix flake check
|
||||
```
|
||||
|
||||
### Working with Overlays
|
||||
|
||||
When modifying overlay behavior:
|
||||
|
||||
- **`overlays/default.nix`**: Receives `packages` from blueprint outputs, maps them to `final.stdenv.hostPlatform.system`
|
||||
- **`overlays/shared-nixpkgs.nix`**: Receives `mkPackagesFor`, uses it to build against consumer's `final`
|
||||
|
||||
## Important Notes
|
||||
|
||||
### Do's
|
||||
|
||||
- ✅ Use `pkgs.callPackage` pattern for package definitions
|
||||
- ✅ Set proper `meta` attributes (description, license, homepage)
|
||||
- ✅ Test packages with `nix build` before committing
|
||||
- ✅ Use `passthru.category` for organizational grouping
|
||||
- ✅ Follow Nixpkgs conventions for package naming and structure
|
||||
|
||||
### Don'ts
|
||||
|
||||
- ❌ Don't modify `flake.lock` manually - use `nix flake update`
|
||||
- ❌ Don't hardcode system-specific paths or assumptions
|
||||
- ❌ Don't forget to set `meta.mainProgram` for CLI tools
|
||||
- ❌ Don't use `with pkgs;` at top level (can cause scope issues)
|
||||
- ❌ Don't commit packages that don't build
|
||||
|
||||
## Debugging Tips
|
||||
|
||||
### Package Doesn't Build
|
||||
|
||||
1. Check the error message carefully
|
||||
2. Verify all dependencies are listed
|
||||
3. Check if the source hash is correct
|
||||
4. For Rust packages, verify `cargoHash` matches
|
||||
|
||||
### Overlay Not Working
|
||||
|
||||
1. Verify the overlay is correctly imported
|
||||
2. Check if the package exists in `packages` output
|
||||
3. For `shared-nixpkgs`, ensure `mkPackagesFor` is available
|
||||
|
||||
### Binary Cache Issues
|
||||
|
||||
- The `default` overlay is more likely to get cache hits
|
||||
- The `shared-nixpkgs` overlay builds from source unless nixpkgs revisions match
|
||||
|
||||
## Resources
|
||||
|
||||
- [Nixpkgs Manual](https://nixos.org/manual/nixpkgs/stable/)
|
||||
- [Blueprint Documentation](https://github.com/numtide/blueprint)
|
||||
- [Nix Flake Patterns](https://github.com/NixOS/flake-patterns)
|
||||
- [Rust in Nixpkgs](https://nixos.org/manual/nixpkgs/stable/#rust)
|
||||
|
||||
## Updating Packages
|
||||
|
||||
Use [nix-update](https://github.com/Mic92/nix-update) to bump versions and update hashes:
|
||||
|
||||
```bash
|
||||
# Update a package to the latest version
|
||||
nix-update <package-name>
|
||||
|
||||
# Update to a specific version
|
||||
nix-update <package-name> --version <version>
|
||||
|
||||
# Update a package pinned to a commit hash (e.g. skillsmcp)
|
||||
nix-update <package-name> --version=branch=main
|
||||
```
|
||||
|
||||
After updating, always test the build:
|
||||
|
||||
```bash
|
||||
nix build .#<package-name>
|
||||
```
|
||||
|
||||
## Git Workflow
|
||||
|
||||
### Committing Completed Work
|
||||
|
||||
Every completed job or feature must be committed to the git repository.
|
||||
|
||||
When preparing git commits, always following conventional commit conventions and keep it concise.
|
||||
|
||||
This ensures:
|
||||
- Clean git history with proper commit message formatting
|
||||
- No work is left uncommitted
|
||||
- Consistent commit message style across the project
|
||||
|
||||
### Advanced Git Operations
|
||||
|
||||
For advanced Git workflows (rebasing, cherry-picking, bisect, worktrees, reflog, history recovery), use the `git-advanced-workflows` skill.
|
||||
|
||||
This skill provides:
|
||||
- Master advanced Git workflows including rebasing, cherry-picking, bisect, worktrees, and reflog
|
||||
- Maintain clean history and recover from any situation
|
||||
- Manage complex Git histories, collaborate on feature branches, or troubleshoot repository issues
|
||||
|
||||
## Example Workflow: Adding a New Package
|
||||
|
||||
```bash
|
||||
# 0. Claim the task via beads (MANDATORY before any work)
|
||||
br ready # Find available work
|
||||
br show <id> # Review task details
|
||||
br update <id> --claim # Claim the task
|
||||
|
||||
# 1. Create package directory
|
||||
mkdir -p packages/my-tool
|
||||
|
||||
# 2. Create package.nix (use appropriate template above)
|
||||
|
||||
# 3. Create default.nix wrapper
|
||||
cat > packages/my-tool/default.nix << 'EOF'
|
||||
{ pkgs, ... }:
|
||||
pkgs.callPackage ./package.nix { }
|
||||
EOF
|
||||
|
||||
# 3.5. Stage for Blueprint discovery
|
||||
git add packages/my-tool/
|
||||
|
||||
# 4. Test build
|
||||
nix build .#my-tool
|
||||
|
||||
# 5. If build fails, fix issues, then retry
|
||||
|
||||
# 6. Update README.md with new package info
|
||||
|
||||
# 7. Commit changes using conventional-commit skill
|
||||
git add packages/my-tool README.md
|
||||
# Then invoke: skill: "conventional-commit"
|
||||
|
||||
# 8. Close the task via beads
|
||||
br close <id> # Mark task as complete
|
||||
br sync --flush-only # Export issue state to .beads/issues.jsonl
|
||||
git add .beads/ # Stage the exported state
|
||||
git commit -m "sync beads"
|
||||
```
|
||||
|
||||
## Agent skills
|
||||
|
||||
### Issue tracker
|
||||
|
||||
Issues live in the beads database (`.beads/`, driven by the `br` CLI), synced through `git push`. The Gitea remote is not the issue tracker. See `docs/agents/issue-tracker.md`.
|
||||
|
||||
**Note:** `br` is non-invasive and never executes git commands. After `br sync --flush-only`, you must manually run add .beads/ to git index and commit.
|
||||
|
||||
### Triage labels
|
||||
|
||||
The five canonical triage roles keep their default names, applied as `br` labels. See `docs/agents/triage-labels.md`.
|
||||
|
||||
### Domain docs
|
||||
|
||||
Single-context layout: `CONTEXT.md` plus `docs/adr/` at the repo root. See `docs/agents/domain.md`.
|
||||
|
||||
## Session Completion
|
||||
|
||||
**When ending a work session**, you MUST complete ALL steps below. Work is NOT complete until git commit succeeds.
|
||||
|
||||
**MANDATORY WORKFLOW:**
|
||||
|
||||
1. **File issues for remaining work** - Create issues for anything that needs follow-up
|
||||
2. **Run quality gates** (if code changed) - Tests, linters, builds
|
||||
3. **Update issue status** - Close finished work, update in-progress items
|
||||
4. **Export and commit issue state** - `br` never runs git commands
|
||||
5. **Clean up** - Clear stashes, prune branches
|
||||
6. **Verify** - All changes committed
|
||||
7. **Hand off** - Provide context for next session
|
||||
|
||||
**CRITICAL RULES:**
|
||||
- Work is NOT complete until git commit and merge into main succeeds
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
This repository is being used as a Dolt remote.
|
||||
|
||||
ref=refs/dolt/data
|
||||
|
||||
head=d617fee02881f9fcdd34e80762b9052ba12a55b6
|
||||
|
||||
timestamp=2026-10-04T16:54:24Z
|
||||
@@ -1,232 +0,0 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright © 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
“This License” refers to version 3 of the GNU General Public License.
|
||||
|
||||
“Copyright” also means copyright-like laws that apply to other kinds of works, such as semiconductor masks.
|
||||
|
||||
“The Program” refers to any copyrightable work licensed under this License. Each licensee is addressed as “you”. “Licensees” and “recipients” may be individuals or organizations.
|
||||
|
||||
To “modify” a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a “modified version” of the earlier work or a work “based on” the earlier work.
|
||||
|
||||
A “covered work” means either the unmodified Program or a work based on the Program.
|
||||
|
||||
To “propagate” a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well.
|
||||
|
||||
To “convey” a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays “Appropriate Legal Notices” to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
The “source code” for a work means the preferred form of the work for making modifications to it. “Object code” means any non-source form of a work.
|
||||
|
||||
A “Standard Interface” means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language.
|
||||
|
||||
The “System Libraries” of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A “Major Component”, in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The “Corresponding Source” for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to “keep intact all notices”.
|
||||
|
||||
c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an “aggregate” if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work.
|
||||
|
||||
A “User Product” is either (1) a “consumer product”, which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, “normally used” refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product.
|
||||
|
||||
“Installation Information” for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
“Additional permissions” are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered “further restrictions” within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License.
|
||||
|
||||
An “entity transaction” is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
A “contributor” is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's “contributor version”.
|
||||
|
||||
A contributor's “essential patent claims” are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, “control” includes the right to grant patent sublicenses in a manner consistent with the requirements of this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a “patent license” is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To “grant” such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. “Knowingly relying” means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it.
|
||||
|
||||
A patent license is “discriminatory” if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License “or any later version” applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the “copyright” line and a pointer to where the full notice is found.
|
||||
|
||||
nix-overlay
|
||||
Copyright (C) 2026 alex
|
||||
|
||||
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode:
|
||||
|
||||
nix-overlay Copyright (C) 2026 alex
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an “about box”.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school, if any, to sign a “copyright disclaimer” for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read <https://www.gnu.org/philosophy/why-not-lgpl.html>.
|
||||
@@ -1,457 +0,0 @@
|
||||
# millerson.name Nix Overlay
|
||||
|
||||
A custom Nix overlay and flake providing additional packages not found in upstream nixpkgs, built using [numtide/blueprint](https://github.com/numtide/blueprint) for streamlined flake development.
|
||||
|
||||
## Features
|
||||
|
||||
- **Custom packages** - Additional software packaged for Nix
|
||||
- **Two overlay strategies** - Choose between binary-cache-friendly or dependency-sharing overlays
|
||||
- **Blueprint-based** - Uses modern Nix flake patterns with `numtide/blueprint`
|
||||
|
||||
## Available Packages
|
||||
|
||||
| Package | Description | Category |
|
||||
|---------|-------------|----------|
|
||||
| `agnix` | Linter for AI agent config files (CLAUDE.md, AGENTS.md, SKILL.md, hooks, MCP), ships `agnix`, `agnix-lsp` and `agnix-mcp` | AI Coding Agents |
|
||||
| `awg-tool` | CLI for AmneziaWG self-hosting — generates 1.0/1.5/2.0/3.0 obfuscation parameters, exports .conf and vpn:// configs, installs servers over SSH | Networking |
|
||||
| `awgen` | Offline CLI for AmneziaWG configurations — harmonises native .conf and vpn:// inputs, generates client participants and tunnels, and analyses obfuscation | Networking |
|
||||
| `aionui` | Free, open-source, Cowork app with AI Agents | AI Coding Agents |
|
||||
| `codeaf` | Coding harness and software factory for open models: hand work off, then watch every project from one terminal | AI Coding Agents |
|
||||
| `codex-api-proxy` | Local OpenAI-compatible HTTP proxy backed by Codex/OpenAI credentials | AI LLM Gateway |
|
||||
| `codex-oauth-proxy` | Local proxy exposing a ChatGPT Codex account through OpenAI-compatible APIs | AI LLM Gateway |
|
||||
| `container-use` | Containerized environments for coding agents | AI Coding Agents |
|
||||
| `desloppify` | Multi-language codebase health scanner and technical debt tracker for AI agents | AI Coding Agents |
|
||||
| `ds4` | DeepSeek 4 Flash and PRO local inference engine for ROCm (Strix Halo) | AI Inference |
|
||||
| `freebuff` | The world's strongest free coding agent | AI Coding Agents |
|
||||
| `freetoken` | Local MoE-offload LLM inference runtime with OpenAI- and Anthropic-compatible APIs | AI Inference |
|
||||
| `graphify` | Turn any folder of code, docs, papers, images, or videos into a queryable knowledge graph | AI Coding Agents |
|
||||
| `g3` | AI coding agent that writes code and executes commands, with multi-provider LLM support, context compaction, and desktop automation | AI Coding Agents |
|
||||
| `haivemind` | Multi-model AI consensus, aggregation, and fusion runner for popular AI CLIs | AI Coding Agents |
|
||||
| `hipengine` | ROCm-native local LLM inference engine with torch-free runtime for AMD RDNA GPUs | AI Inference |
|
||||
| `magg` | MCP aggregator / meta-MCP server that aggregates, proxies and manages other MCP servers so agents can discover and manage tools at runtime, ships `magg` and `mbro` | MCP Servers |
|
||||
| `marmel` | Autonomous agentic coding assistant with Manager + specialist subagent orchestration over any OpenAI-compatible LLM backend | AI Coding Agents |
|
||||
| `mcp-gateway` | Universal Model Context Protocol gateway that sits between AI client and MCP tools/servers | MCP Servers |
|
||||
| `memdoor` | Coding and automation agent in one CLI binary: runs locally or over SSH, with YAML workflows and a decision model in front of the chat model | AI Coding Agents |
|
||||
| `nftables-analyzer` | Analyze nftables firewall rules and evaluate traffic queries | Networking |
|
||||
| `nftablesbuilder` | Web interface to manage nftables rules with drag-and-drop rule creation | Networking |
|
||||
| `shardr` | Decentralized LLM repository: content-addressed model store, BitTorrent-based sync, OpenAI-compatible serving via llama-server | AI Inference |
|
||||
| `skillsmcp` | MCP server that exposes Agent Skills to AI agents via the Model Context Protocol | MCP Servers |
|
||||
| `kubernetes-mcp-server` | Model Context Protocol (MCP) server for Kubernetes and OpenShift | MCP Servers |
|
||||
| `kyojin` | Upstream Kyojin 1.8.26 with AMD ROCm SDK wheels and a host C compiler for Triton JIT | AI Inference |
|
||||
| `hipfire` | AMD RDNA inference engine with TheRock compiler wrappers and quantization tools | AI Inference |
|
||||
| `hipfire-kernels` | Precompiled hipfire kernels for gfx1151 | AI Inference |
|
||||
| `gufo` | Gufo with XDNA2 NPU support and the Unsloth UD 3.1 compatibility patch | AI Inference |
|
||||
| `xrt-amdxdna` | XRT with the amdxdna plugin, built against gufo's nixpkgs | AI Inference |
|
||||
| `therock-rocm` | Locally maintained TheRock 10.1 SDK for gfx1151 | AI Inference |
|
||||
| `strata` | Strata inference engine, API server and CPU vision encoder with ROCm 10 HIP support for gfx1151 | AI Inference |
|
||||
| `crucible-strix-halo` | Crucible EXL3 inference engine and OpenAI-compatible server for gfx1151 with the ROCm 10 runtime | AI Inference |
|
||||
| `strixite` | Source-built HIP inference engine and OpenAI-compatible server for gfx1151 / Zen 5 with ROCm 10 | AI Inference |
|
||||
| `pwilkin-llama-cpp` | pwilkin llama.cpp fork with ROCm for gfx1151 | AI Inference |
|
||||
| `strix-llama-cpp` | halo-box llama.cpp fork with Vulkan | AI Inference |
|
||||
| `loop` | Corporate messenger for your team | Communication |
|
||||
| `radar` | Modern Kubernetes visibility — topology, event timeline, service traffic, resource browsing, Helm management, and GitOps support | Kubernetes |
|
||||
| `omniroute` | Unified AI router with 160+ providers, auto fallback, MCP/A2A, OpenAI-compatible APIs | AI LLM Gateway |
|
||||
| `open-code-review` | AI-powered code review CLI combining deterministic pipelines with an LLM agent for line-level review comments | AI Coding Agents |
|
||||
| `pilotdeck` | Task-oriented AI Agent productivity platform (source-built Electron desktop app, plus a headless server command) with WorkSpace isolation, white-box memory, and smart routing | AI Agents |
|
||||
| `purpleflow` | Desktop orchestrator that runs Claude Code and Codex through plan, implementation, review and acceptance stages | AI Coding Agents |
|
||||
| `pdfcraft` | PDF reader and editor written from scratch in Rust — comments, forms, page organizing, redaction — plus a headless `pdfcraft-cli` with an opt-in MCP server | PDF Tools |
|
||||
| `relay-free-llm` | RESTful API to route user prompts to various AI model providers with automatic failover and intent-based routing | AI LLM Gateway |
|
||||
| `stakpak` | DevOps AI agent that generates infrastructure code, debugs Kubernetes, configures CI/CD, and automates deployments | AI Agents |
|
||||
| `traycer` | Open-source AI orchestration app for agentic coding | AI Coding Agents |
|
||||
| `voicestudio` | Fully-local voice studio — cloning, design, dubbing, dictation, transcription and audiobook creation in 646 languages; Python backend built by Nix (CPU torch, GGUF engine pinned to Vulkan), no runtime download on first launch | AI Audio |
|
||||
|
||||
## Usage
|
||||
|
||||
### As a Flake
|
||||
|
||||
Add to your `flake.nix` inputs:
|
||||
|
||||
```nix
|
||||
inputs.millerson-nix-overlay.url = "git+https://git.millerson.name/alex/millerson-overlay.nix.git";
|
||||
```
|
||||
|
||||
Then use in your outputs:
|
||||
|
||||
```nix
|
||||
outputs = { nixpkgs, millerson-nix-overlay, ... }: {
|
||||
nixosConfigurations.your-host = nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
modules = [
|
||||
millerson-nix-overlay.nixosModules.default
|
||||
# ... your other modules
|
||||
];
|
||||
};
|
||||
};
|
||||
```
|
||||
|
||||
### As an Overlay
|
||||
|
||||
#### Option 1: Default Overlay (Binary Cache Friendly)
|
||||
|
||||
Uses the packages built against this flake's nixpkgs revision. Binary cache hits work best when using the same nixpkgs revision.
|
||||
|
||||
```nix
|
||||
nixpkgs.overlays = [ millerson-nix-overlay.overlays.default ];
|
||||
```
|
||||
|
||||
#### Option 2: Shared Nixpkgs Overlay (Dependency Sharing)
|
||||
|
||||
Builds packages against your system's nixpkgs, sharing dependencies with the rest of your system. No second nixpkgs evaluation, but binary cache only hits when your nixpkgs revision matches ours.
|
||||
|
||||
```nix
|
||||
nixpkgs.overlays = [ millerson-nix-overlay.overlays.shared-nixpkgs ];
|
||||
```
|
||||
|
||||
### Installing Packages
|
||||
|
||||
With flakes enabled:
|
||||
|
||||
```bash
|
||||
# Try a package
|
||||
nix run git+https://git.millerson.name/alex/millerson-overlay.nix.git#mcp-gateway
|
||||
|
||||
# Install permanently
|
||||
nix profile install git+https://git.millerson.name/alex/millerson-overlay.nix.git#mcp-gateway
|
||||
```
|
||||
|
||||
### Inference Engines
|
||||
|
||||
The engine packages target AMD Strix Halo (`gfx1151`) on `x86_64-linux`.
|
||||
`nixpkgs-engine` pins the shared engine toolchain independently of the other
|
||||
packages. Gufo and Kyojin retain their upstream nixpkgs pins.
|
||||
|
||||
Kyojin uses the upstream 1.8.26 flake with its AMD ROCm SDK wheels. The serving
|
||||
wrappers also set `CC` for Triton's runtime C compilation. The upstream derivation
|
||||
reads its version from the source, matching the `v1.8.26` tag.
|
||||
`kyojin.tests.jit` and `kyojin.tests.cpu` expose the upstream HIP compiler smoke
|
||||
check and CPU tests. The former nixpkgs
|
||||
PyTorch/ROCm package and its `jitRocmSdk` override have been removed.
|
||||
|
||||
Hipfire exports `kernels`, `hipcc`, `rocm`, `llvmReadobj` and `llvmObjdump` as
|
||||
package attributes. Set the model directory with
|
||||
`hipfire.override { modelDir = "/path/to/models"; }`.
|
||||
The upstream service module is available as `nixosModules.hipfire`, and its
|
||||
ROCm overlay as `overlays.hipfire`. Neither is enabled by the default module.
|
||||
|
||||
Gufo exports its matching `xrt`, `npuDir` and `fabricClock` as package attributes.
|
||||
The consumer must configure NPU power and fabric clocks before using the NPU.
|
||||
TheRock uses this repository's own SDK recipe and a pinned official AMD tarball.
|
||||
The 10.1.0 archive's internal package stamp is `10.1.0rc3`.
|
||||
See [TheRock maintenance notes](docs/therock-rocm.md) for the source, update
|
||||
procedure and nixpkgs migration context. XRT still uses an individual recipe from
|
||||
the pinned `nix-strix-halo` source tree; its flake and Thunderbolt dependencies
|
||||
are not loaded.
|
||||
|
||||
Strata ships `strata` (the HIP engine), `strata-server` (the OpenAI/Anthropic HTTP
|
||||
server, also the default for `nix run .#strata`) and `strata-vision` (CPU image
|
||||
encoder). It uses the shared TheRock ROCm 10.1 SDK, compiles GPU kernels only for
|
||||
`gfx1151`, and uses upstream's portable AVX2 CPU baseline. Model weights and vision
|
||||
projectors are supplied separately.
|
||||
|
||||
Run `nix run .#strata -- --help` for server options, or invoke the engine directly
|
||||
with `nix shell .#strata -c strata --help`. For inference, pass
|
||||
`strata-server --engine strata --config /path/to/strata.json`; the upstream
|
||||
[server configuration](https://github.com/Niko1221/Strata/blob/v0.2.15/serve/server.py)
|
||||
uses `exe`, `args`, `cwd`, `tokenizer` and `model_name`. Set `exe` to the packaged
|
||||
`strata` executable and use writable model/log paths outside the Nix store.
|
||||
Upstream's gfx1151 hipBLASLt table was calibrated on TheRock 7.14.1; its solution
|
||||
ids do not exist in ROCm 10.1's hipBLASLt, which reports the same version. The
|
||||
package ships a table recalibrated against the shared ROCm 10.1 SDK in
|
||||
`bin/tuning/`, where the engine finds it without `STRATA_HIPBLASLT_TUNING`;
|
||||
recalibrate it (`tools/hip/tune_hipblaslt`) when the SDK changes.
|
||||
|
||||
Crucible ships `crucible-server` (also `nix run .#crucible-strix-halo`) and
|
||||
`crucible-engine`. Upstream built the release engine with ROCm 7.2.4 and tested
|
||||
it with ROCm 10.1. This package uses the overlay's TheRock ROCm 10.1 runtime
|
||||
and the Python server from the matching tag.
|
||||
The package targets the Ryzen AI Max+ 395 / Radeon 8060S (`gfx1151`) with 128 GB
|
||||
RAM. Supply a compatible Qwen3.8-Flash-Next EXL3 pack separately:
|
||||
|
||||
```bash
|
||||
nix run .#crucible-strix-halo -- /path/to/exl3-pack --ctx 32768
|
||||
```
|
||||
|
||||
Use `--help` for serving options; the default endpoint is `http://127.0.0.1:8790`.
|
||||
Automatic release checks are disabled by default; update through Nix. The
|
||||
upstream checkout-management CLI (`setup`, `update`, and service installation)
|
||||
is not included. Model downloads and conversation state belong outside the Nix
|
||||
store. See the upstream [setup guide](https://github.com/jaedync/crucible-strix-halo/blob/v0.37.0/docs/QUICKSTART.md)
|
||||
for GPU memory configuration and model requirements.
|
||||
|
||||
Strixite builds from source with the shared TheRock ROCm 10.1 SDK for `gfx1151`
|
||||
and the Zen 5 host CPU. It ships `strix_server` (the default entry point),
|
||||
`convert_qwen4exp`, `convert_ngram_table`, `transcode_ngram_table`, `inspect_strixw`
|
||||
and `check_stream_calls`. Supply the upstream `.strixw` weights, tokenizer and
|
||||
n-gram table separately, following the [model setup](https://github.com/shawnshekari/strixite/tree/v0.7.0#quick-start).
|
||||
|
||||
```bash
|
||||
STRIX_MODELS_DIR=/path/to/models nix run .#strixite -- --host 127.0.0.1
|
||||
```
|
||||
|
||||
The default port is 5300. `strix_server --help` lists all settings; the commented
|
||||
upstream configuration is installed at `share/strixite/strix-server.conf`.
|
||||
Model and prompt-cache paths stay outside the Nix store. The upstream defaults
|
||||
assume a dedicated 128 GB machine; see its [memory guide](https://github.com/shawnshekari/strixite/blob/v0.7.0/docs/memory.md)
|
||||
when sharing the GPU with a desktop or another model.
|
||||
`nix run .#strixite.tests.gpu` builds and runs the upstream kernel tutorial's
|
||||
CPU/GPU correctness checks on a machine with GPU access.
|
||||
|
||||
### nftablesbuilder Runtime Notes
|
||||
|
||||
`nftablesbuilder` is a web interface for managing nftables. It consists of a
|
||||
root-launcher (`nftablesbuilder`) that spawns the unprivileged `webserver`
|
||||
binary and pipes encrypted commands between it and the `nft` binary.
|
||||
|
||||
Before running it you must:
|
||||
|
||||
1. Copy the settings template to `/etc/nftablesbuilder` (the only fixed path):
|
||||
```bash
|
||||
nix build .#nftablesbuilder
|
||||
cp result/share/nftablesbuilder/settings.example /etc/nftablesbuilder
|
||||
```
|
||||
Adjust paths inside (html, webserver, nft, savepath, TLS files).
|
||||
2. Create a TLS key/certificate pair at the paths referenced by
|
||||
`tlskey`/`tlscert` (e.g. `openssl req -x509 -newkey rsa:2048 -nodes ...`).
|
||||
3. Run the launcher as root (it needs to write `/etc/nftables.conf` and run
|
||||
`nft`); the web interface listens on `https://<server>:1969`.
|
||||
|
||||
Note: upstream publishes the GUI only as a prebuilt tarball on
|
||||
nftablesbuilder.eu (served with a self-signed certificate, hence the
|
||||
`curlOpts = "-k"` in the derivation); the source repository is missing the
|
||||
`settings` crate, which this overlay patches in.
|
||||
|
||||
### OpenCodeReview OpenCode Plugin (Home Manager)
|
||||
|
||||
The `open-code-review` package bundles its OpenCode plugin (the plugin file
|
||||
plus runtime `node_modules`) as `passthru.opencode-plugin`, built from the
|
||||
same source revision as the CLI. A Home Manager module symlinks it into
|
||||
`~/.config/opencode/plugins/` and puts the `ocr` CLI on PATH:
|
||||
|
||||
```nix
|
||||
inputs.millerson-nix-overlay.url = "git+https://git.millerson.name/alex/millerson-overlay.nix.git";
|
||||
inputs.home-manager.url = "github:nix-community/home-manager";
|
||||
```
|
||||
|
||||
```nix
|
||||
# in your home-manager configuration
|
||||
imports = [ millerson-nix-overlay.homeManagerModules.default ];
|
||||
|
||||
programs.open-code-review = {
|
||||
enable = true;
|
||||
opencode.enable = true; # symlink plugin into ~/.config/opencode
|
||||
};
|
||||
```
|
||||
|
||||
Without Home Manager, symlink manually:
|
||||
|
||||
```bash
|
||||
plugin=$(nix build --print-out-paths \
|
||||
git+https://git.millerson.name/alex/millerson-overlay.nix.git#open-code-review.passthru.opencode-plugin)
|
||||
mkdir -p ~/.config/opencode/plugins
|
||||
ln -sf $plugin/share/open-code-review/opencode/open-code-review.ts ~/.config/opencode/plugins/
|
||||
ln -sfn $plugin/share/open-code-review/opencode/node_modules ~/.config/opencode/plugins/node_modules
|
||||
```
|
||||
|
||||
Note: the `node_modules` symlink is shared across everything in the plugins
|
||||
directory; other manually-installed plugins with conflicting npm dependencies
|
||||
cannot coexist with it.
|
||||
|
||||
### Codex OAuth Proxy (systemd user service)
|
||||
|
||||
On Linux with a running systemd user manager, the package provides
|
||||
`lib/systemd/user/codex-oauth-proxy.service`. Installing the package alone does
|
||||
not enable or start it. To use the packaged unit without Home Manager:
|
||||
|
||||
```bash
|
||||
package=$(nix build --no-link --print-out-paths \
|
||||
git+https://git.millerson.name/alex/millerson-overlay.nix.git#codex-oauth-proxy)
|
||||
systemctl --user enable --now "$package/lib/systemd/user/codex-oauth-proxy.service"
|
||||
systemctl --user status codex-oauth-proxy.service
|
||||
```
|
||||
|
||||
Keep the selected package in a Nix profile or another garbage-collection root
|
||||
while using its unit. To stop it and remove its enablement links:
|
||||
|
||||
```bash
|
||||
systemctl --user disable --now codex-oauth-proxy.service
|
||||
```
|
||||
|
||||
Do not manage the same unit with both this procedure and Home Manager.
|
||||
|
||||
#### Home Manager
|
||||
|
||||
Import the module and make the package available in Home Manager's `pkgs`:
|
||||
|
||||
```nix
|
||||
imports = [ millerson-nix-overlay.homeManagerModules.default ];
|
||||
nixpkgs.overlays = [ millerson-nix-overlay.overlays.default ];
|
||||
|
||||
programs.codex-oauth-proxy.enable = true;
|
||||
```
|
||||
|
||||
The module installs the package and manages the user unit and its
|
||||
`default.target` link. Its package default selects
|
||||
`pkgs.millerson-nix-overlay.codex-oauth-proxy`, falling back to
|
||||
`pkgs.codex-oauth-proxy`. Importing `homeManagerModules.default` does not add an
|
||||
overlay. Supply the overlay to the actual Home Manager package set, or set
|
||||
`programs.codex-oauth-proxy.package` explicitly to this flake's package for your
|
||||
system.
|
||||
|
||||
Apply the configuration with your normal Home Manager activation. Enabling
|
||||
starts this service without changing `systemd.user.startServices`. To stop and
|
||||
disable a previously module-managed service, keep the import and apply:
|
||||
|
||||
```nix
|
||||
programs.codex-oauth-proxy.enable = false;
|
||||
```
|
||||
|
||||
Removing the import also removes the cleanup hook, so first activate with
|
||||
`enable = false`. A fresh disabled configuration leaves a manually managed
|
||||
same-named service untouched. Starting or stopping a module-managed service
|
||||
requires an available user manager; activation reports failure if it is unavailable. The module does not enable
|
||||
lingering or change the global service activation policy.
|
||||
|
||||
#### State and security
|
||||
|
||||
Both units use persistent OAuth state at `%S/codex-oauth-proxy/auth.json`,
|
||||
normally `~/.local/state/codex-oauth-proxy/auth.json` in a user manager. The state
|
||||
directory has mode `0700` and the service umask is `0077`. Upstream may migrate
|
||||
existing credentials when the destination is absent, and refreshes rewrite the
|
||||
credential file. Keep it writable and outside the Nix store and immutable Home
|
||||
Manager files. Disabling the service does not delete this credential state.
|
||||
Missing credentials do not prevent startup, but successful upstream requests
|
||||
require valid credentials.
|
||||
|
||||
The server binds all interfaces on port `9879` by default, not just loopback.
|
||||
Restrict access with your network/firewall configuration. The service does not
|
||||
add TLS or network access controls.
|
||||
|
||||
`ADMIN_API_KEY` protects upstream's admin endpoints. No default key is generated.
|
||||
If unset or empty, protected requests return HTTP 500; the server can still
|
||||
start. The packaged unit does not set this variable; a user-manager environment
|
||||
can supply it. Home Manager has an optional literal setting (placeholder only):
|
||||
|
||||
```nix
|
||||
programs.codex-oauth-proxy.admin_api_key = "REPLACE_WITH_NON_SECRET_PLACEHOLDER";
|
||||
```
|
||||
|
||||
The default `null` omits the assignment. A non-null value must contain printable
|
||||
ASCII; an empty string explicitly supplies an empty value. **A literal key in
|
||||
this option is public in the Nix store, retained generations, and systemd
|
||||
introspection. Do not put a confidential production key here.** This option is
|
||||
not a runtime secret-delivery mechanism.
|
||||
|
||||
Both units discard stdout and stderr because upstream logs token previews and
|
||||
other potentially sensitive request/response data. Production mode does not
|
||||
establish redaction. Application logs are therefore unavailable in the journal;
|
||||
systemd status and exit diagnostics remain. Do not override these output settings
|
||||
without first addressing upstream token logging.
|
||||
|
||||
### PdfCraft (Home Manager)
|
||||
|
||||
`pdfcraft` is built from source (no upstream binaries are downloaded). A Home
|
||||
Manager module installs both programs it ships:
|
||||
|
||||
```nix
|
||||
# in your home-manager configuration
|
||||
imports = [ millerson-nix-overlay.homeManagerModules.default ];
|
||||
|
||||
programs.pdfcraft.enable = true;
|
||||
```
|
||||
|
||||
That puts `pdfcraft` (the desktop app) and `pdfcraft-cli` (headless tool
|
||||
runner and the opt-in MCP server, `pdfcraft-cli mcp`) on PATH. The module adds
|
||||
`programs.pdfcraft.package` to `home.packages`; the default is
|
||||
`pkgs.millerson-nix-overlay.pdfcraft`, so `nixpkgs.overlays` must carry this
|
||||
flake's overlay, or set `package` yourself.
|
||||
|
||||
The package ships the two OCR models under `share/pdfcraft/models`, where the
|
||||
app looks beside its own `bin/` — `pdfcraft-cli run ocr_status` reports
|
||||
`"available": true`. The optional `craft-fonts` build input is not used, so
|
||||
Japanese interface text falls back to an installed system font.
|
||||
|
||||
## Development
|
||||
|
||||
### Prerequisites
|
||||
|
||||
- Nix with flakes enabled
|
||||
- [treefmt-nix](https://github.com/numtide/treefmt-nix) for formatting (optional)
|
||||
|
||||
### Building Packages
|
||||
|
||||
```bash
|
||||
# Build all packages for current system
|
||||
nix build .#packages
|
||||
|
||||
# Build specific package
|
||||
nix build .#mcp-gateway
|
||||
|
||||
# Enter development shell
|
||||
nix develop
|
||||
```
|
||||
|
||||
### Project Structure
|
||||
|
||||
```
|
||||
nix-overlay/
|
||||
├── flake.nix # Flake definition
|
||||
├── treefmt.toml # Code formatting configuration (nixfmt)
|
||||
├── overlays/ # Overlay implementations
|
||||
│ ├── default.nix # Binary-cache-friendly overlay
|
||||
│ └── shared-nixpkgs.nix # Dependency-sharing overlay
|
||||
├── packages/ # Package definitions
|
||||
│ ├── agnix/ # Linter for AI agent config files (CLI + LSP + MCP server)
|
||||
│ ├── awg-tool/ # AmneziaWG parameter generation and SSH deployment CLI
|
||||
│ ├── awgen/ # Offline AmneziaWG configuration harmoniser and generator
|
||||
│ ├── aionui/ # AionUi - AI Cowork desktop app
|
||||
│ ├── codeaf/ # Coding harness and software factory for open models
|
||||
│ ├── container-use/ # Containerized environments for coding agents
|
||||
│ ├── default/ # Meta-package listing all packages
|
||||
│ ├── desloppify/ # Codebase health scanner for AI agents
|
||||
│ ├── ds4/ # DeepSeek V4 Flash/PRO inference engine (ROCm)
|
||||
│ ├── flake-inputs/ # Utility for caching flake inputs
|
||||
│ ├── freebuff/ # Free coding agent (Codebuff)
|
||||
│ ├── freetoken/ # Local MoE inference runtime (NVIDIA CUDA)
|
||||
│ ├── graphify/ # Knowledge graph generator for code folders
|
||||
│ ├── g3/ # AI coding agent (g3 + g3-studio)
|
||||
│ ├── haivemind/ # Multi-model AI consensus runner
|
||||
│ ├── hipengine/ # ROCm-native LLM inference engine for AMD GPUs
|
||||
│ ├── kubernetes-mcp-server/ # MCP server for Kubernetes and OpenShift
|
||||
│ ├── kyojin/ # ExLlamaV3-based inference engine for Strix Halo (gfx1151)
|
||||
│ ├── loop/ # Corporate messenger for your team
|
||||
│ ├── mcp-gateway/ # MCP protocol gateway
|
||||
│ ├── omniroute/ # Unified AI router with 160+ providers
|
||||
│ ├── open-code-review/ # AI code review CLI (deterministic + LLM agent)
|
||||
│ ├── pilotdeck/ # Task-oriented AI Agent platform (source-built Electron desktop app)
|
||||
│ ├── purpleflow/ # Electron orchestrator for Claude Code and Codex stages
|
||||
│ ├── pdfcraft/ # PDF reader and editor in Rust, with pdfcraft-cli
|
||||
│ ├── radar/ # Kubernetes UI (topology, timeline, Helm, GitOps)
|
||||
│ ├── relay-free-llm/ # AI model provider routing gateway
|
||||
│ ├── skillsmcp/ # MCP server for Agent Skills
|
||||
│ ├── stakpak/ # DevOps AI agent for infrastructure automation
|
||||
│ └── traycer/ # AI orchestration desktop app (agentic coding)
|
||||
└── README.md
|
||||
```
|
||||
|
||||
### Adding New Packages
|
||||
|
||||
1. Create a new directory under `packages/<package-name>/`
|
||||
2. Add a `package.nix` with the package definition
|
||||
3. Create a `default.nix` that imports `package.nix` with proper arguments
|
||||
4. The package will be automatically picked up by blueprint
|
||||
|
||||
Example structure:
|
||||
|
||||
```
|
||||
packages/my-package/
|
||||
├── default.nix # Import wrapper
|
||||
└── package.nix # Actual package definition
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
See [LICENSE](LICENSE) file for details.
|
||||
|
||||
## Contributing
|
||||
|
||||
Contributions are welcome! Please feel free to submit a Pull Request.
|
||||
@@ -1,49 +0,0 @@
|
||||
{ inputs, system }:
|
||||
let
|
||||
pkgs = import inputs.nixpkgs-engine {
|
||||
inherit system;
|
||||
config.allowUnfree = true;
|
||||
overlays = [ inputs.hipfire.overlays.default ];
|
||||
};
|
||||
therock-rocm = pkgs.callPackage ../packages/therock-rocm/package.nix { };
|
||||
hipfire = pkgs.callPackage ../packages/hipfire/package.nix {
|
||||
hipfireSource = inputs.hipfire;
|
||||
therockRocm = therock-rocm;
|
||||
};
|
||||
gufo = import ../packages/gufo/package.nix { inherit inputs system; };
|
||||
in
|
||||
builtins.mapAttrs
|
||||
(
|
||||
_: package:
|
||||
if system == "x86_64-linux" then
|
||||
package
|
||||
else
|
||||
{
|
||||
meta.platforms = [ "x86_64-linux" ];
|
||||
}
|
||||
)
|
||||
{
|
||||
inherit hipfire therock-rocm gufo;
|
||||
strixite = pkgs.callPackage ../packages/strixite/package.nix {
|
||||
therockRocm = therock-rocm;
|
||||
};
|
||||
crucible-strix-halo = pkgs.callPackage ../packages/crucible-strix-halo/package.nix {
|
||||
therockRocm = therock-rocm;
|
||||
};
|
||||
strata = pkgs.callPackage ../packages/strata/package.nix {
|
||||
therockRocm = therock-rocm;
|
||||
};
|
||||
hipfire-kernels = hipfire.kernels;
|
||||
xrt-amdxdna = gufo.xrt;
|
||||
kyojin = pkgs.callPackage ../packages/kyojin/package.nix {
|
||||
inherit (inputs.kyojin.packages.${system}) kyojin exllamav3;
|
||||
jitCheck = inputs.kyojin.checks.${system}.kyojin-hipcc-smoke;
|
||||
cpuCheck = inputs.kyojin.checks.${system}.kyojin-tests;
|
||||
};
|
||||
pwilkin-llama-cpp = pkgs.callPackage ../packages/pwilkin-llama-cpp/package.nix {
|
||||
source = inputs.pwilkin-llama-cpp;
|
||||
};
|
||||
strix-llama-cpp = pkgs.callPackage ../packages/strix-llama-cpp/package.nix {
|
||||
source = inputs.strix-llama-cpp;
|
||||
};
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
{
|
||||
lib,
|
||||
stdenv,
|
||||
libc ? stdenv.cc.libc,
|
||||
}:
|
||||
# TheRock's compiler bypasses the Nix cc wrapper and needs explicit host paths.
|
||||
lib.concatStringsSep " " [
|
||||
"--gcc-toolchain=${stdenv.cc.cc}"
|
||||
"-idirafter ${lib.getDev libc}/include"
|
||||
"-B${libc}/lib"
|
||||
"-L${libc}/lib"
|
||||
"-L${stdenv.cc.cc.lib}/lib"
|
||||
"-Wl,-rpath,${libc}/lib:${stdenv.cc.cc.lib}/lib"
|
||||
"-Wl,--dynamic-linker=${stdenv.cc.bintools.dynamicLinker}"
|
||||
]
|
||||
@@ -1,55 +0,0 @@
|
||||
# Domain Docs
|
||||
|
||||
How the engineering skills should consume this repo's domain documentation when exploring the codebase.
|
||||
|
||||
## Before exploring, read these
|
||||
|
||||
- **`CONTEXT.md`** at the repo root, or
|
||||
- **`CONTEXT-MAP.md`** at the repo root if it exists — it points at one `CONTEXT.md` per context. Read each one relevant to the topic.
|
||||
- **`docs/adr/`** — read ADRs that touch the area you're about to work in. In multi-context repos, also check `src/<context>/docs/adr/` for context-scoped decisions.
|
||||
|
||||
If any of these files don't exist, **proceed silently**. Don't flag their absence; don't suggest creating them upfront. The `/domain-modeling` skill (reached via `/grill-with-docs` and `/improve-codebase-architecture`) creates them lazily when terms or decisions actually get resolved.
|
||||
|
||||
## File structure
|
||||
|
||||
Single-context repo (most repos):
|
||||
|
||||
```
|
||||
/
|
||||
├── CONTEXT.md
|
||||
├── docs/adr/
|
||||
│ ├── 0001-two-overlay-strategies.md
|
||||
│ └── 0002-package-discovery-via-git-index.md
|
||||
├── packages/
|
||||
├── overlays/
|
||||
└── modules/
|
||||
```
|
||||
|
||||
This repo uses the single-context layout. There is no `CONTEXT-MAP.md` and no per-directory `CONTEXT.md` files; the whole overlay is one domain.
|
||||
|
||||
Multi-context repo (presence of `CONTEXT-MAP.md` at the root):
|
||||
|
||||
```
|
||||
/
|
||||
├── CONTEXT-MAP.md
|
||||
├── docs/adr/ ← system-wide decisions
|
||||
└── src/
|
||||
├── ordering/
|
||||
│ ├── CONTEXT.md
|
||||
│ └── docs/adr/ ← context-specific decisions
|
||||
└── billing/
|
||||
├── CONTEXT.md
|
||||
└── docs/adr/
|
||||
```
|
||||
|
||||
## Use the glossary's vocabulary
|
||||
|
||||
When your output names a domain concept (in an issue title, a refactor proposal, a hypothesis, a test name), use the term as defined in `CONTEXT.md`. Don't drift to synonyms the glossary explicitly avoids.
|
||||
|
||||
If the concept you need isn't in the glossary yet, that's a signal — either you're inventing language the project doesn't use (reconsider) or there's a real gap (note it for `/domain-modeling`).
|
||||
|
||||
## Flag ADR conflicts
|
||||
|
||||
If your output contradicts an existing ADR, surface it explicitly rather than silently overriding:
|
||||
|
||||
> _Contradicts ADR-0007 (event-sourced orders) — but worth reopening because…_
|
||||
@@ -1,68 +0,0 @@
|
||||
# Issue tracker: br (beads_rust)
|
||||
|
||||
Issues and specs for this repo live in the beads database at `.beads/`. The source of truth is `.beads/issues.jsonl`, managed through the `br` CLI (v0.7.6). beads state is versioned in the repo and synced with `git push`; there is no separate Dolt remote.
|
||||
|
||||
**Note:** `br` is non-invasive and never executes git commands. After `br sync --flush-only`, you must manually run `git add .beads/ && git commit`.
|
||||
|
||||
The forge remote (`git.millerson.name`, self-hosted Gitea) is not the issue tracker. Do not open Gitea, GitHub, or GitLab issues for work in this repo.
|
||||
|
||||
## Core commands
|
||||
|
||||
```bash
|
||||
br robot-docs guide # session context and command reference (run first)
|
||||
br ready # open issues with no active blockers
|
||||
br show <id> # full issue detail
|
||||
br list # list issues
|
||||
br search "<text>" # text search
|
||||
br create "title" -d "description" -p 2 -l label1,label2
|
||||
br q "quick capture" # create and print only the id
|
||||
br update <id> --claim # claim before starting work
|
||||
br close <id> --reason "..."
|
||||
br reopen <id>
|
||||
br comments add <id> "..." # conversation history
|
||||
br update <id> --append-notes "..." # append to the issue notes field
|
||||
br label add <id> <label>
|
||||
br label remove <id> <label>
|
||||
br label list <id>
|
||||
br status # database overview
|
||||
```
|
||||
|
||||
Issue ids look like `nix-overlay-4g1`. New work must be claimed with `br update <id> --claim` before it starts.
|
||||
|
||||
## When a skill says "publish to the issue tracker"
|
||||
|
||||
Run `br create`. Use one issue per ticket. Put the full body in `--description` (markdown is fine). Add labels per `triage-labels.md`. For a multi-part spec, create a parent issue and link children with `--deps`.
|
||||
|
||||
## When a skill says "fetch the relevant ticket"
|
||||
|
||||
Run `br show <id>` and read the description. Use `br show <id> --json` for machine-readable output, and `br comments list <id>` for the comment thread. The user normally passes the issue id directly.
|
||||
|
||||
## Dependencies
|
||||
|
||||
`br create --deps 'blocked-by:nix-overlay-4g1,discovered-from:nix-overlay-2a3'`
|
||||
|
||||
Bare ids, `blocked-by:` and `discovered-from:` all make the new issue depend on the target. `depends-on:` is not a valid br dependency type and is rejected. `br dep add <issue> <depends-on>` adds a dependency after creation, `br dep list <issue>` shows the graph, and `br dep tree <issue>` shows it as a tree. `br ready` already excludes anything with an unresolved blocker, so a ticket is unblocked when every issue that blocks it is closed.
|
||||
|
||||
## Wayfinding operations
|
||||
|
||||
Used by `/wayfinder`. The map is a parent bead; the children are its sub-issues.
|
||||
|
||||
- **Map**: a bead created for the effort. Its description holds the Notes / Decisions-so-far / Fog body.
|
||||
- **Child ticket**: a bead created with `--parent <map-id>`, which links it to the map as a parent-child dependency (br ids the child `<map-id>.1`). The question goes in the description. Record the ticket type as a label (`research`, `prototype`, `grilling`, `task`).
|
||||
- **Blocking**: a `blocked-by:<id>` dependency on the blocking bead.
|
||||
- **Frontier**: `br ready` output, restricted to children of the map (`br list --tree` groups children under their parent, or filter `br ready` by label). Lowest priority number, then oldest, wins.
|
||||
- **Claim**: `br update <id> --claim` before any work starts.
|
||||
- **Resolve**: append the answer with `br update <id> --append-notes "..."` or `br comments add <id> "..."`, then `br close <id> --reason "<answer gist>"`, then add a context pointer (gist plus issue id) to the map's Decisions-so-far with `br comments add <map-id> "..."`.
|
||||
|
||||
## Session end
|
||||
|
||||
Work is not complete until pushed. The project workflow requires:
|
||||
|
||||
```bash
|
||||
git pull --rebase
|
||||
br sync --flush-only # export issue state to .beads/issues.jsonl
|
||||
git add .beads/
|
||||
git commit -m "sync beads"
|
||||
git push
|
||||
git status # must show up to date with origin
|
||||
```
|
||||
@@ -1,29 +0,0 @@
|
||||
# Triage Labels
|
||||
|
||||
The skills speak in terms of five canonical triage roles. This file maps those roles to the actual label strings used in this repo's issue tracker.
|
||||
|
||||
| Label in mattpocock/skills | Label in our tracker | Meaning |
|
||||
| -------------------------- | -------------------- | ---------------------------------------- |
|
||||
| `needs-triage` | `needs-triage` | Maintainer needs to evaluate this issue |
|
||||
| `needs-info` | `needs-info` | Waiting on reporter for more information |
|
||||
| `ready-for-agent` | `ready-for-agent` | Fully specified, ready for an AFK agent |
|
||||
| `ready-for-human` | `ready-for-human` | Requires human implementation |
|
||||
| `wontfix` | `wontfix` | Will not be actioned |
|
||||
|
||||
When a skill mentions a role (for example "apply the AFK-ready triage label"), use the corresponding label string from this table.
|
||||
|
||||
Edit the right-hand column to match whatever vocabulary you actually use.
|
||||
|
||||
## Applying labels with br
|
||||
|
||||
Labels are br labels, not forge labels:
|
||||
|
||||
```bash
|
||||
br label add <issue-id> ready-for-agent
|
||||
br label remove <issue-id> needs-triage
|
||||
br label list <issue-id>
|
||||
```
|
||||
|
||||
On creation: `br create "title" -l ready-for-agent`.
|
||||
|
||||
A ticket has at most one triage role label. When a ticket moves to a new role, remove the old label and add the new one in the same step rather than stacking role labels.
|
||||
@@ -1,367 +0,0 @@
|
||||
# Build/verification report: `packages/magg` (magg 1.3.0)
|
||||
|
||||
- **Task:** t-005 — independent verification of the newly added `magg` package.
|
||||
- **Verifier role:** read-only audit. `packages/magg/*`, `README.md`, `AGENTS.md`, `flake.lock` were **not**
|
||||
modified (proven by `sha256sum -c` at the end of this report) and **nothing was committed**.
|
||||
- **Host system:** `x86_64-linux` (`nix eval --raw --impure --expr 'builtins.currentSystem'`), Nix 2.34.9.
|
||||
- **Verdict:** **PASS** — the derivation evaluates, builds from a forced rebuild, its test suite genuinely
|
||||
re-runs and passes (329 passed / 3 skipped / 3 deselected / 0 failed), and both console scripts work.
|
||||
|
||||
---
|
||||
|
||||
## 1. Git index state (blueprint discovers packages from the git index)
|
||||
|
||||
```console
|
||||
$ git status --porcelain
|
||||
M .serena/project.yml
|
||||
M AGENTS.md
|
||||
M README.md
|
||||
A packages/magg/default.nix
|
||||
A packages/magg/package.nix
|
||||
?? .marmel/
|
||||
?? docs/research_magg_build.md
|
||||
?? docs/research_magg_upstream.md
|
||||
|
||||
$ git ls-files packages/magg
|
||||
packages/magg/default.nix
|
||||
packages/magg/package.nix
|
||||
|
||||
$ git diff --cached --stat
|
||||
packages/magg/default.nix | 5 ++
|
||||
packages/magg/package.nix | 165 ++++++++++++++++++++++++++++++++++++++++++++++
|
||||
2 files changed, 170 insertions(+)
|
||||
```
|
||||
|
||||
Both files are already **staged** (`A`, present in the index), so blueprint can see the package.
|
||||
**`git add` was NOT needed and was not run.**
|
||||
|
||||
Note: `README.md` / `AGENTS.md` doc rows are modified but **unstaged**, and `docs/research_magg_*.md`
|
||||
(including this report) are untracked. That does not affect package visibility to `nix build`, but the
|
||||
commit that lands this change must stage them together with `packages/magg/` or the docs will be lost.
|
||||
|
||||
## 2. Flake attribute exists and evaluates via the blueprint `perSystem` output
|
||||
|
||||
`nix flake show '.#magg'` is not valid CLI syntax (`error: unexpected fragment 'magg' in flake reference
|
||||
'.#magg'`), and a whole-flake `nix flake show .` aborts on a **pre-existing, repo-wide** nixpkgs problem
|
||||
(see §9), so the attribute was probed directly:
|
||||
|
||||
```console
|
||||
$ nix eval .#magg.version
|
||||
"1.3.0"
|
||||
|
||||
$ nix eval --raw .#magg.meta.mainProgram
|
||||
magg
|
||||
|
||||
$ nix eval --raw .#packages.x86_64-linux.magg.pname # blueprint perSystem output
|
||||
magg
|
||||
|
||||
$ nix eval .#checks.x86_64-linux --apply 'x: builtins.attrNames x'
|
||||
[ ..., "pkgs-magg", ... ] # blueprint check attr present
|
||||
```
|
||||
|
||||
`nix flake show .` does list the package in the (cached) output tree, e.g.
|
||||
`├───pkgs-magg omitted (use '--all-systems' to show)`.
|
||||
|
||||
## 3. Real rebuild with the check phase re-executed (not a cached echo)
|
||||
|
||||
`nix build .#magg --check` does not exist on Nix 2.34 (`error: unrecognised flag '--check'`); the
|
||||
equivalent flag is `--rebuild` ("Rebuild an already built package and compare the result"), so that was
|
||||
used to force a genuine re-run of every phase, including the test suite:
|
||||
|
||||
```console
|
||||
$ nix build .#magg --rebuild --no-link --print-build-logs
|
||||
checking outputs of '/nix/store/njvx0wy8h1lyg0iw2k2nnjmk64mgk8x4-magg-1.3.0.drv'...
|
||||
magg> Running phase: unpackPhase
|
||||
magg> Running phase: buildPhase
|
||||
magg> Successfully built magg-1.3.0-py3-none-any.whl
|
||||
magg> Running phase: pythonRuntimeDepsCheckHook
|
||||
magg> Checking runtime dependencies for magg-1.3.0-py3-none-any.whl
|
||||
magg> Running phase: installPhase
|
||||
magg> Successfully installed magg-1.3.0-py3-none-any.whl
|
||||
magg> wrapping `/nix/store/y9n7l82x6k766bjygf73vag5ivw9vnsx-magg-1.3.0/bin/magg'...
|
||||
magg> wrapping `/nix/store/y9n7l82x6k766bjygf73vag5ivw9vnsx-magg-1.3.0/bin/mbro'...
|
||||
magg> Running phase: installCheckPhase
|
||||
magg> ============================= test session starts ==============================
|
||||
magg> platform linux -- Python 3.14.7, pytest-9.1.1, pluggy-1.6.0
|
||||
magg> rootdir: /build/source
|
||||
magg> configfile: pyproject.toml
|
||||
magg> plugins: asyncio-1.4.0, anyio-4.14.2
|
||||
magg> asyncio: mode=Mode.STRICT, debug=False, ...
|
||||
magg> collected 335 items / 3 deselected / 332 selected
|
||||
magg> ...
|
||||
magg> test/magg/test_in_memory.py ..... [ 30%]
|
||||
magg> test/magg/test_mounting_real.py . [ 73%]
|
||||
magg> test/magg/test_server_robustness.py ................... [ 93%]
|
||||
magg> test/magg/test_transport.py ............. [100%]
|
||||
magg> ================ 329 passed, 3 skipped, 3 deselected in 42.50s =================
|
||||
magg> installCheckPhase completed in 44 seconds
|
||||
magg> Running phase: pythonImportsCheckPhase
|
||||
magg> Check whether the following modules can be imported: magg
|
||||
NIXBUILD_EXIT=0
|
||||
```
|
||||
|
||||
- **Test-suite summary line:** `329 passed, 3 skipped, 3 deselected in 42.50s` — **0 failed, 0 errored**.
|
||||
- **Final exit status:** `0`. `--rebuild` also compares the freshly produced output against the stored one;
|
||||
a mismatch would have been a hard error, so the cached output is reproducible.
|
||||
- The suite really ran: `installCheckPhase completed in 44 seconds`, `pytest-asyncio 1.4.0` loaded in
|
||||
`mode=Mode.STRICT` (so async tests are executed, not silently skipped), and the stdio-backend test
|
||||
modules the derivation comment calls out (`test_in_memory.py`, `test_mounting_real.py`,
|
||||
`test_client_mounting.py`, `test_server_robustness.py`, `test_transport.py`) all pass — i.e. the
|
||||
venv/`.pth` trick in `checkPhase` works: those tests are green instead of dying with
|
||||
`ModuleNotFoundError: No module named 'fastmcp'`.
|
||||
- The 3 deselected tests are the `-m "not integration"` e2e tests; the 3 skipped ones are upstream's own
|
||||
capability probes in `test/magg/test_client_api.py` (`"Command keyword syntax not supported"`,
|
||||
`"Positional command syntax not supported"`, `"WebSocket URLs not supported"`), not packaging-induced skips.
|
||||
- `pythonImportsCheck = [ "magg" ]` executed and passed.
|
||||
|
||||
## 4. Binary smoke tests
|
||||
|
||||
```console
|
||||
$ OUT=$(nix build .#magg --no-link --print-out-paths)
|
||||
/nix/store/y9n7l82x6k766bjygf73vag5ivw9vnsx-magg-1.3.0
|
||||
$ ls $OUT/bin
|
||||
magg .magg-wrapped mbro .mbro-wrapped
|
||||
|
||||
$ $OUT/bin/magg --version ; echo exit=$?
|
||||
magg 1.3.0
|
||||
exit=0
|
||||
|
||||
$ $OUT/bin/magg --help | head -6 ; echo exit=${PIPESTATUS[0]}
|
||||
usage: magg [-h] [--version] [--config CONFIG] [-e] [-E KEY VALUE]
|
||||
{serve,server,config,kit,auth} ...
|
||||
Magg - MCP Aggregator: Manage and aggregate MCP servers
|
||||
...
|
||||
exit=0
|
||||
|
||||
$ $OUT/bin/mbro --version < /dev/null ; echo exit=$?
|
||||
mbro (magg) 1.3.0
|
||||
exit=0
|
||||
|
||||
$ $OUT/bin/mbro --help < /dev/null | head -6 ; echo exit=${PIPESTATUS[0]}
|
||||
usage: mbro [-h] [-V] [--json] [--no-rich] [--indent INDENT] [-v] [-q] [-e]
|
||||
[-E KEY VALUE] [--repl] [-n] [-x SCRIPT] [-X SCRIPT]
|
||||
[--status-bar] [--fail-fast] [--timeout SECONDS] [commands ...]
|
||||
MBRO - MCP Browser
|
||||
exit=0
|
||||
|
||||
$ nix run .#magg -- --help # resolves meta.mainProgram = "magg"
|
||||
usage: magg [-h] [--version] [--config CONFIG] [-e] [-E KEY VALUE]
|
||||
{serve,server,config,kit,auth} ...
|
||||
Magg - MCP Aggregator: Manage and aggregate MCP servers
|
||||
nixrun_exit=0
|
||||
```
|
||||
|
||||
Both console scripts declared in upstream `[project.scripts]` (`magg = magg.cli:main`,
|
||||
`mbro = magg.mbro.cli:main`) are installed, wrapped and functional; `mainProgram` resolves.
|
||||
|
||||
### `mbro` TTY caveat (upstream behaviour, **not** a packaging defect)
|
||||
|
||||
First attempt through a non-foreground pipe appeared to hang with no output:
|
||||
|
||||
```console
|
||||
$ timeout 60 $OUT/bin/mbro --version > out 2> err # stdin = a TTY, process in a background pgroup
|
||||
exit=124 # timeout; 0 bytes on stdout/stderr
|
||||
```
|
||||
|
||||
Root cause (obtained with `timeout -s ABRT` + `python -X faulthandler`):
|
||||
|
||||
```
|
||||
Fatal Python error: Aborted
|
||||
Current thread ... (most recent call first):
|
||||
File ".../python3.14/_pyrepl/fancy_termios.py", line 63 in tcsetattr
|
||||
File ".../python3.14/_pyrepl/unix_console.py", line 836 in __input_fd_set
|
||||
File ".../python3.14/_pyrepl/readline.py", line 364 in get_reader
|
||||
File ".../python3.14/_pyrepl/main.py", line 15 in <module>
|
||||
File ".../site-packages/magg/mbro/arepl.py", line 27 in <module>
|
||||
File ".../site-packages/magg/mbro/cli.py", line 22 in <module>
|
||||
```
|
||||
|
||||
`magg/mbro/arepl.py:27` does a module-level `from _pyrepl.main import CAN_USE_PYREPL`; importing
|
||||
`_pyrepl.main` runs its top-level `check()`, which builds a `UnixConsole` and calls `tcsetattr(0, …)`.
|
||||
If stdin is a TTY **and** the process is not in the terminal's foreground process group, that ioctl raises
|
||||
`SIGTTOU` and the process is stopped before argparse ever sees `--help`. Proof it is environmental, not
|
||||
packaging:
|
||||
|
||||
- foreground in a real terminal: `mbro --version` → `mbro (magg) 1.3.0`, exit 0;
|
||||
`mbro --help` → full usage, exit 0.
|
||||
- stdin redirected (`< /dev/null`): both exit 0.
|
||||
- Nothing in `packages/magg/package.nix` is involved (`patchPhase` was a no-op; the shipped
|
||||
`arepl.py` is byte-identical upstream source).
|
||||
|
||||
Suggested upstream/CPython-level follow-up (out of scope for this overlay): import
|
||||
`_pyrepl.constants`/`_pyrepl.unix_console` instead of `_pyrepl.main`, or guard the import.
|
||||
|
||||
## 5. Metadata audit
|
||||
|
||||
```console
|
||||
$ nix eval --json .#magg.meta | ...
|
||||
description : "MCP aggregator server that manages, aggregates and proxies other MCP servers
|
||||
so LLMs can discover, add and manage tools at runtime" (130 chars, <= 140)
|
||||
homepage : https://github.com/sitbon/magg
|
||||
changelog : https://github.com/sitbon/magg/releases
|
||||
license : spdxId = AGPL-3.0-or-later, free = true (= lib.licenses.agpl3Plus)
|
||||
mainProgram : magg
|
||||
sourceProvenance : [ { isSource = true, shortName = "fromSource" } ]
|
||||
platforms : 79 entries, x86_64-linux = True, aarch64-linux = True, aarch64-darwin = True
|
||||
available/broken/disabled : true / false / false
|
||||
|
||||
$ nix eval --json .#magg.passthru | ...
|
||||
category : "MCP Servers"
|
||||
updateScript : ["nix-update","--flake",".#magg"]
|
||||
```
|
||||
|
||||
All requested metadata criteria are met. Cross-checked against the upstream source in the store
|
||||
(`/nix/store/5ddzskmb15i6lnsv6khjzxa8gzz4ad80-source/pyproject.toml`):
|
||||
|
||||
| upstream | value | derivation |
|
||||
| --- | --- | --- |
|
||||
| `version` | `1.3.0` | `version = "1.3.0"` ✔ |
|
||||
| `license = {text = "AGPL-3.0-or-later"}` + classifier `…General Public License v3 or later (AGPLv3+)` | AGPL-3.0-or-later | `license = lib.licenses.agpl3Plus` ✔ |
|
||||
| `[project.scripts] magg`, `mbro` | 2 scripts | both installed, `mainProgram = "magg"` ✔ |
|
||||
| `requires-python = ">=3.12"` | built with python3.14.7 from nixpkgs ✔ |
|
||||
|
||||
`platforms = lib.platforms.all` matches the convention used by the other pure-Python packages in this repo
|
||||
(`desloppify`, `graphify`, `haivemind`, `nftables-analyzer`, `relay-free-llm`).
|
||||
|
||||
## 6. Upstream-pinning audit
|
||||
|
||||
```console
|
||||
$ curl -sS https://api.github.com/repos/sitbon/magg/releases/latest
|
||||
tag_name: v1.3.0 name: 🧲 Magg Release v1.3.0 published_at: 2026-09-26T16:29:41Z prerelease: False
|
||||
|
||||
$ git ls-remote --tags https://github.com/sitbon/magg | sed 's#.*refs/tags/##' | grep -v '\^{}' | sort -V
|
||||
latest-publish latest-release root
|
||||
magg/v0.3.6.30 … magg/v0.5.1.53
|
||||
v0.6 v0.6.0 v0.6.1 v0.7 v0.7.0 v0.7.1 v0.8 v0.8.0 v0.9 v0.9.0 v0.9.1
|
||||
v0.10 v0.10.0 v0.10.1 v1.1 v1.1.0 v1.2 v1.2.0 v1.2.1 v1.3 v1.3.0
|
||||
|
||||
$ git ls-remote --tags https://github.com/sitbon/magg | grep -E 'v1\.3'
|
||||
1b18b87fdcda9628381888aea25fefa60fe1f923 refs/tags/v1.3
|
||||
cc9963ea784fcc2e465c318ab9f0f24e5059c1d1 refs/tags/v1.3.0
|
||||
1b18b87fdcda9628381888aea25fefa60fe1f923 refs/tags/v1.3.0^{}
|
||||
|
||||
$ nix eval --raw .#magg.src.rev ; nix eval --raw .#magg.src.hash
|
||||
v1.3.0
|
||||
sha256-Dj8f+MwefUD5wk4JFTkrC72QGqfJoWQd8ToOeNI6rmM=
|
||||
|
||||
$ nix-prefetch-url --unpack https://github.com/sitbon/magg/archive/v1.3.0.tar.gz
|
||||
0qxf7b97h3isy4fn98f9lwd91g8b5cwia2afqbwl0z8yrkw1ygqf
|
||||
$ nix hash convert --hash-algo sha256 --to sri 0qxf7b97h3isy4fn98f9lwd91g8b5cwia2afqbwl0z8yrkw1ygqf
|
||||
sha256-Dj8f+MwefUD5wk4JFTkrC72QGqfJoWQd8ToOeNI6rmM= # == declared src.hash ✔
|
||||
```
|
||||
|
||||
- **No newer release exists**: `v1.3.0` is both the GitHub `releases/latest` and the highest dotted tag.
|
||||
The pin is current — nothing to flag.
|
||||
- The independently recomputed SRI hash of the `v1.3.0` GitHub tarball is **identical** to the declared
|
||||
`src.hash`, so the hash corresponds to the tag content (and Nix's fixed-output validation agreed during
|
||||
the §3 rebuild).
|
||||
- The derivation's warning comment about alias tags is accurate: `v1.3` peels to the same commit as
|
||||
`v1.3.0` (`1b18b87fd…`), and `latest-publish` / `latest-release` / `root` / `magg/v0.5.1.53`-style tags
|
||||
all exist and would confuse a naive tag picker.
|
||||
|
||||
## 7. Formatting / lint
|
||||
|
||||
`nix flake check` (the repo's documented formatting entry point) was **not** run: blueprint registers every
|
||||
package as a check (`checks.x86_64-linux.pkgs-*`, 36 of them), so it would build the entire overlay, and it
|
||||
additionally aborts on the pre-existing x86_64-darwin failure (§9). The repo's own formatter was instead run
|
||||
in CI mode, scoped to the changed files, inside a scratch copy so nothing on disk could be rewritten:
|
||||
|
||||
```console
|
||||
$ nix build --no-link --print-out-paths .#formatter.x86_64-linux
|
||||
/nix/store/b6mf3mzvln2igb244baas9vi6pywa05x-nixfmt-tree-2.6.0 # treefmt v2.6.0, config = treefmt.toml (nixfmt)
|
||||
|
||||
$ mkdir /tmp/fmtcheck && cp treefmt.toml packages/magg/*.nix /tmp/fmtcheck/
|
||||
$ cd /tmp/fmtcheck && treefmt --ci --no-cache --tree-root /tmp/fmtcheck --walk filesystem .
|
||||
traversed 3 files
|
||||
emitted 2 files for processing
|
||||
formatted 2 files (0 changed) in 292ms
|
||||
treefmt_ci_exit=0
|
||||
```
|
||||
|
||||
`packages/magg/package.nix` and `packages/magg/default.nix` are **format-clean** (0 files changed, exit 0)
|
||||
under the repo's pinned nixfmt.
|
||||
|
||||
## 8. Doc consistency
|
||||
|
||||
`README.md:29`:
|
||||
|
||||
```
|
||||
| `magg` | MCP aggregator / meta-MCP server that aggregates, proxies and manages other MCP servers
|
||||
so agents can discover and manage tools at runtime, ships `magg` and `mbro` | MCP Servers |
|
||||
```
|
||||
|
||||
- Category column is `MCP Servers`, matching `passthru.category = "MCP Servers"` ✔
|
||||
- Local alphabetical slot is correct: `hipengine → magg → marmel` ✔
|
||||
- Caveat (pre-existing, not introduced here): the README table is **not globally sorted** — e.g.
|
||||
`agnix, awg-tool, awgen, aionui, …` and `…, skillsmcp, kubernetes-mcp-server, kyojin, …`. The `magg`
|
||||
row is placed correctly with its immediate neighbours; the overall table ordering is a separate
|
||||
pre-existing cleanup.
|
||||
|
||||
`AGENTS.md:307` (Package-Specific Notes, inserted directly above the `mcp-gateway` note):
|
||||
|
||||
> **magg**: Python/hatchling package built with `python3Packages.buildPythonApplication`; tagged releases
|
||||
> mean plain `nix-update --flake .#magg` works, but upstream also publishes alias/junk tags (`v1.3`,
|
||||
> `latest-publish`, `root`) so verify the picked tag on bump; `checkPhase` runs pytest with
|
||||
> `-m "not integration"` because the integration-marked tests need a live server
|
||||
|
||||
Every claim is accurate and independently confirmed: hatchling build-system (§5/§3), `updateScript ==
|
||||
["nix-update","--flake",".#magg"]` (§5), the alias/junk tags really exist (§6), and the marker filter is
|
||||
present in `checkPhase` with exactly 3 tests deselected (§3).
|
||||
|
||||
## 9. Pre-existing environment issues (not caused by this change)
|
||||
|
||||
1. `nix flake show .` / anything that evaluates all systems fails with:
|
||||
|
||||
```
|
||||
error: Nixpkgs 26.11 has dropped support for x86_64-darwin.
|
||||
```
|
||||
|
||||
Reproduced with an unrelated package to prove it is repo-wide and pre-existing:
|
||||
|
||||
```console
|
||||
$ nix eval --raw --impure --expr 'let f = builtins.getFlake (toString ./.); in f.packages.x86_64-darwin.stakpak.pname'
|
||||
error: Nixpkgs 26.11 has dropped support for x86_64-darwin.
|
||||
```
|
||||
|
||||
Unrelated to `magg` (it is a nixpkgs-unstable policy change affecting every attr in this flake).
|
||||
2. `nix build .#magg --check` is not a valid flag on Nix 2.34; use `--rebuild` (see §3).
|
||||
3. The `mbro` TTY/SIGTTOU import-time hang described in §4 is upstream code.
|
||||
|
||||
## 10. Non-blocking nits for the coder/fix task
|
||||
|
||||
1. `packages/magg/package.nix` comment: "so the other 332 tests all run" — measured reality is
|
||||
`335 collected / 3 deselected / 332 selected`, of which **3 are skipped upstream-side** →
|
||||
`329 passed`. Consider "332 selected, 329 passed, 3 skipped by upstream capability guards".
|
||||
2. `README.md` / `AGENTS.md` edits are unstaged and `docs/*.md` untracked; stage them with the package when
|
||||
committing (§1).
|
||||
3. Cosmetic: the README table's global sort order is inconsistent (pre-existing).
|
||||
|
||||
## 11. Non-modification proof
|
||||
|
||||
```console
|
||||
$ sha256sum -c /tmp/protected_baseline.txt
|
||||
packages/magg/package.nix: OK
|
||||
packages/magg/default.nix: OK
|
||||
README.md: OK
|
||||
AGENTS.md: OK
|
||||
flake.lock: OK
|
||||
```
|
||||
|
||||
No `git add`, no `git commit`, no source edits were performed by this verification.
|
||||
|
||||
---
|
||||
|
||||
## Verdict
|
||||
|
||||
| Check | Result |
|
||||
| --- | --- |
|
||||
| 1. `packages/magg/` staged in git index | **PASS** (already staged; `git add` not needed) |
|
||||
| 2. Attribute exists via blueprint `perSystem` and evaluates | **PASS** (`.#magg`, `.#packages.x86_64-linux.magg`, `checks.…pkgs-magg`) |
|
||||
| 3. Real rebuild, tests genuinely run and pass | **PASS** (`--rebuild`; 329 passed, 3 skipped, 3 deselected, 0 failed; exit 0) |
|
||||
| 4. Binaries smoke-tested + `mainProgram`/`nix run` | **PASS** (`magg`/`mbro` `--version` & `--help` exit 0; `nix run .#magg -- --help` exit 0) |
|
||||
| 5. Metadata audit | **PASS** (desc 130 chars, agpl3Plus, homepage+changelog, mainProgram=magg, platforms incl. x86_64-linux, fromSource, category "MCP Servers", updateScript present) |
|
||||
| 6. Upstream pinning | **PASS** (v1.3.0 is latest release; src hash independently reproduced) |
|
||||
| 7. Formatting | **PASS** (treefmt/nixfmt `--ci`: 2 files, 0 changed) |
|
||||
| 8. Doc consistency | **PASS** (README row correct local slot + category; AGENTS.md note accurate) |
|
||||
|
||||
**PASS** — no blocking defects found in `packages/magg/package.nix` or `packages/magg/default.nix`.
|
||||
@@ -1,308 +0,0 @@
|
||||
# Build/packaging requirements: `sitbon/magg`
|
||||
|
||||
Companion to `docs/research_magg_upstream.md` (upstream fact sheet). This file answers only
|
||||
the build/packaging questions an implementer needs answered before picking a build helper.
|
||||
|
||||
Evidence snapshot (all verified, nothing inferred):
|
||||
|
||||
| item | value | source |
|
||||
| --- | --- | --- |
|
||||
| upstream | <https://github.com/sitbon/magg>, default branch `main`, head tree `dafa9c9ccbfc7209f7bd8e5f303d51598d19f59c` | `GET /repos/sitbon/magg/git/trees/main?recursive=1` (146 entries) |
|
||||
| latest release / PyPI | `v1.3.0` (published 2026-09-26) == PyPI `magg` 1.3.0 | `GET /repos/sitbon/magg/releases/latest`, `GET /pypi/magg/json` |
|
||||
| language | Python only (no Rust/Go/Node sources, no `Makefile`, no `Cargo.toml`, no `go.mod`, no `package.json` anywhere in the 146-entry tree) | git tree listing |
|
||||
| nixpkgs pin used for version checks | `nixos-unstable` rev `eaad089433ca2bb662274377d33df3d0e51ef28b` (== this overlay's `nixpkgs` **and** `nixpkgs-latest`, see `flake.lock` nodes `nixpkgs`/`nixpkgs-latest`) | `flake.lock` |
|
||||
|
||||
---
|
||||
|
||||
## 1. Which nixpkgs build helper
|
||||
|
||||
**`python3Packages.buildPythonApplication` with `pyproject = true` and `build-system = [ hatchling ]`.**
|
||||
|
||||
Evidence:
|
||||
|
||||
- `pyproject.toml:120-122` — `[build-system] requires = ["hatchling"] / build-backend = "hatchling.build"`.
|
||||
The pin is unpinned (`"hatchling"`, no version specifier), so no `sed` pin-relax hack like
|
||||
`packages/graphify/package.nix:48-50` is needed.
|
||||
- Pure-python wheel: PyPI ships `magg-1.3.0-py3-none-any.whl` (62 files, no compiled extension of its own)
|
||||
and an sdist `magg-1.3.0.tar.gz` (121 entries).
|
||||
- Version is static in `pyproject.toml` (no `dynamic = ["version"]`, no `uv-dynamic-versioning`), so no
|
||||
`writableTmpDirAsHomeHook`/setuptools-scm dance is required.
|
||||
- None of the other helpers apply: no `Cargo.toml` (→ not `buildRustPackage`), no `package.json`/`bun.lock`
|
||||
(→ not `buildNpmPackage`/`bun2nix`), no `go.mod`/`go.sum` (→ not `buildGoModule`), no `Makefile`
|
||||
(→ not `stdenv.mkDerivation`).
|
||||
- In-repo precedent to copy verbatim: `packages/skillsmcp/package.nix:7-30` already does
|
||||
`python3Packages.buildPythonApplication` + `build-system = [ hatchling ]` + `python3Packages.fastmcp`.
|
||||
`packages/nftables-analyzer/package.nix` and `packages/freetoken/package.nix:82-104` are the same shape.
|
||||
|
||||
Secondary option (deliberately **not** recommended): the repo commits `uv.lock`, so `uv2nix` /
|
||||
`pyproject-nix` (`pyproject.buildApplication` + `pyparsix`/`fetchPypiTree`) is technically possible.
|
||||
It buys nothing here because every dependency exists in nixpkgs (see §3), and the overlay has no
|
||||
`uv2nix` precedent.
|
||||
|
||||
## 2. Lockfiles
|
||||
|
||||
- **Committed: `uv.lock`** (387 038 bytes at head, also included in the PyPI sdist).
|
||||
Header: `version = 1`, `revision = 3`, `requires-python = ">=3.12"`, 92 resolved `[[package]]`
|
||||
entries, all from `https://pypi.org/simple` with sdist+wheel hashes.
|
||||
- **Not present:** `Cargo.lock`, `package-lock.json`, `bun.lock`, `pnpm-lock.yaml`, `go.sum`,
|
||||
`requirements.txt`, `poetry.lock`.
|
||||
- Consequence: there is **no `cargoHash` / `npmDepsHash` / `vendorHash` equivalent to fill in** when using
|
||||
`buildPythonApplication` — dependencies come from `python3Packages`, so the only hash in the
|
||||
derivation is the `src` hash. The offline build is automatic (no network at build time).
|
||||
`uv.lock` would only matter for a `uv sync --locked`-based build (uv2nix route), where each of the
|
||||
92 locked artifacts must be prefetched — another argument for the nixpkgs-deps route.
|
||||
|
||||
## 3. Toolchain version requirements
|
||||
|
||||
Declared upstream:
|
||||
|
||||
- `pyproject.toml:4` → `requires-python = ">=3.12"`; classifiers list 3.12 / 3.13 / 3.14.
|
||||
- `.python-version` → `3.14` (upstream's own preferred interpreter).
|
||||
- `.github/workflows/test.yml` matrix → `python-version: ['3.12', '3.13', '3.14']`, installed via
|
||||
`astral-sh/setup-uv@v8.2.0` + `uv python install`.
|
||||
- No Rust / Go / Node toolchain requirement. `nodejs`/`npm` appear only in `dockerfile:10`
|
||||
(`apk add … nodejs npm`) so that *runtime*-mounted `npx` MCP servers work inside the container image —
|
||||
not a build requirement.
|
||||
|
||||
Fit against this overlay's pinned nixpkgs (`eaad0894…`):
|
||||
|
||||
- `pkgs/top-level/all-packages.nix:4484` at that rev says `python3 = python314;`, and
|
||||
`pkgs/development/interpreters/python/cpython/` ships `3.11 … 3.15`. So the default `python3Packages`
|
||||
already matches upstream's `.python-version = 3.14`. **No `nixpkgs-latest`, `nixpkgs-rust195` or
|
||||
`nixpkgs-torch211` instance is needed.**
|
||||
|
||||
Direct-dependency floors vs. what the pinned nixpkgs ships (versions read from
|
||||
`pkgs/development/python-modules/<name>/default.nix` at `eaad0894…`):
|
||||
|
||||
| magg requirement (`pyproject.toml:31-42`) | nixpkgs attr | nixpkgs version | ok |
|
||||
| --- | --- | --- | --- |
|
||||
| `fastmcp>=3.4,<4` | `fastmcp` (thin wrapper over `fastmcp-slim`) | 3.4.7 | ✅ |
|
||||
| `mcp>=1.28` | `mcp` | 1.29.0 | ✅ |
|
||||
| `aiohttp>=3.12.13` | `aiohttp` | 3.14.3 | ✅ |
|
||||
| `art>=6.5` | `art` | 6.5 | ✅ (exactly at the floor) |
|
||||
| `cryptography>=45.0.4` | `cryptography` | 50.0.0 | ✅ |
|
||||
| `pydantic>=2.11.7` | `pydantic` | 2.13.4 | ✅ |
|
||||
| `pydantic-settings>=2.10.0` | `pydantic-settings` | 2.12.0 | ✅ |
|
||||
| `pyjwt>=2.10.1` | `pyjwt` | 2.13.0 | ✅ |
|
||||
| `prompt-toolkit>=3.0.51` | `prompt_toolkit` | 3.0.52 | ✅ |
|
||||
| `rich>=14.0.0` | `rich` | 15.0.0 | ✅ |
|
||||
| `watchdog>=6.0.0` | `watchdog` | 6.0.0 | ✅ (exactly at the floor) |
|
||||
| test extra: `pytest>=8.4`, `pytest-asyncio>=1.0` | `pytest`, `pytest-asyncio` | 9.1.1, 1.4.0 | ✅ |
|
||||
|
||||
All 11 runtime deps + both test deps exist as `pkgs/development/python-modules/<name>/`. `fastmcp-slim`
|
||||
is present and its own `doCheck = pythonAtLeast "3.14"` confirms 3.14 support.
|
||||
|
||||
**Bonus evidence that the nixpkgs dep set reproduces upstream's locked environment** — the versions
|
||||
`uv.lock` resolved on upstream's own machine are the same ones nixpkgs ships:
|
||||
|
||||
| package | `uv.lock` @ head | nixpkgs `eaad0894…` |
|
||||
| --- | --- | --- |
|
||||
| pytest | 9.1.1 | 9.1.1 |
|
||||
| pytest-asyncio | 1.4.0 | 1.4.0 |
|
||||
| mcp | 1.29.0 | 1.29.0 |
|
||||
| rich | 15.0.0 | 15.0.0 |
|
||||
| aiohttp | 3.14.3 | 3.14.3 |
|
||||
| art | 6.5 | 6.5 |
|
||||
| watchdog | 6.0.0 | 6.0.0 |
|
||||
| fastmcp | 3.4.5 | 3.4.7 (only drift, still inside `<4`) |
|
||||
|
||||
This is a good signal that `doCheck = true` is realistic rather than optimistic.
|
||||
|
||||
Undeclared-but-imported modules to keep in mind (they arrive transitively via `fastmcp`/`mcp`/`rich`,
|
||||
so no extra `dependencies` entry is normally needed, but they explain a `pythonImportsCheck` failure if
|
||||
a transitive dep is ever cut): `httpx`, `pygments`, `readline`/`tomllib` (stdlib).
|
||||
|
||||
## 4. Pre-build steps / build-time network
|
||||
|
||||
**None.** Verified:
|
||||
|
||||
- No frontend/JS asset, no protobuf/gRPC/ANTLR codegen, no WASM, no `Makefile`, no `build.sh`,
|
||||
no asset download script in the tree. `scripts/` holds only `bump_version.py` and
|
||||
`validate_manual_release.py` (release tooling; CI uses the former to check `server.json` ↔
|
||||
`pyproject.toml` version parity — irrelevant to the build).
|
||||
- Upstream's own build is `uv sync --locked` + `uv build`/`uv publish`
|
||||
(`.github/workflows/publish.yml:86-110`), i.e. plain hatchling.
|
||||
- Hatchling is a pure-python backend; with `dependencies` supplied from `python3Packages` the build is
|
||||
fully offline. Nothing to prefetch (no `cargoHash`-style extra fetch).
|
||||
- The only "asset" handling is hatchling copying non-`.py` files that live inside the `magg/` package
|
||||
directory (see §6). `[tool.hatch.build.targets.sdist]` (`pyproject.toml:100-119`) only affects the
|
||||
sdist, not the wheel.
|
||||
|
||||
## 5. Test suite & `doCheck` policy
|
||||
|
||||
Upstream has a real suite: `test/magg/*.py` — 35 files, 328 `def test_*` (180 `async def`).
|
||||
CI (`.github/workflows/test.yml`) runs `uv sync --all-groups --locked` then `uv run pytest -v`
|
||||
(no `-m` filter) on 3.12/3.13/3.14; last run of that workflow: **success** (2026-09-26T16:28Z,
|
||||
`GET /actions/workflows/test.yml/runs`). No `conftest.py`; `[tool.pytest.ini_options]`
|
||||
(`pyproject.toml:86-89`) declares only the `integration` marker.
|
||||
|
||||
Sandbox-safety audit of the suite:
|
||||
|
||||
- **No outbound network in tests.** The discovery clients that *do* hit the network
|
||||
(`magg/discovery/search.py:32` `registry.modelcontextprotocol.io`, `:144` `glama.ai`,
|
||||
`:264` `api.github.com`, `:318` `registry.npmjs.org`) are exercised only through canned fixtures
|
||||
(`test/magg/test_registry_search.py:7-56` `SAMPLE_RESPONSE`) and `monkeypatch`ed methods
|
||||
(`test/magg/test_cli_fixes.py:118-124`). No `httpx`/`aiohttp`/`requests` call appears in `test/`.
|
||||
- **Loopback only.** The two e2e tests bind `localhost:54322` (hard-coded,
|
||||
`test/magg/test_e2e_simple.py:65,91`, `test/magg/test_e2e_mounting.py:129`) and poll for up to 10 s.
|
||||
Loopback works in the Nix sandbox, but the fixed port + wall-clock polling is the main flake risk.
|
||||
- **Subprocess tests need `python` on PATH**: `test/magg/test_integration.py:37` and
|
||||
`test/magg/test_mounting_real.py` spawn `python <generated server.py>` stdio MCP backends;
|
||||
`test/magg/test_server_robustness.py:374` and `test/magg/test_cli_fixes.py:140` run
|
||||
`sys.executable -m magg …`. `buildPythonPackage`'s `checkPhase` runs inside its venv, so `python`
|
||||
resolves and `magg` is importable — satisfied automatically.
|
||||
- **`$HOME` is read, not written**: `test/magg/test_config.py:95`, `test_auth.py:25`,
|
||||
`test_config_safety.py:76` assert `Path.home()/".magg"` / `Path.home()/".ssh"/"magg"` defaults;
|
||||
`test_cli_fixes.py:25` monkeypatches `HOME` to a tmp dir. Scratch space is
|
||||
`tempfile.TemporaryDirectory()` (→ `$TMPDIR`, writable in the sandbox).
|
||||
- **`sh` is required**: `test/magg/test_cli_fixes.py:78` runs `subprocess.run(["sh", "-c", …])`
|
||||
(bash provides `bin/sh` in the build env — fine).
|
||||
- Timing-sensitive groups: `test_config_reload.py` (watchdog/polling), `test_server_robustness.py`
|
||||
(hung-backend timeouts).
|
||||
|
||||
Recommended policy (mirrors the `packages/marmel/package.nix:33-60` comment style — explain each
|
||||
workaround and what would let it be dropped):
|
||||
|
||||
```nix
|
||||
nativeCheckInputs = with python3Packages; [ pytestCheckHook pytest-asyncio ];
|
||||
|
||||
# Upstream runs the whole suite (`.github/workflows/test.yml`: `uv run pytest -v`), but the three
|
||||
# `integration`-marked tests (test/magg/test_basic.py:97, test_e2e_mounting.py:18,
|
||||
# test_e2e_simple.py:16) spawn real stdio/HTTP backends and hard-code localhost:54322 with a
|
||||
# 10 s poll loop (test_e2e_simple.py:65,91), which is the only flake source in an otherwise
|
||||
# network-free suite (registry/glama/github/npm clients are monkeypatched in the unit tests).
|
||||
# Drop this once upstream picks an ephemeral port.
|
||||
pytestOptions = [ "-m" "not integration" ];
|
||||
|
||||
preCheck = ''
|
||||
# pydantic-settings defaults read $HOME (magg/settings.py:72,203) and the config-reload tests
|
||||
# poll files under $TMPDIR; keep both inside the writable sandbox tmp dir.
|
||||
export MAGG_AUTO_RELOAD=false
|
||||
mkdir -p /tmp/magg-check
|
||||
export TMPDIR=/tmp/magg-check
|
||||
export HOME=/tmp/magg-check
|
||||
'';
|
||||
|
||||
pythonImportsCheck = [ "magg" ]; # import magg pulls fastmcp/mcp/aiohttp/cryptography
|
||||
```
|
||||
|
||||
Notes for the implementer:
|
||||
|
||||
- `pytest-asyncio` is mandatory in `nativeCheckInputs`: essentially every async test carries
|
||||
`@pytest.mark.asyncio` (178 marker lines for 180 `async def test_*` definitions) and pytest-asyncio
|
||||
defaults to strict mode, so unmarked async tests are only skipped. The 2 apparently unmarked ones are
|
||||
therefore silently skipped upstream too — do not add `-W error`.
|
||||
- Only the `[project.optional-dependencies] test` extra is needed; the `[dependency-groups] dev`
|
||||
group additionally pulls `keyring`, `anthropic`, `ruff` — do **not** add those.
|
||||
- If the suite turns out to be flaky in practice, the repo-wide fallback is
|
||||
`doCheck = false; pythonImportsCheck = [ "magg" ];` as in `packages/skillsmcp/package.nix:33-34`.
|
||||
|
||||
## 6. Install phase
|
||||
|
||||
Standard wheel install — **no custom `installPhase` needed.**
|
||||
|
||||
- The published wheel contains exactly `magg/**` + `magg-1.3.0.dist-info/` (62 files), so
|
||||
`buildPythonApplication` puts `$out/lib/python3.14/site-packages/magg/` plus two console scripts
|
||||
from `entry_points.txt`: `magg = magg.cli:main`, `mbro = magg.mbro.cli:main`
|
||||
(same as `pyproject.toml:65-67`) → `$out/bin/magg`, `$out/bin/mbro`. Set `mainProgram = "magg";`.
|
||||
- **Runtime-loaded data files live inside the package dir and must not be stripped**:
|
||||
`magg/contrib/magg.mbro`, `magg/contrib/readme.md`, `magg/contrib/kit.d/example.json` (confirmed
|
||||
present in the wheel). `magg/contrib` is a **namespace package with no `__init__.py`**; hatchling
|
||||
still ships it, and it is discovered at runtime via `magg/util/paths.py:12-15`
|
||||
(`contrib.__path__`), which feeds the `MAGG_PATH` search list at `magg/settings.py:203`
|
||||
(`./.magg`, `~/.magg`, contrib dirs) used for `config.json` and `kit.d/`.
|
||||
⇒ Do not add `disallowedReReferences`/`find -delete` rules for `*.json`/`*.mbro`, and do not
|
||||
"fix" the missing `__init__.py`.
|
||||
- Everything else in the repo is *not* installed and must not be: `server.json` (MCP-registry manifest),
|
||||
`compose.yaml`, `dockerfile`, `docs/`, `examples/`, `scripts/`, and `etc/glama-mcp-api.json`
|
||||
(a static API dump — `grep -rn "glama-mcp-api" magg/` has no hits; the live code calls
|
||||
`https://glama.ai/api/mcp/v1/servers` instead).
|
||||
- No `share/` payloads, no shell completions, no man pages, no `py.typed`.
|
||||
- Hatchling needs `readme.md` and `license.md` present (`pyproject.toml:6-7`); both are in git and in
|
||||
the sdist.
|
||||
|
||||
## 7. Runtime dependencies
|
||||
|
||||
- The Python interpreter wrapper comes from `buildPythonApplication` (shebang points at
|
||||
`python3`'s `$out`), plus the 11 declared python deps and their transitive closure
|
||||
(`openssl` via `cryptography`, `readline` — `magg/mbro/arepl.py` imports `readline`, and nixpkgs'
|
||||
CPython already carries it, `pcre2`/`multidict`/`yarl` C extensions from `aiohttp`).
|
||||
- **TLS trust store** for the search features: `magg/discovery/search.py:40` builds
|
||||
`aiohttp.ClientSession(trust_env=True)` against `registry.modelcontextprotocol.io`, `glama.ai`,
|
||||
`api.github.com`, `registry.npmjs.org`. nixpkgs' OpenSSL/CPython resolve the bundle from
|
||||
`SSL_CERT_FILE` / `/etc/ssl/certs`, so it works out of the box on NixOS; on non-NixOS hosts users
|
||||
need `SSL_CERT_FILE` (same class of issue documented in `packages/marmel/package.nix:33-45`).
|
||||
Adding `cacert` to the *runtime* wrapper is optional, not required.
|
||||
- **Writable state at runtime**: `CatalogManager` writes `<cwd>/.magg/search_cache.json`
|
||||
(`magg/discovery/catalog.py:15-16`) and the config lives at `./.magg/config.json` or
|
||||
`~/.magg/config.json` (`magg/settings.py:203`, `MAGG_CONFIG_PATH`, `MAGG_PATH`, `MAGG_READ_ONLY`).
|
||||
Worth a `meta` note / NixOS-module hint, nothing build-time.
|
||||
- **Optional external programs** (only when a user mounts such a server): `npx`/`node`, `uvx`,
|
||||
`python` for stdio backends — spawned by `fastmcp`, not by magg itself
|
||||
(`grep -rn "subprocess|Popen" magg/` → no hits). Upstream's image installs `nodejs`/`npm`
|
||||
(`dockerfile:10`) for that reason. Not a build or hard runtime dep.
|
||||
- `magg --version` reads `importlib.metadata.version("magg")` (`magg/__init__.py:9-12`) → works
|
||||
because the dist-info is installed; no source-tree assumption.
|
||||
|
||||
## 8. Prior art
|
||||
|
||||
**`magg` is not packaged in nixpkgs, and upstream ships no Nix expression.**
|
||||
|
||||
- Complete (non-truncated) listing of `pkgs/development/python-modules` at `eaad0894…` → 9949 entries,
|
||||
none named `magg` (nearest neighbours in that listing: `magic`, `magic-filter`, `magicgui`,
|
||||
`magic-wormhole`, `magika`).
|
||||
- `pkgs/top-level/all-packages.nix` at that rev → `grep -i magg` returns nothing (so it is not a
|
||||
top-level tool either).
|
||||
- The magg repo (146-entry tree) contains no `.nix` file and no `flake.nix`; upstream's documented
|
||||
install paths are `uv tool install magg`, `uvx --from git+https://github.com/sitbon/magg.git magg`,
|
||||
`pip`/`poetry`, and GHCR Docker images.
|
||||
- Nothing reusable to mirror; write from scratch. Best in-repo template:
|
||||
`packages/skillsmcp/package.nix` (hatchling + `python3Packages.fastmcp`), with
|
||||
`packages/nftables-analyzer/package.nix` as the `fetchFromGitHub` + dated-version variant.
|
||||
|
||||
## 9. Update mechanism
|
||||
|
||||
Use the plain form (repo-wide list style, cf. `packages/agnix/package.nix:34-38`):
|
||||
|
||||
```nix
|
||||
passthru.updateScript = [
|
||||
"nix-update"
|
||||
"--flake"
|
||||
".#magg"
|
||||
];
|
||||
```
|
||||
|
||||
- Upstream **does** tag releases: `v1.3.0` (2026-09-26) matching PyPI `magg 1.3.0`, and `pyproject.toml`
|
||||
carries a static `version`, so nix-update's default version detection works — no
|
||||
`--version=branch=main` (that form is only used in this repo for untagged upstreams, e.g.
|
||||
`packages/ds4/package.nix:78`, `packages/skillsmcp/package.nix:39`).
|
||||
- **Caveat if you use `fetchFromGitHub` + `tag = "v${version}"`:** the full tag list (30 tags) also
|
||||
contains two-part alias tags — `v1.3`, `v1.2`, `v1.1`, `v0.10`, `v0.9`, `v0.8`, `v0.7`, `v0.6` — plus
|
||||
non-version tags `root`, `latest-release`, `latest-publish` and legacy `magg/v0.5.1.53`-style tags, so
|
||||
a tag-based bump can pick the `v1.3` alias (a valid tag, but an ugly version string) or a junk tag.
|
||||
Two clean options:
|
||||
1. **Preferred:** build from PyPI — `src = fetchPypi { pname = "magg"; inherit version; format = "pyproject"; }`.
|
||||
The sdist is complete (121 entries: `magg/`, `test/`, `pyproject.toml`, `uv.lock`, `readme.md`,
|
||||
`license.md`), so `checkPhase` still works, and nix-update's PyPI updater resolves clean versions
|
||||
deterministically. Ready-made hash for 1.3.0:
|
||||
`sha256-2jzBtka4YWp4yEGvJorHN/JQpI6sWCrmRu/TtvRnqpU=`
|
||||
(sha256 `da3cc1b646b8616a78c841af268ac737f250a48eac582ae646efd3b6f467aa95`).
|
||||
2. Keep `fetchFromGitHub` (rev = tag `v1.3.0`) and pin the updater with `--version=tag`, then verify
|
||||
the picked version is the 3-part tag.
|
||||
|
||||
---
|
||||
|
||||
### One-paragraph summary for the implementer
|
||||
|
||||
`magg` is a pure-python hatchling project: use `python3Packages.buildPythonApplication` with
|
||||
`pyproject = true`, `build-system = [ python3Packages.hatchling ]`, and all 11 runtime deps taken from
|
||||
`python3Packages` (all present and new enough on the overlay's pinned `nixos-unstable`, whose default
|
||||
`python3` is 3.14 — exactly upstream's `.python-version`). No lockfile hash, no vendorHash, no
|
||||
pre-build codegen, no asset fetch, no custom install phase; two console scripts (`magg`, `mbro`) and
|
||||
the `magg/contrib/**` data files come along via the wheel. Run the test suite (`pytest` +
|
||||
`pytest-asyncio`) with `-m "not integration"` and a tmp `$HOME`/`$TMPDIR` in `preCheck`, keep
|
||||
`pythonImportsCheck = [ "magg" ]`, set `mainProgram = "magg"`, license `agpl3Plus`
|
||||
(`license = {text = "AGPL-3.0-or-later"}`), and update with plain `nix-update --flake .#magg`
|
||||
(prefer `fetchPypi` over `fetchFromGitHub` because upstream also publishes `v1.3`-style alias tags).
|
||||
|
||||
MISSION COMPLETE (t-002)
|
||||
@@ -1,343 +0,0 @@
|
||||
# Upstream fact sheet: `sitbon/magg`
|
||||
|
||||
Task: t-001 — upstream research for a Nix derivation.
|
||||
Researched: 2026-11-08 (all facts fetched live from GitHub/PyPI on that date).
|
||||
|
||||
**Headline:** The repository **exists and is public**: <https://github.com/sitbon/magg>
|
||||
(GitHub repo id `1005453886`, `private: false`, `archived: false`, 143 stars, 25 forks).
|
||||
It is a **pure-Python, PEP 621 / hatchling / uv** project published to PyPI as `magg`,
|
||||
with GitHub Releases + git tags. Latest release: **v1.3.0**.
|
||||
|
||||
---
|
||||
|
||||
## 1. What is `magg`?
|
||||
|
||||
**Short description for `meta.description`** (129 chars):
|
||||
|
||||
```
|
||||
MCP aggregator server that manages, aggregates and proxies other MCP servers so LLMs can discover, add and manage tools at runtime
|
||||
```
|
||||
|
||||
Alternatives (all sourced verbatim from upstream):
|
||||
|
||||
| Source | Text |
|
||||
| --- | --- |
|
||||
| GitHub repo `description` | `Magg: The MCP Aggregator` |
|
||||
| `pyproject.toml` → `project.description` | `MCP Aggregator` |
|
||||
| `server.json` → `description` | `Aggregates and proxies other MCP servers, letting LLMs discover, add, and manage tools at runtime.` |
|
||||
| `readme.md` (line 12, intro) | `A Model Context Protocol server that manages, aggregates, and proxies other MCP servers, enabling LLMs to dynamically extend their own capabilities.` |
|
||||
| `readme.md` (heading) | `🧲 Magg - The MCP Aggregator` |
|
||||
|
||||
**Longer explanation (upstream's own words, `readme.md` § "What is Magg?"):**
|
||||
Magg is a *meta-MCP server* acting as a central hub for managing multiple MCP servers. It exposes
|
||||
MCP tools that let an LLM search for new MCP servers online, add/configure them dynamically,
|
||||
enable/disable them, aggregate their tools under unified prefixes, and persist configuration
|
||||
across sessions (`.magg/config.json`). Upstream describes it as "a 'package manager for LLM
|
||||
tools' - it lets AI assistants install and manage their own capabilities at runtime". It supports
|
||||
stdio / HTTP / hybrid transports, optional RSA-JWT bearer auth for HTTP mode, dynamic config
|
||||
reload (file watch + SIGHUP), "kits" (bundles of servers), and ships a second CLI, `mbro`
|
||||
("MCP Browser") for interactive inspection.
|
||||
|
||||
Evidence: `https://raw.githubusercontent.com/sitbon/magg/v1.3.0/readme.md`,
|
||||
`https://raw.githubusercontent.com/sitbon/magg/v1.3.0/server.json`,
|
||||
`https://api.github.com/repos/sitbon/magg`.
|
||||
|
||||
---
|
||||
|
||||
## 2. Implementation language & build system
|
||||
|
||||
- **Language: Python only.** GitHub language breakdown returns exactly
|
||||
`{"Python": 739242}` (100 %). Source tree contains only `*.py` + markdown/JSON.
|
||||
Evidence: `https://api.github.com/repos/sitbon/magg/languages`.
|
||||
- **Build system: PEP 621 `pyproject.toml` with the `hatchling` build backend**, project managed
|
||||
with **uv** (a committed `uv.lock` and `.python-version` are present). There is **no**
|
||||
`Cargo.toml`, `package.json`, `go.mod`, `Makefile`, `justfile`, or `setup.py`.
|
||||
Evidence: root listing of tag `v1.3.0` via
|
||||
`https://api.github.com/repos/sitbon/magg/contents/?ref=v1.3.0` and
|
||||
`https://raw.githubusercontent.com/sitbon/magg/v1.3.0/pyproject.toml`.
|
||||
|
||||
Root of `v1.3.0` (full listing):
|
||||
`.env.example`, `.gitignore`, `.python-version`, `compose.yaml`, `contributing.md`, `dockerfile`,
|
||||
`license.md`, `pyproject.toml`, `readme.md`, `security.md`, `server.json`, `uv.lock`,
|
||||
plus dirs `.github/`, `docs/`, `etc/`, `examples/`, `magg/`, `scripts/`, `test/`.
|
||||
|
||||
Key manifest facts (`pyproject.toml` @ v1.3.0):
|
||||
|
||||
```toml
|
||||
[project]
|
||||
name = "magg"
|
||||
version = "1.3.0"
|
||||
requires-python = ">=3.12"
|
||||
description = "MCP Aggregator"
|
||||
license = {text = "AGPL-3.0-or-later"}
|
||||
license-files = ["license.md"]
|
||||
|
||||
[build-system]
|
||||
requires = ["hatchling"]
|
||||
build-backend = "hatchling.build"
|
||||
|
||||
[project.optional-dependencies]
|
||||
test = ["pytest>=8.4.0", "pytest-asyncio>=1.0.0"]
|
||||
|
||||
[tool.pytest.ini_options]
|
||||
markers = ["integration: marks tests as integration tests (deselect with '-m \"not integration\"')"]
|
||||
```
|
||||
|
||||
Runtime dependencies (`[project.dependencies]`, v1.3.0):
|
||||
`fastmcp>=3.4,<4`, `mcp>=1.28`, `aiohttp>=3.12.13`, `pydantic>=2.11.7`,
|
||||
`pydantic-settings>=2.10.0`, `rich>=14.0.0`, `prompt-toolkit>=3.0.51`,
|
||||
`cryptography>=45.0.4`, `pyjwt>=2.10.1`, `watchdog>=6.0.0`, `art>=6.5`.
|
||||
|
||||
Python support: `requires-python = ">=3.12"`; classifiers list CPython 3.12 / 3.13 / 3.14
|
||||
(README prose says "Python 3.12 or higher (3.13+ recommended)"; `.python-version` pins `3.14`
|
||||
for upstream development).
|
||||
|
||||
---
|
||||
|
||||
## 3. Versioning & release state
|
||||
|
||||
**Yes — upstream publishes both GitHub Releases and annotated git tags**, and also publishes to
|
||||
PyPI (`https://pypi.org/project/magg/`, 23 releases; PyPI latest = `1.3.0`, uploaded
|
||||
`2026-09-26T16:29:42Z`, i.e. in lock-step with the GitHub release).
|
||||
|
||||
**Latest release: `v1.3.0`**
|
||||
|
||||
| Field | Value | Evidence |
|
||||
| --- | --- | --- |
|
||||
| Release tag name | `v1.3.0` (`🧲 Magg Release v1.3.0`) | `https://api.github.com/repos/sitbon/magg/releases/latest` |
|
||||
| Tag object (annotated) | `cc9963ea784fcc2e465c318ab9f0f24e5059c1d1` (`type: tag`) | `.../git/refs/tags/v1.3.0` |
|
||||
| **Peeled commit SHA** | **`1b18b87fdcda9628381888aea25fefa60fe1f923`** | `.../commits/1b18b87f…` |
|
||||
| Commit date | `2026-09-26T16:28:09Z` (authored `2026-09-26 09:28:09 -0700`) — "Robustness fixes: config data loss, unmounting, hung backends, CLI and mbro bugs (#21)" | GitHub API / `git log` |
|
||||
| Release created / published | `2026-09-26T16:29:30Z` / `2026-09-26T16:29:41Z`; `prerelease: false`, `draft: false`, `target_commitish: main` | `.../releases/tags/v1.3.0` |
|
||||
| Release assets | `magg-1.3.0-py3-none-any.whl` (143 372 B), `magg-1.3.0.tar.gz` (340 217 B) | same |
|
||||
| Release author | `github-actions[bot]` (automated release on tag) | same |
|
||||
|
||||
Release-asset hashes (computed locally from the GitHub release downloads):
|
||||
|
||||
```
|
||||
sha256 magg-1.3.0.tar.gz da3cc1b646b8616a78c841af268ac737f250a48eac582ae646efd3b6f467aa95
|
||||
sha256 magg-1.3.0-py3-none-any.whl 6360f04b49fdce6d8ec48aa6865848f8a610a60a3e433fcd539383299958c933
|
||||
```
|
||||
|
||||
Tag hygiene (from `https://api.github.com/repos/sitbon/magg/tags?per_page=15`): upstream emits
|
||||
both a patch tag and a minor tag per release, both pointing at the same commit —
|
||||
`v1.3.0` **and** `v1.3` → `1b18b87f…`; `v1.2.1` → `419e8e07…`; `v1.2.0` → `5af7cad8…`;
|
||||
`v1.2` → `419e8e07…`; `v1.1.0`/`v1.1` → `79923f85…`; `v0.10.1`/`v0.10` → `c237d4c1…`; etc.
|
||||
A moving tag **`latest-publish`** also points at `1b18b87f…` (marks the last PyPI publish).
|
||||
⇒ **Use the dotted tag `v1.3.0`** for `src.version`/`rev`.
|
||||
|
||||
Default branch / HEAD (in case `main` is preferred over the tag):
|
||||
|
||||
- Default branch: **`main`**
|
||||
- HEAD: **`dafa9c9ccbfc7209f7bd8e5f303d51598d19f59c`**, committed `2026-09-27T19:05:55Z`
|
||||
("Add security policy"). Verified as a descendant of `v1.3.0` (the only extra commit adds
|
||||
`security.md`), so **`v1.3.0` is the right packaging rev**.
|
||||
- Other branches: `beta` (`774636eb…`, feeds the `ghcr.io/sitbon/magg:beta` image), plus two
|
||||
stale `claude/*` branches.
|
||||
- Repo `pushed_at`: `2026-09-27T19:05:55Z`.
|
||||
|
||||
---
|
||||
|
||||
## 4. License
|
||||
|
||||
**SPDX: `AGPL-3.0-or-later`** → Nix: `meta.licenses = lib.licenses.agpl3Plus;`
|
||||
|
||||
Evidence:
|
||||
- `pyproject.toml`: `license = {text = "AGPL-3.0-or-later"}`, `license-files = ["license.md"]`,
|
||||
classifier `"License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)"`.
|
||||
- `license.md` (34 260 B) is the verbatim **GNU AFFERO GENERAL PUBLIC LICENSE Version 3,
|
||||
19 November 2007** text (incl. the §13 "remote network interaction" clause).
|
||||
- PyPI metadata: `License: AGPL-3.0-or-later`; wheel `METADATA` has
|
||||
`License: AGPL-3.0-or-later` + `License-File: license.md`.
|
||||
- GitHub API reports `spdx_id: "AGPL-3.0"` (GitHub's coarse bucket; the manifest is more precise
|
||||
with `-or-later`).
|
||||
- Dockerfile OCI label: `org.opencontainers.image.licenses=AGPL-3.0-or-later`.
|
||||
|
||||
**Flag:** *not* dual-licensed, but it **is AGPL** — strong copyleft with a network-use clause
|
||||
(free per DFSG, but relevant for redistribution policy). Note the file is `license.md`
|
||||
(lowercase markdown), not `LICENSE`; hatchling ships it into
|
||||
`magg-<ver>.dist-info/licenses/license.md`, so a `fetchPypi`-style build finds it automatically.
|
||||
There is no separate `NOTICE`/dual-license file.
|
||||
|
||||
---
|
||||
|
||||
## 5. Binaries produced (`meta.mainProgram`)
|
||||
|
||||
**Two console scripts** — declared in `pyproject.toml` `[project.scripts]` and confirmed by
|
||||
`magg-1.3.0.dist-info/entry_points.txt` inside the released wheel:
|
||||
|
||||
```ini
|
||||
[console_scripts]
|
||||
magg = magg.cli:main
|
||||
mbro = magg.mbro.cli:main
|
||||
```
|
||||
|
||||
- `meta.mainProgram = "magg";`
|
||||
- Second binary: **`mbro`** (the "MCP Browser" interactive CLI, documented in `docs/mbro.md`).
|
||||
Set `meta.mainProgram` to `magg` and expect both `bin/magg` and `bin/mbro` in the output.
|
||||
- `python -m magg` and `python -m magg.mbro` also work (`magg/__main__.py`,
|
||||
`magg/mbro/__main__.py` exist in the wheel).
|
||||
- Upstream install docs' primary entry point is `uv tool install magg` then `magg serve`.
|
||||
|
||||
---
|
||||
|
||||
## 6. Repo layout relevant to packaging
|
||||
|
||||
- **App is at the repo root, single flat package** — importable package dir `magg/` sits at the
|
||||
top level next to `pyproject.toml` (hatchling auto-detects it; no `[tool.hatch.build]` wheel
|
||||
`packages` override). **No Cargo/npm workspace, no `src/` layout, no sub-crate.**
|
||||
- Package subpackages inside `magg/`: `contrib/`, `discovery/`, `logs/`, `mbro/`, `proxy/`,
|
||||
`server/`, `util/` — 66 files total in `magg/`.
|
||||
- **Package data shipped in the wheel** (must not be stripped): `magg/contrib/magg.mbro`,
|
||||
`magg/contrib/readme.md`, `magg/contrib/kit.d/example.json` (default kit directory).
|
||||
Wheel contains 62 files: 56 `.py` + those 3 data files + `dist-info`.
|
||||
- **`etc/glama-mcp-api.json` (19 729 B) is NOT shipped** in the wheel *or* the sdist — the
|
||||
`[tool.hatch.build.targets.sdist]` include list omits `etc/`. It is a vendored API spec used
|
||||
only for upstream development/discovery. Same for `.github/` (explicitly excluded).
|
||||
- **No git submodules** — `https://raw.githubusercontent.com/sitbon/magg/v1.3.0/.gitmodules` → HTTP 404.
|
||||
- **No Git LFS** — `.gitattributes` → HTTP 404; the git tree lists all 145 entries as plain
|
||||
blobs (`git/trees/v1.3.0?recursive=1`, `truncated: false`), largest being `uv.lock` (387 038 B),
|
||||
`magg/cli.py` (41 731 B), `magg/server/server.py` (37 036 B), `license.md` (34 260 B).
|
||||
Repo size ≈ 1.3 MB — cheap to fetch.
|
||||
- **Tests are shipped in the sdist** (`magg-1.3.0/test/…`, 35 files, incl. `test/magg/`) —
|
||||
a `checkPhase` can run `pytest` from the unpacked sdist. `pyproject.toml` registers the
|
||||
`integration` marker; 3 tests in the tree carry `@pytest.mark.integration`, so
|
||||
`-m "not integration"` is the safe deselection (upstream's CI runs the full suite on
|
||||
`.github/workflows/test.yml`, `uv run pytest -v`).
|
||||
- Other root artifacts: `compose.yaml` (Docker Compose), `dockerfile`, `server.json`
|
||||
(MCP Registry manifest, `io.github.sitbon/magg`, version kept in sync with `pyproject.toml`
|
||||
by `scripts/bump_version.py --check`), `docs/` (11 markdown files, `docs/index.md` is the hub),
|
||||
`examples/` (6 python examples), `scripts/` (`bump_version.py`, `validate_manual_release.py`).
|
||||
|
||||
---
|
||||
|
||||
## 7. Upstream build / install instructions (from `readme.md` § Installation)
|
||||
|
||||
**Prerequisites (upstream's words):** "Python 3.12 or higher (3.13+ recommended)" and
|
||||
"`uv` (recommended) - Install from astral.sh/uv".
|
||||
|
||||
```bash
|
||||
# 1. Recommended: install from PyPI as a uv tool
|
||||
uv tool install magg
|
||||
magg serve # stdio transport (Claude Desktop, Cline, …)
|
||||
magg serve --http # HTTP transport, system-wide
|
||||
|
||||
# 2. Run straight from GitHub (no install)
|
||||
uvx --from git+https://github.com/sitbon/magg.git magg
|
||||
uvx --from git+https://github.com/sitbon/magg.git magg serve --http
|
||||
|
||||
# 3. Local development
|
||||
git clone https://github.com/sitbon/magg.git && cd magg
|
||||
uv sync --dev # or: poetry install --with dev
|
||||
magg --help
|
||||
|
||||
# 4. Docker (ghcr images)
|
||||
docker run -p 8000:8000 ghcr.io/sitbon/magg:latest # prod, WARNING log level
|
||||
docker run -p 8000:8000 ghcr.io/sitbon/magg:beta # beta, INFO log level
|
||||
docker compose up # prod/staging/dev via compose.yaml
|
||||
```
|
||||
|
||||
Other run modes: `magg serve --http --port 8000`, `magg serve --hybrid [--port N]`,
|
||||
`mbro connect local-magg magg serve`.
|
||||
|
||||
**Required runtime env vars:** none are mandatory. All are optional `MAGG_*` (see `.env.example`
|
||||
and README § Environment Variables):
|
||||
`MAGG_CONFIG_PATH` (default `.magg/config.json`, cwd-relative), `MAGG_LOG_LEVEL`
|
||||
(DEBUG/INFO/WARNING/ERROR/CRITICAL, default INFO), `MAGG_STDERR_SHOW=1`,
|
||||
`MAGG_AUTO_RELOAD` (default true), `MAGG_RELOAD_POLL_INTERVAL` (default 1.0),
|
||||
`MAGG_RELOAD_USE_WATCHDOG`, `MAGG_READ_ONLY=true`, `MAGG_SELF_PREFIX` (default `magg`),
|
||||
`MAGG_PREFIX_SEP` (default `_`), `MAGG_BACKEND_INIT_TIMEOUT` (default 30, `0` = wait forever),
|
||||
`MAGG_PRIVATE_KEY` / `MAGG_JWT` (only for authenticated HTTP mode; key generated with
|
||||
`magg auth private-key --oneline` / `magg auth jwt -q`). Docker sets
|
||||
`MAGG_CONFIG_PATH`, `MAGG_READ_ONLY`.
|
||||
|
||||
**Runtime deps beyond CPython:** the Magg package itself needs only the PyPI deps above
|
||||
(`cryptography` is the only binary-wheel-dependent one). **`node`/`npx` and `uvx` are needed at
|
||||
*runtime* only to launch proxied backend MCP servers** — Magg explicitly supports backend
|
||||
commands `python`, `node`, `npx`, `uvx` (`magg/util/transport.py`, `magg/util/transports.py`),
|
||||
and deliberately defers the "npx not on PATH" failure to connection time rather than startup.
|
||||
Upstream's own `dockerfile` (alpine 3.24 base) installs `tini bash curl nano nodejs npm` plus `uv`
|
||||
in a venv — a good hint at what to wrap in `buildInputs`/`makeWrapper` if you want out-of-the-box
|
||||
npx backends. **No ffmpeg, no binaries vendored, no network needed at build time** (but note
|
||||
`magg_search_servers` hits GitHub/Glama/MCP-registry APIs at *runtime*).
|
||||
|
||||
**CI reference for a `checkPhase`** (`.github/workflows/test.yml`): matrix on Python
|
||||
`3.12`, `3.13`, `3.14`, `ubuntu-latest`, `uv sync --all-groups --locked` then
|
||||
`uv run pytest -v`. Dev group additionally pulls `keyring`, `anthropic`, `packaging`, `ruff`
|
||||
(`ruff` config: `line-length = 120`, lint `select = ["F","I"]`).
|
||||
|
||||
---
|
||||
|
||||
## 8. Homepage / documentation / changelog URLs
|
||||
|
||||
From `pyproject.toml` `[project.urls]` (verbatim) and the wheel `METADATA` `Project-URL` lines:
|
||||
|
||||
| Key | URL |
|
||||
| --- | --- |
|
||||
| Homepage | `https://github.com/sitbon/magg` |
|
||||
| Repository | `https://github.com/sitbon/magg.git` |
|
||||
| Documentation | `https://github.com/sitbon/magg#readme` |
|
||||
| Issues | `https://github.com/sitbon/magg/issues` |
|
||||
| Release Notes | `https://github.com/sitbon/magg/releases` |
|
||||
|
||||
- **`meta.homepage = "https://github.com/sitbon/magg";`** (matches `server.json.websiteUrl`).
|
||||
Note: the GitHub repo's own `homepage` field points to `https://pypi.org/project/magg/` —
|
||||
use the GitHub URL for `meta.homepage` (per manifest) and add
|
||||
`https://pypi.org/project/magg/` as a source/download location.
|
||||
- **`meta.changelog = "https://github.com/sitbon/magg/releases";`** — there is **no
|
||||
`CHANGELOG`/`HISTORY` file anywhere in the repo** (verified via the full recursive git tree of
|
||||
`v1.3.0`; the only "changelog" mention is inside `.github/workflows/readme.md`). Release notes
|
||||
are generated per tag by GitHub Actions; per-tag URL form:
|
||||
`https://github.com/sitbon/magg/releases/tag/v1.3.0`.
|
||||
- In-repo docs: `docs/index.md` (hub), plus `docs/mbro.md`, `docs/authentication.md`,
|
||||
`docs/config-reload.md`, `docs/examples.md`, `docs/kits.md`, `docs/mcp-registry.md`,
|
||||
`docs/mcp-stateless.md`, `docs/messaging.md`, `docs/proxy.md`, `docs/proxy-spec.md`.
|
||||
These are shipped in the sdist (not the wheel). Third-party AI docs: `https://deepwiki.com/sitbon/magg`.
|
||||
- MCP Registry listing: `io.github.sitbon/magg` on `https://registry.modelcontextprotocol.io`.
|
||||
|
||||
---
|
||||
|
||||
## 9. Supported platforms
|
||||
|
||||
- **Declared: OS-independent, CPython only.** `pyproject.toml` classifiers include
|
||||
`"Operating System :: OS Independent"` and `"Programming Language :: Python :: 3 :: Only"` /
|
||||
`Implementation :: CPython`; `requires-python = ">=3.12"` (3.12/3.13/3.14 listed).
|
||||
No `platform_machine`, no macOS/x86-only markers in the dependency set.
|
||||
- **CI only exercises Linux** (`runs-on: ubuntu-latest`, Python 3.12/3.13/3.14).
|
||||
- **Platform-specific code (all guarded, none exclusionary):**
|
||||
- `magg/server/runner.py:102-109,127-135` — SIGHUP-triggered config reload is
|
||||
**Unix-only**, guarded by `if hasattr(signal, "SIGHUP")`; comment at line 118:
|
||||
"No loop signal support (e.g. Windows): hand the signal to the loop thread-safely".
|
||||
README: "SIGHUP signal: `kill -HUP <pid>` … (Unix-like systems)".
|
||||
- `magg/util/uri.py:30-31` — Windows path handling: `if os.name == "nt" and path.startswith("/") …`.
|
||||
- `magg/util/system.py:24` / `magg/mbro/cli.py:596` / `magg/util/terminal.py:39` — TTY
|
||||
detection (`os.isatty`, `sys.stdout.isatty`) to degrade the `rich`/`prompt-toolkit` REPL
|
||||
when not interactive.
|
||||
- `magg/mbro/arepl.py:110` prints `f"asyncio REPL {sys.version} on {sys.platform}"` (cosmetic).
|
||||
- **musl/Alpine:** upstream ships a working Alpine image and applies a
|
||||
"Fix for Python 3.12 extension suffix mismatch on Alpine" in the `dockerfile` — relevant if
|
||||
you target `x86_64-linux` with libc-agnostic Python; nothing in pure-Python Magg itself is
|
||||
libc-specific (only `cryptography`/`aiohttp` wheels matter).
|
||||
- Termux/Android is implicitly considered (commit `1b18b87f` notes that Termux sets env vars
|
||||
like `PREFIX`/`URI`/`KEY_PATH`, which Magg's config models no longer read).
|
||||
- **Practical conclusion for `meta.platforms`:** `lib.platforms.all`-ish (pure `py3-none-any`
|
||||
wheel, `Operating System :: OS Independent`); upstream *tests* Linux only, and the interactive
|
||||
`mbro` REPL + SIGHUP reload are nicest on Unix.
|
||||
|
||||
---
|
||||
|
||||
## Quick derivation cheat-sheet (facts, not a proposal)
|
||||
|
||||
```
|
||||
pname = "magg"; version = "1.3.0";
|
||||
src = GitHub owner="sitbon" repo="magg" rev="v1.3.0"
|
||||
sha256 = da3cc1b646b8616a78c841af268ac737f250a48eac582ae646efd3b6f467aa95 # magg-1.3.0.tar.gz
|
||||
# or PyPI pname="magg" version="1.3.0" (same sha256 family; wheel:
|
||||
# 6360f04b49fdce6d8ec48aa6865848f8a610a60a3e433fcd539383299958c933)
|
||||
tag commit = 1b18b87fdcda9628381888aea25fefa60fe1f923 (annotated tag obj cc9963ea784fcc2e465c318ab9f0f24e5059c1d1)
|
||||
build system = hatchling (PEP 517) ; python = 3.12..3.14
|
||||
license = AGPL-3.0-or-later ; mainProgram = "magg" (also installs "mbro")
|
||||
tests = pytest (sdist ships test/); deselect -m "not integration"
|
||||
```
|
||||
|
||||
MISSION COMPLETE (t-001)
|
||||
@@ -1,483 +0,0 @@
|
||||
# marmel bump — tooling / feasibility inventory
|
||||
|
||||
**Repo:** `/home/minder/GIT/millerson.name/nix-overlay` (nix flake, `numtide/blueprint` + `flake-parts`)
|
||||
**Target file:** `packages/marmel/package.nix` (`passthru.updateScript = [ "nix-update" "--flake" "marmel" "--version=branch=main" ]`)
|
||||
**Probed:** 2026-11-07 ~11:00 UTC. Nothing in the repo was modified by this research
|
||||
(`git diff --quiet -- packages/marmel/package.nix` → clean).
|
||||
|
||||
---
|
||||
|
||||
## 0. TL;DR — recommended command sequence
|
||||
|
||||
Run **from the repo root** (nix-update requires a git working tree, see §5.4):
|
||||
|
||||
```bash
|
||||
cd /home/minder/GIT/millerson.name/nix-overlay
|
||||
|
||||
# nix-update is NOT on PATH but is one command away (substituted from cache in ~5 s)
|
||||
nix shell nixpkgs#nix-update --command \
|
||||
nix-update --flake --version=branch=main marmel
|
||||
```
|
||||
|
||||
That command was **executed end-to-end in a throwaway copy of this repo and succeeded**
|
||||
— it rewrote `version`, `rev`, `src.hash` and `cargoHash` in
|
||||
`packages/marmel/package.nix` (exact diff in §4.4).
|
||||
|
||||
Then verify + format:
|
||||
|
||||
```bash
|
||||
nix build .#marmel # long: ~621 crates compiled from the vendor tree
|
||||
nix fmt packages/marmel/package.nix # already clean after nix-update (verified "0 changed")
|
||||
```
|
||||
|
||||
### Verified result values (as of 2026-11-07)
|
||||
|
||||
| field | old | new |
|
||||
|---|---|---|
|
||||
| `version` | `0-unstable-2026-10-23` | `0-unstable-2026-11-07` |
|
||||
| `src.rev` | `de3e99c89b18bf43fbb471930bd9f7a40e1ca1b2` | `afcc1dc971ae4acd59b157f031d4bdbc9d52a7d0` |
|
||||
| `src.hash` | `sha256-Z8qvzwSTpri9M05xZ07PJi9xSYIgBOos9bDh0NijSZg=` | `sha256-OiF2Lc4s01MuXX2HfWMePBJ9M/uuhI69gInqqDPhbgQ=` |
|
||||
| `cargoHash` | `sha256-FbtY6K+0tG7JymhG/PnK+SU7SW/IFjG8Wswt+EnWPhg=` | `sha256-Xw9OT8HXVlnZ0XqIMnnFwQ/y9xKxOtmcwomJsRxUx5E=` |
|
||||
|
||||
`afcc1dc971ae4acd59b157f031d4bdbc9d52a7d0` = `main` HEAD at probe time ("feat: isolate git
|
||||
worktrees per task, plan merge steps, and commit as Marmel Coder (#46)", committer date
|
||||
`2026-11-07T05:55:53Z`). **Re-check before bumping — upstream advances daily.**
|
||||
|
||||
`src.hash` was derived three independent ways, all agreeing (§4.2); `cargoHash` came from a
|
||||
real `nix-build` hash-mismatch of the exact derivation nixpkgs uses for `cargoHash` (§4.3).
|
||||
|
||||
### Fallback one-liner (no nix-update)
|
||||
|
||||
```bash
|
||||
SHA=$(curl -s https://api.github.com/repos/Na1w/marmel/commits/main \
|
||||
| sed -n 's/.*"sha": "\([0-9a-f]\{40\}\)".*/\1/p' | head -1)
|
||||
nix-prefetch-url --unpack "https://github.com/Na1w/marmel/archive/$SHA.tar.gz" \
|
||||
| tail -1 | xargs -I{} nix hash convert --hash-algo sha256 --to sri {}
|
||||
# then edit version/rev/src.hash by hand and let the build report cargoHash (§6.2)
|
||||
```
|
||||
|
||||
Full fallback detail in §6.
|
||||
|
||||
---
|
||||
|
||||
## 1. `nix` — installed, flakes + nix-command enabled
|
||||
|
||||
| item | value |
|
||||
|---|---|
|
||||
| binary | `/run/current-system/sw/bin/nix` |
|
||||
| version | **`nix (Nix) 2.34.9`** |
|
||||
| `nix show-config` → `experimental-features` | **`fetch-tree flakes nix-command`** |
|
||||
| `/etc/nix/nix.conf` → `experimental-features` | `nix-command flakes` |
|
||||
| user `nix.conf` | none (`~/.config/nix/nix.conf` does not exist); no `nix.conf.d` |
|
||||
| env vars | no `NIX_CONFIG`, no `NIX_FEATURES`. `NIX_PATH=nixpkgs=flake:nixpkgs:...` **is** set, so `with import <nixpkgs> {};` works (nix-update relies on this) |
|
||||
| store / remote | `nix store ping` → `Store URL: daemon`, `Version: 2.34.9`, **`Trusted: 0`** |
|
||||
| daemon | `nix-daemon --daemon` running; builds run as `nixbld1` |
|
||||
| substituters | `https://mirror.yandex.ru/nixos`, `https://cache.numtide.com`, `https://cache.nixos.org/` (all reachable) |
|
||||
|
||||
**No `--extra-experimental-features` flag is needed** — `nix-command` + `flakes` are already
|
||||
enabled system-wide.
|
||||
|
||||
Cosmetic noise: `nix.conf` carries a bogus
|
||||
`sandbox_extra_readonly_paths = /home/minde/.beads` (typo'd home dir), so **every** nix
|
||||
invocation prints `warning: ignoring sandbox_extra_readonly_paths entry "/home/minde/.beads": does not exist`.
|
||||
|
||||
## 2. Tool availability
|
||||
|
||||
| tool | on `PATH`? | notes |
|
||||
|---|---|---|
|
||||
| `nix` | yes | 2.34.9 |
|
||||
| **`nix-update`** | **NO** | Not installed. Installable from cache: `nix shell nixpkgs#nix-update` → **1.15.1** (verified → `/nix/store/sxspafgpl5d4h4ipd945a6q4l7gsjvyw-nix-update-1.15.1`). Also already in store at `/nix/store/v5rgl0pm2qd5mwra66gfri6j1cc6v5fm-nix-update-1.15.1/bin/nix-update`. |
|
||||
| `nix-prefetch-git` | **NO** | `nix shell nixpkgs#nix-prefetch-git` → 26.05 (verified working). **Not needed for this package** (§2.1). |
|
||||
| `nix-prefetch-github` | **NO** | `nix shell nixpkgs#nix-prefetch-github` → 7.1.0 (verified working). |
|
||||
| `prefetch-git` | no | not an attribute in current nixpkgs. |
|
||||
| `nix-prefetch` | no | not a real command. |
|
||||
| `nix-prefetch-url` | **yes** | `/run/current-system/sw/bin/nix-prefetch-url` (ships with nix) — use it for the src hash (§4.2). |
|
||||
| `nix-build`, `nix-shell`, `nix-instantiate`, `nix-env` | yes | `/run/current-system/sw/bin` (nix-update needs the first three). |
|
||||
| `git` | yes | `/etc/profiles/per-user/minder/bin/git` (nix-update needs it). |
|
||||
| `treefmt` / `nixfmt` | no | not on PATH; use `nix fmt` (§7). |
|
||||
| `nom` | no | nix-update falls back to plain `nix`. |
|
||||
|
||||
`nix-update --version` is **not** a usable flag in 1.15.1 (`--version` is the "version to
|
||||
update to" option; bare `--version` prints usage). Get the version from
|
||||
`nix eval nixpkgs#nix-update.version` or the store path name.
|
||||
|
||||
### 2.1 nix-update's real external requirements
|
||||
|
||||
Grepped from
|
||||
`/nix/store/v5rgl0pm2qd5mwra66gfri6j1cc6v5fm-nix-update-1.15.1/lib/python3.13/site-packages/nix_update/`:
|
||||
`git`, `nix-build`, `nix-instantiate`, `nix-shell`, `nix` (`nix-command flakes`), and
|
||||
`nix-prefetch-git` **only** in `git.py::git_prefetch`, used for `git+` entries in a Cargo.lock
|
||||
that the package declares via `cargoLock.lockFile`.
|
||||
|
||||
For `marmel`: `Cargo.lock` at the new rev has **621 packages and 0 `git+` sources**, and
|
||||
`package.nix` declares no `cargoLock`, so **`nix-prefetch-git` is never invoked**. nix-update
|
||||
has zero references to `nix-prefetch-github` — it computes hashes itself (§5.3).
|
||||
|
||||
## 3. Network access — yes, including from inside the build sandbox
|
||||
|
||||
```
|
||||
curl -I https://api.github.com -> HTTP 200 (0.53 s)
|
||||
curl https://api.github.com/rate_limit -> core limit 60/h, 59 remaining (unauthenticated)
|
||||
curl -I https://codeload.github.com/Na1w/marmel/tar.gz/refs/heads/main -> HTTP 200
|
||||
curl -I https://cache.nixos.org/nix-cache-info -> HTTP 200
|
||||
curl -I https://static.crates.io/ -> HTTP 403 (bare bucket root; crate fetches work)
|
||||
curl https://github.com/Na1w/marmel/commits/main.atom -> Atom feed OK (nix-update's branch source)
|
||||
```
|
||||
|
||||
GitHub unauthenticated API limit is **60 req/h**. `nix-prefetch-github` and nix-update's
|
||||
release lookups consume it; the `commits/main.atom` feed used by `--version=branch=main`
|
||||
is **not** API-rate-limited.
|
||||
|
||||
**Fixed-output derivations get network inside the sandbox — confirmed empirically:**
|
||||
|
||||
```
|
||||
$ nix build --impure --expr 'let p = import <nixpkgs> {}; in p.fetchurl { url = "https://api.github.com/zen"; hash = ""; }'
|
||||
error: hash mismatch in fixed-output derivation '/nix/store/9njz7kig2zzgv4h98381l3fv33nsv3db-zen.drv':
|
||||
specified: sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
|
||||
got: sha256-pMlQmrUEDYRs2ap8pjC+ug40eC3aL1feTGB4DJBIFCU=
|
||||
```
|
||||
|
||||
That `got: <hash>` line is exactly what nix-update parses, so hash computation works here.
|
||||
|
||||
## 4. Attribute exposure, and how to obtain the hashes
|
||||
|
||||
### 4.1 The exact attribute name
|
||||
|
||||
```bash
|
||||
nix eval --impure --expr 'builtins.attrNames (builtins.getFlake "git+file:.").packages'
|
||||
# -> [ "aarch64-darwin" "aarch64-linux" "x86_64-darwin" "x86_64-linux" ]
|
||||
nix eval --impure --raw --expr 'builtins.concatStringsSep "\n" (builtins.attrNames (builtins.getFlake "git+file:.").packages.x86_64-linux)'
|
||||
# -> agnix aionui awg-tool awgen codeaf container-use default desloppify ds4 flake-inputs
|
||||
# freebuff freetoken g3 graphify haivemind hipengine kubernetes-mcp-server kyojin loop
|
||||
# **marmel** mcp-gateway memdoor nftables-analyzer nftablesbuilder omniroute
|
||||
# open-code-review pdfcraft pilotdeck radar relay-free-llm shardr skillsmcp stakpak traycer
|
||||
```
|
||||
|
||||
`builtins.elem "marmel" (builtins.attrNames packages.<sys>)`:
|
||||
|
||||
| system | `packages.<sys>.marmel` |
|
||||
|---|---|
|
||||
| `x86_64-linux` | ✅ `true` (this machine's `builtins.currentSystem` — use it) |
|
||||
| `aarch64-linux` | ✅ `true` |
|
||||
| `aarch64-darwin` | ✅ `true` |
|
||||
| `x86_64-darwin` | ❌ **eval errors** — pre-existing, unrelated: `error: Nixpkgs 26.11 has dropped support for x86_64-darwin.` (locked nixpkgs rev `eaad089433ca`, `lib.version = 26.11pre-git`). Never pass `--system x86_64-darwin`. |
|
||||
|
||||
**The attribute name to give `nix-update --flake` is the bare `marmel`** — the comment in
|
||||
`package.nix` is correct. Mechanism: `Options.get_package()` (`nix_update/options.py`) builds
|
||||
|
||||
```nix
|
||||
(let flake = builtins.getFlake <path>; in flake.packages.${builtins.currentSystem}.marmel or flake.marmel)
|
||||
```
|
||||
|
||||
and `parse_attribute_path` raises `AttributePathError` on a leading dot, so `.#marmel` fails.
|
||||
|
||||
`nix flake show` renders it as `checks.<sys>.pkgs-marmel: derivation 'marmel-0-unstable-2026-10-23'`;
|
||||
blueprint also emits `packages.<sys>.marmel` and a `packages.<sys>.default` launcher.
|
||||
|
||||
### 4.2 `src.hash` — three agreeing methods (all executed)
|
||||
|
||||
For rev `afcc1dc971ae4acd59b157f031d4bdbc9d52a7d0` →
|
||||
**`sha256-OiF2Lc4s01MuXX2HfWMePBJ9M/uuhI69gInqqDPhbgQ=`**
|
||||
|
||||
1. **Empty-hash fixed-output build** (no installs needed):
|
||||
|
||||
```bash
|
||||
nix build --impure --no-write-lock-file --no-link --expr '
|
||||
let pkgs = import <nixpkgs> {}; in pkgs.fetchFromGitHub {
|
||||
owner = "Na1w"; repo = "marmel";
|
||||
rev = "afcc1dc971ae4acd59b157f031d4bdbc9d52a7d0";
|
||||
hash = "";
|
||||
}'
|
||||
# error: hash mismatch ... got: sha256-OiF2Lc4s01MuXX2HfWMePBJ9M/uuhI69gInqqDPhbgQ=
|
||||
```
|
||||
|
||||
2. `nix-prefetch-url --unpack https://github.com/Na1w/marmel/archive/<sha>.tar.gz`
|
||||
→ `013fw4rsisl9h2yqx15fzcrps4iw3ripv1vxblp57lrcrqnpc89s`, then
|
||||
`nix hash convert --hash-algo sha256 --to sri <hex>` → same SRI.
|
||||
|
||||
3. `nix-prefetch-github Na1w marmel --rev <sha>` (after `nix shell nixpkgs#nix-prefetch-github`)
|
||||
→ `{"owner":"Na1w","repo":"marmel","rev":"afcc1dc…","hash":"sha256-OiF2Lc4s01MuXX2HfWMePBJ9M/uuhI69gInqqDPhbgQ="}`
|
||||
(7.1.0 already emits SRI — no `nix hash convert` needed).
|
||||
`nix-prefetch-git https://github.com/Na1w/marmel <sha>` also agrees
|
||||
(`"sha256": "013fw4rsisl9…"`, `"hash": "sha256-OiF2…"`).
|
||||
|
||||
### 4.3 `cargoHash` — it is `cargoDeps.vendorStaging`, not `cargoDeps`
|
||||
|
||||
The locked nixpkgs (26.11pre-git) no longer uses `fetchCargoTarball`:
|
||||
|
||||
* `pkgs/build-support/rust/build-rust-package/default.nix:114-132` maps `cargoHash` →
|
||||
`fetchCargoVendor (… { hash = args.cargoHash; })`.
|
||||
* `pkgs/build-support/rust/fetch-cargo-vendor.nix:74-107` puts `outputHash = hash` on an
|
||||
inner `vendorStaging` derivation (`outputHashMode = "recursive"`, `outputHashAlgo = "sha256"`
|
||||
when `hash == ""`).
|
||||
|
||||
So **`cargoHash == cargoDeps.vendorStaging.outputHash`** — exactly what nix-update 1.15.1
|
||||
targets (`eval.nix`: `cargo_vendor_deps = pkg.cargoDeps.vendorStaging.outputHash or null;`,
|
||||
`dependency_hashes.py`: `"cargo_vendor_deps" → update_hash_with_prefetch("cargoDeps.vendorStaging")`).
|
||||
|
||||
Verified recipe (~12 min for 621 crates; **read-only**, does not touch the repo):
|
||||
|
||||
```bash
|
||||
cat > /tmp/cargohash.nix <<'EOF'
|
||||
let
|
||||
flake = builtins.getFlake "/home/minder/GIT/millerson.name/nix-overlay";
|
||||
pkgs = import flake.inputs.nixpkgs { };
|
||||
pkg = flake.packages.x86_64-linux.marmel.overrideAttrs (final: prev: {
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "Na1w"; repo = "marmel";
|
||||
rev = "afcc1dc971ae4acd59b157f031d4bdbc9d52a7d0";
|
||||
hash = "sha256-OiF2Lc4s01MuXX2HfWMePBJ9M/uuhI69gInqqDPhbgQ=";
|
||||
};
|
||||
});
|
||||
vs = pkg.cargoDeps.vendorStaging or pkg.cargoDeps;
|
||||
in vs.overrideAttrs (_: { outputHash = ""; outputHashAlgo = "sha256"; })
|
||||
EOF
|
||||
nix build --impure --no-write-lock-file --no-link --file /tmp/cargohash.nix
|
||||
# error: hash mismatch in fixed-output derivation '…-marmel-0-unstable-…-vendor-staging.drv':
|
||||
# got: sha256-Xw9OT8HXVlnZ0XqIMnnFwQ/y9xKxOtmcwomJsRxUx5E=
|
||||
```
|
||||
|
||||
Two traps: `overrideSrc` **does not exist** in this nixpkgs (removed — `error: attribute
|
||||
'overrideSrc' missing`), so use `overrideAttrs`; and `cargoDeps` is derived from
|
||||
`finalAttrs.src`, so overriding `src` correctly recomputes the vendor derivation.
|
||||
|
||||
### 4.4 End-to-end nix-update verification (performed)
|
||||
|
||||
Run in a **copy** of the repo (`git archive HEAD` → `/tmp/marmel-bump-test`), leaving the real
|
||||
repo untouched:
|
||||
|
||||
```bash
|
||||
PATH=/nix/store/v5rgl0pm2qd5mwra66gfri6j1cc6v5fm-nix-update-1.15.1/bin:$PATH \
|
||||
nix-update --flake --version=branch=main marmel
|
||||
```
|
||||
|
||||
Produced diff (only these 4 lines changed):
|
||||
|
||||
```diff
|
||||
- version = "0-unstable-2026-10-23";
|
||||
+ version = "0-unstable-2026-11-07";
|
||||
src = fetchFromGitHub {
|
||||
owner = "Na1w";
|
||||
repo = "marmel";
|
||||
- rev = "de3e99c89b18bf43fbb471930bd9f7a40e1ca1b2";
|
||||
- hash = "sha256-Z8qvzwSTpri9M05xZ07PJi9xSYIgBOos9bDh0NijSZg=";
|
||||
+ rev = "afcc1dc971ae4acd59b157f031d4bdbc9d52a7d0";
|
||||
+ hash = "sha256-OiF2Lc4s01MuXX2HfWMePBJ9M/uuhI69gInqqDPhbgQ=";
|
||||
};
|
||||
- cargoHash = "sha256-FbtY6K+0tG7JymhG/PnK+SU7SW/IFjG8Wswt+EnWPhg=";
|
||||
+ cargoHash = "sha256-Xw9OT8HXVlnZ0XqIMnnFwQ/y9xKxOtmcwomJsRxUx5E=";
|
||||
```
|
||||
|
||||
Comments, `nativeCheckInputs`, `preCheck`, `cargoTestFlags`, `postInstall`, `passthru` and
|
||||
`meta` were left untouched. Reference copy kept at `/tmp/marmel-bump-test`.
|
||||
|
||||
**The only error in that run was an artifact of the copy not being a git repo**
|
||||
(`git -C /tmp/marmel-bump-test/.. diff` → exit 129 in `git_has_diff`), raised *after* the file
|
||||
was written. In the real repo it does not happen — but it means **nix-update must be run
|
||||
inside the git working tree** (`validate_git_dir`).
|
||||
|
||||
## 5. nix-update deep-dive (1.15.1)
|
||||
|
||||
### 5.1 Version scheme
|
||||
|
||||
`--version=branch=main` → `VersionPreference.BRANCH` with branch `main`
|
||||
(`version/version.py::from_str` accepts `branch` and `branch=<name>`). The fetcher is
|
||||
`fetch_github_snapshots` (`version/github.py:144-199`), which reads
|
||||
`https://github.com/Na1w/marmel/commits/main.atom`, takes the newest entry and emits
|
||||
`Version(f"{version}-unstable-{date}", rev=commit)` where
|
||||
`version_numbers = <release tag numbers> + ["0"]`. marmel publishes **no tags and no
|
||||
releases** (`GET /repos/Na1w/marmel/tags` → `[]`), so the result is always
|
||||
`0-unstable-YYYY-MM-DD` — exactly the existing convention. `date` is the Atom `<updated>`
|
||||
of the head commit (`2026-11-07T05:55:53Z` → `2026-11-07`).
|
||||
|
||||
### 5.2 Which file it edits
|
||||
|
||||
`eval.nix` uses `builtins.unsafeGetAttrPos "src" pkg` and maps the store path back onto the
|
||||
working tree (`sanitizePosition`, `flakeImportPath` from `nix flake metadata --json`). Verified:
|
||||
it edited `packages/marmel/package.nix`, **not** the thin `packages/marmel/default.nix`
|
||||
(`pkgs.callPackage ./package.nix { }`). No `--override-filename` needed.
|
||||
|
||||
### 5.3 How it computes hashes (no prefetch tools required)
|
||||
|
||||
`dependency_hashes.py::nix_prefetch` runs
|
||||
|
||||
```bash
|
||||
nix-build --expr 'let src = <pkg>.src; in (src.overrideAttrs or (f: src // f src)) (_: { outputHash = ""; outputHashAlgo = "sha256"; })'
|
||||
```
|
||||
|
||||
and regex-extracts `got: <hash>` from stderr (`extract_hash_from_nix_error`), then
|
||||
`nix hash to-sri`. The identical trick is used for `cargoDeps.vendorStaging`. Hence no
|
||||
`nix-prefetch-*` is required — but **fixed-output builds with network must work**, which §3 confirms.
|
||||
|
||||
### 5.4 Gotchas
|
||||
|
||||
* **Must run inside a git working tree** (post-update `git diff` in `git_has_diff`).
|
||||
* The working tree is dirty (`.serena/project.yml` modified; `.marmel/` untracked). nix-update
|
||||
copies the flake via `nix flake metadata --json`, so dirty tracked content is used and nix
|
||||
prints `warning: Git tree … is dirty`. Harmless.
|
||||
* **`--use-update-script` will fail as written.** `run_update_script` (`update.py:136-191`)
|
||||
executes `passthru.updateScript` inside
|
||||
`nix develop --impure --expr 'with import <nixpkgs> {}; pkgs.mkShell { inputsFrom = [ <pkg> ]; }'`.
|
||||
`inputsFrom` supplies the *package's* build inputs (rustPlatform, cargo, cacert) — **not**
|
||||
`nix-update` — and `nix-update` is not on the host PATH, so
|
||||
`nix-update --flake marmel --use-update-script` (the command suggested by the comment in
|
||||
`package.nix`) dies with `nix-update: command not found`. If you insist on the update-script
|
||||
path, prefix it:
|
||||
`nix shell nixpkgs#nix-update --command nix-update --flake marmel --use-update-script`.
|
||||
Prefer the direct form in §0 (one less `nix develop` layer, and it avoids building
|
||||
`inputsFrom`).
|
||||
* `--format` shells out to a bare `nixfmt` (not on PATH) — use `nix fmt` afterwards instead.
|
||||
* `--build` / `--test` / `--review` pull in extra tooling and a full compile; omit them.
|
||||
* `--commit` would auto-commit; the repo's AGENTS.md wants conventional commits, so either use
|
||||
it deliberately or commit manually (§8).
|
||||
|
||||
---
|
||||
|
||||
## 6. Fallback procedure (nix-update unavailable, or branch scheme unresolved)
|
||||
|
||||
### 6.1 Manual bump — three edits in `packages/marmel/package.nix`
|
||||
|
||||
1. `version = "0-unstable-YYYY-MM-DD";` — date = committer date of `main` HEAD:
|
||||
```bash
|
||||
curl -s https://api.github.com/repos/Na1w/marmel/commits/main \
|
||||
| python3 -c 'import json,sys;d=json.load(sys.stdin);print(d["sha"]);print(d["commit"]["committer"]["date"])'
|
||||
```
|
||||
2. `rev` = full 40-char SHA; `hash` = §4.2 method 1, 2 or 3.
|
||||
3. `cargoHash` = §6.2.
|
||||
|
||||
### 6.2 Getting `cargoHash` without nix-update
|
||||
|
||||
Both routes work on this box:
|
||||
|
||||
* **Let the build report it** (the flow AGENTS.md documents): write the new `rev`/`src.hash`,
|
||||
then `nix build .#marmel`. The `…-marmel-…-vendor-staging` fixed-output derivation fails
|
||||
*before* any rustc work with `got: sha256-…`; paste that into `cargoHash` and rebuild.
|
||||
* **Read-only probe** (no file edit): the `/tmp/cargohash.nix` recipe in §4.3.
|
||||
|
||||
`prefetchCargoHash` / `prefetch-cargo-hash` are **not** commands on this system (nor in
|
||||
nixpkgs) — don't look for them. Note that in this nixpkgs the mismatching derivation is
|
||||
`<pname>-<version>-vendor-staging`, not `cargo-deps`; grepping build output for
|
||||
`vendor-staging` locates it fast.
|
||||
|
||||
### 6.3 Sandbox / daemon constraints
|
||||
|
||||
* `sandbox = true`, `sandbox-fallback = false`, and this user is **not trusted**
|
||||
(`nix store ping` → `Trusted: 0`; `trusted-users = root`).
|
||||
* `__noChroot` derivations are therefore rejected — verified:
|
||||
`error: derivation '…' has '__noChroot' set, but that's not allowed when 'sandbox' is 'true'`.
|
||||
Good news: neither `fetchFromGitHub` nor `fetchCargoVendor`/`vendorStaging` sets
|
||||
`__noChroot` (grepped in the locked nixpkgs), so **no sandbox bypass is needed** for this bump.
|
||||
* `--option sandbox false` is silently ignored:
|
||||
`warning: ignoring the client-specified setting 'sandbox', because it is a restricted setting and you are not a trusted user`.
|
||||
Do **not** plan around `nix build --option sandbox false`; it does nothing here.
|
||||
* Plain sandboxed builds work (`nix build nixpkgs#hello` substituted from `cache.numtide.com`;
|
||||
a hand-made sandboxed derivation built successfully).
|
||||
|
||||
---
|
||||
|
||||
## 7. Repo conventions that matter for the edit
|
||||
|
||||
* **Formatter: `nix fmt <paths>` is the right command.**
|
||||
`flake.formatter.x86_64-linux` = `/nix/store/b6mf3mzvln2igb244baas9vi6pywa05x-nixfmt-tree-2.6.0`
|
||||
— a treefmt wrapper whose *generated* config is
|
||||
`[formatter.nixfmt] command = "nixfmt"`, `includes = ["*.nix"]`, wrapping nixfmt **1.5.0**.
|
||||
Verified: `nix fmt packages/marmel/package.nix` → `traversed 1 files / emitted 1 files /
|
||||
formatted 1 files (0 changed)`, and nix-update's output is already format-clean.
|
||||
Current `packages/marmel/package.nix` is also `nixfmt --check`-clean as-is.
|
||||
* **The repo's `treefmt.toml` is effectively dead config.** `nix fmt` is handed the generated
|
||||
config (`--config-file /nix/store/…-treefmt.toml`, formatter id `nixfmt`), so the repo's
|
||||
`[formatter.nix]` section is never consulted. There is **no** `.pre-commit-config.yaml` and
|
||||
no `treefmt.nix`; `treefmt-nix` is only an input feeding blueprint's formatter. README already
|
||||
labels treefmt "(optional)".
|
||||
* **`nix flake check` does NOT check formatting.** `checks.x86_64-linux` contains only
|
||||
`pkgs-agnix … pkgs-marmel … pkgs-traycer` (one derivation per package → it *builds*
|
||||
everything). Blueprint's `format-check` derivation is not wired into `checks`.
|
||||
* **`devShells` is empty** → `nix develop` (suggested in AGENTS.md) does not work in this repo.
|
||||
* **CI** (`.github/workflows/ci.yml`): `nix flake check`, then `nix build .#packages || true`.
|
||||
* **Formatting scope**: run `nix fmt packages/marmel/package.nix`, not bare `nix fmt`
|
||||
(bare invocation formats the whole `git ls-files` tree).
|
||||
* **README** row for `marmel` (`README.md:29`) carries description + category only — no
|
||||
version string, so a version bump needs no README edit.
|
||||
* `overlays/` and `modules/` contain no `marmel` literal (blueprint auto-generates the overlay),
|
||||
so `packages/marmel/package.nix` is the only file to touch.
|
||||
* AGENTS.md §"Updating a Package Version" (~lines 209-215) and §"Updating Packages"
|
||||
(~lines 284-307) already document this flow, including
|
||||
`nix-update <package-name> --version=branch=main`.
|
||||
|
||||
---
|
||||
|
||||
## 8. Copy-paste runbook
|
||||
|
||||
```bash
|
||||
cd /home/minder/GIT/millerson.name/nix-overlay
|
||||
|
||||
# 0. sanity: current state + who is upstream now
|
||||
git status --short
|
||||
curl -s https://api.github.com/repos/Na1w/marmel/commits/main \
|
||||
| python3 -c 'import json,sys;d=json.load(sys.stdin);print(d["sha"], d["commit"]["committer"]["date"])'
|
||||
|
||||
# 1. bump (nix-update is not installed; pull it from the binary cache)
|
||||
nix shell nixpkgs#nix-update --command nix-update --flake --version=branch=main marmel
|
||||
|
||||
# 2. inspect — expect exactly 4 changed lines (version, rev, src hash, cargoHash)
|
||||
git diff -- packages/marmel/package.nix
|
||||
|
||||
# 3. format (expect "0 changed")
|
||||
nix fmt packages/marmel/package.nix
|
||||
|
||||
# 4. build + run the package's own checks (long: full rust build)
|
||||
nix build .#marmel
|
||||
nix build .#checks.x86_64-linux.pkgs-marmel # same derivation via blueprint's check
|
||||
|
||||
# 5. commit (conventional commits, per AGENTS.md)
|
||||
git add packages/marmel/package.nix
|
||||
git commit -m "chore(marmel): bump 0-unstable-2026-10-23 -> 0-unstable-2026-11-07"
|
||||
```
|
||||
|
||||
If step 1 is impossible, use §6.1 + §6.2 verbatim.
|
||||
|
||||
### Things to re-check after the bump
|
||||
|
||||
* `nativeCheckInputs = [ cacert ]`, the `preCheck` `SSL_CERT_FILE` export and
|
||||
`cargoTestFlags` (`--test-threads=1`, skip
|
||||
`harness::sandbox::tests::test_internal_sandbox_exec_dev_null_and_dns`) exist for reasons
|
||||
documented in `package.nix` comments. Re-read those comments against the new rev: they claim
|
||||
the lib suite passes **1055 tests** with that single skip at the old rev; a new upstream rev
|
||||
can change the test count, rename the skipped test, or re-introduce flakiness. If a skip
|
||||
filter stops matching, cargo prints `0 filtered out` and the suite silently under-tests.
|
||||
* `meta.license = lib.licenses.mit` was asserted from the README because no LICENSE file
|
||||
shipped; `Cargo.toml` at `afcc1dc` now has `license = "MIT"`, so the claim is better supported.
|
||||
* `Cargo.toml` still says `version = "1.0.0"` (so the `0-unstable-*` scheme stays mandatory) and
|
||||
`rust-version = "1.98"`. Confirm the locked nixpkgs toolchain still satisfies it; if upstream
|
||||
ever needs a newer rustc, copy the `nixpkgs-rust195` input pattern already used for `pdfcraft`
|
||||
(see the `flake.nix` header comments).
|
||||
|
||||
## 9. Pre-existing issues found (not blockers)
|
||||
|
||||
1. `packages.x86_64-darwin` **evaluates to an error**: `error: Nixpkgs 26.11 has dropped
|
||||
support for x86_64-darwin.` Consequently `nix flake show --all-systems` and
|
||||
`nix flake check`-style whole-system traversals can fail on that system. Unrelated to this
|
||||
bump; affects every package in the repo.
|
||||
2. `nix.conf` typo `sandbox_extra_readonly_paths = /home/minde/.beads` emits a warning on every
|
||||
nix invocation.
|
||||
3. `devShells` is empty, so AGENTS.md's `nix develop` instruction is stale.
|
||||
4. `treefmt.toml` is unused by `nix fmt` (§7).
|
||||
5. `nix flake show`/`nix eval` on `git+file:.` prints
|
||||
`warning: Fetching Git repository 'file:.', which uses a path relative to the current
|
||||
directory. This is not supported and will stop working in a future release.`
|
||||
(nix issue 12281) — use an absolute path (`git+file:///home/minder/GIT/millerson.name/nix-overlay`)
|
||||
to silence it.
|
||||
|
||||
## 10. One-line answers
|
||||
|
||||
| question | answer |
|
||||
|---|---|
|
||||
| nix installed + flakes? | **Yes** — nix 2.34.9, `experimental-features = nix-command flakes` (system `nix.conf`); no flag needed |
|
||||
| nix-update? | **Not on PATH**; `nix shell nixpkgs#nix-update` → 1.15.1 (works, verified end-to-end) |
|
||||
| nix-prefetch-git / -github / prefetch-git / nix-prefetch? | **All missing**; first two installable from cache; `nix-prefetch-url` **is** present; `prefetch-git`/`nix-prefetch` don't exist |
|
||||
| network? | **Yes** — GitHub API/atom/codeload and nix caches reachable; fixed-output sandbox builds get network (proven) |
|
||||
| attribute name | **`marmel`** (i.e. `packages.x86_64-linux.marmel`); also on `aarch64-linux` + `aarch64-darwin`; `x86_64-darwin` is broken upstream |
|
||||
| recommended command | `nix shell nixpkgs#nix-update --command nix-update --flake --version=branch=main marmel` |
|
||||
| fallback | manual `rev` + `nix-prefetch-url --unpack`/`fetchFromGitHub hash=""` for `src.hash`, then `nix build .#marmel`'s `vendor-staging` hash-mismatch for `cargoHash` (§6) |
|
||||
| sandbox permits it? | **Yes** — no `__noChroot` needed and none used; `--option sandbox false` is a no-op for this untrusted user |
|
||||
| formatting | `nix fmt packages/marmel/package.nix` (treefmt wrapper → nixfmt 1.5.0); nix-update's output is already clean |
|
||||
@@ -1,274 +0,0 @@
|
||||
# Upstream research: `Na1w/marmel` — pin bump discovery
|
||||
|
||||
Date of research: 2026-11-07 (all API calls made live; network was reachable).
|
||||
Package under bump: `packages/marmel/package.nix` (attr `marmel`, crate name `marmennill`).
|
||||
|
||||
> ## ✅ HEAD TO USE
|
||||
>
|
||||
> | field | value |
|
||||
> |---|---|
|
||||
> | **`rev` (full 40-char SHA)** | `afcc1dc971ae4acd59b157f031d4bdbc9d52a7d0` |
|
||||
> | **`version`** | `0-unstable-2026-11-07` |
|
||||
> | commit date (ISO 8601) | `2026-11-07T05:55:53Z` (author **and** committer date identical) |
|
||||
> | commit subject | `feat: isolate git worktrees per task, plan merge steps, and commit as Marmel Coder (#46)` |
|
||||
> | default branch | `main` (confirmed: `GET /repos/Na1w/marmel` → `default_branch: "main"`, `pushed_at: 2026-11-07T05:55:58Z`) |
|
||||
>
|
||||
> Both `src` hash and `cargoHash` **must** be recomputed — the source tree changed and
|
||||
> `Cargo.lock` grew from 399 to 621 packages.
|
||||
>
|
||||
> Still no tags and no releases (`GET /repos/Na1w/marmel/tags` → `[]`,
|
||||
> `GET /repos/Na1w/marmel/releases` → `[]`), so the `0-unstable-*` / branch-head
|
||||
> scheme stays correct.
|
||||
|
||||
---
|
||||
|
||||
## 1. HEAD of `main`
|
||||
|
||||
Evidence (GitHub REST API, HTTP 200):
|
||||
|
||||
- `GET https://api.github.com/repos/Na1w/marmel/commits/HEAD`
|
||||
→ `sha: afcc1dc971ae4acd59b157f031d4bdbc9d52a7d0`,
|
||||
`commit.author.date = commit.committer.date = 2026-11-07T05:55:53Z`,
|
||||
PGP-verified commit (`verification.verified: true`), tree `5b2e615fba13f69a2e2866a492a950fc185c1c72`.
|
||||
- `GET https://api.github.com/repos/Na1w/marmel/commits?sha=main&per_page=100`
|
||||
→ first entry is the same SHA (the current pin is the 23rd entry, see §2).
|
||||
|
||||
Version-string convention check: the current pin `de3e99c8…` has author/committer date
|
||||
`2026-10-23T00:43:14Z` and the derivation says `0-unstable-2026-10-23`, i.e. the date is the
|
||||
**commit date of the pinned HEAD** (UTC). Applying the same rule to the new HEAD gives
|
||||
**`0-unstable-2026-11-07`**.
|
||||
|
||||
## 2. Is the current pin an ancestor of HEAD? How far behind?
|
||||
|
||||
`GET /repos/Na1w/marmel/compare/de3e99c89b18bf43fbb471930bd9f7a40e1ca1b2...afcc1dc971ae4acd59b157f031d4bdbc9d52a7d0`
|
||||
|
||||
```
|
||||
status: ahead
|
||||
ahead_by: 22
|
||||
behind_by: 0
|
||||
total_commits: 22
|
||||
```
|
||||
|
||||
→ **Yes, `de3e99c89b18bf43fbb471930bd9f7a40e1ca1b2` is a strict ancestor of `main` HEAD,
|
||||
and the pin is exactly 22 commits behind.** No force-push / history rewrite happened
|
||||
(`behind_by: 0`, and the pin also appears in the linear `commits?sha=main` listing at index 22).
|
||||
|
||||
## 3. Commits between the pin and HEAD (oldest → newest)
|
||||
|
||||
| # | SHA (abbrev) | date | subject |
|
||||
|---|---|---|---|
|
||||
| 1 | `b66f669257` | 2026-10-26 | Fix/arbitrator reply and adhoc validation (#26) |
|
||||
| 2 | `70fa3078ba` | 2026-11-05 | Feature/new UI (#27) |
|
||||
| 3 | `c6a975f39d` | 2026-11-05 | Feature/new UI (#27) (#29) |
|
||||
| 4 | `0dc722296e` | 2026-11-05 | feat(orchestration): integrate zim-search as workspace subcrate + expose kiwix__* tools (#28) |
|
||||
| 5 | `8cf2195a06` | 2026-11-05 | fix: mcp initializes asynchronously (#30) |
|
||||
| 6 | `d1581295aa` | 2026-11-05 | Feature/agents md project instructions (#31) |
|
||||
| 7 | `3619ed21d7` | 2026-11-05 | feat: nested AGENTS.md per directory and CLAUDE.md/GEMINI.md fallback (#32) |
|
||||
| 8 | `00a05a031a` | 2026-11-05 | Clean up stray research left-overs (#33) |
|
||||
| 9 | `ca363cca6b` | 2026-11-06 | fix: make test scratch directory names process-unique (#34) |
|
||||
| 10 | `15c3f3ae06` | 2026-11-06 | docs: document zim-search/kiwix integration and refresh README (#35) |
|
||||
| 11 | `a0da04bed0` | 2026-11-06 | Feature/regex replace (#36) |
|
||||
| 12 | `1081776bf0` | 2026-11-06 | Fix/prevent autonomous pause (#37) |
|
||||
| 13 | `dd293465c5` | 2026-11-06 | Fix/windows support (#38) |
|
||||
| 14 | `e1e9418b19` | 2026-11-06 | Feature/git worktree policy (#39) |
|
||||
| 15 | `c98179d023` | 2026-11-06 | **docs: add MIT license and update license metadata (#40)** |
|
||||
| 16 | `f036a68fb8` | 2026-11-06 | Fix/log issues and speedup (#41) |
|
||||
| 17 | `385b97bcc0` | 2026-11-06 | fix: fall back to USERPROFILE for home directory lookup on Windows (#42) |
|
||||
| 18 | `cb9c0310b3` | 2026-11-06 | Feature/composer arrow scroll (#43) |
|
||||
| 19 | `04b81bc6ea` | 2026-11-07 | Feature/resume by default plan (#44) |
|
||||
| 20 | `26464aaa3b` | 2026-11-07 | feat: clean up .marmel runtime files on plan completion by default (#45) |
|
||||
| 21 | `5f12a32ebf` | 2026-11-07 | Docs/readme cleanup (#47) |
|
||||
| 22 | `afcc1dc971` | 2026-11-07 | feat: isolate git worktrees per task, plan merge steps, and commit as Marmel Coder (#46) |
|
||||
|
||||
139 paths changed. The big functional blocks: a UI rewrite (`src/ui/tui/**` new
|
||||
`components/`, `layout.rs`, `state.rs`, `theme.rs`), a new `crates/zim-search` workspace
|
||||
member, Windows support work, AGENTS.md/CLAUDE.md project-instruction support, and prompt
|
||||
updates.
|
||||
|
||||
## 4. Derivation impact checklist
|
||||
|
||||
### 4.1 `postInstall` example configs — ✅ still fine
|
||||
|
||||
Root listing at HEAD (`GET /repos/Na1w/marmel/contents/?ref=afcc1dc9…`, plus the fetched
|
||||
source tarball):
|
||||
|
||||
```
|
||||
.github/ AGENTS.md Cargo.lock Cargo.toml LICENSE README.md
|
||||
config/ crates/ marmel.toml.cloud marmel.toml.df marmel.toml.example
|
||||
prompts/ scripts/ src/ tests/
|
||||
```
|
||||
|
||||
- `marmel.toml.example` — **present** (modified in range: +75 lines, content only).
|
||||
- `marmel.toml.cloud` — **present** (untouched in the range).
|
||||
- Both are in the git archive, so both `install -Dm644` lines keep working.
|
||||
- Side note: `marmel.toml.df` also exists (already existed at the pin; the derivation has
|
||||
never installed it). Not a breakage, just an uninstalled extra if you ever want it.
|
||||
|
||||
### 4.2 Skipped sandbox test — ✅ still present, `--skip` filter still valid
|
||||
|
||||
- `src/harness/sandbox.rs:1800` at HEAD: `fn test_internal_sandbox_exec_dev_null_and_dns()`
|
||||
(same path, same line number as at the pin).
|
||||
- `diff` of `src/harness/sandbox.rs` pin → HEAD: **byte-identical**.
|
||||
- The `cargoTestFlags` `--skip harness::sandbox::tests::test_internal_sandbox_exec_dev_null_and_dns`
|
||||
therefore still matches a real test (no "filter matched no tests" error, no silent no-op).
|
||||
- The file's own maintainer note is unchanged and still describes exactly the Nix situation:
|
||||
the exec half runs on a store host, the `/etc/resolv.conf` half is the fixture question.
|
||||
- Caveat (soft, not a breakage): these sandbox tests use `integration_host()` /
|
||||
`candidate_is_current()` and print `SKIP <test>: no current executable implementing
|
||||
--internal-sandbox-exec was found next to the test binary (run `cargo build` first,
|
||||
`cargo test --lib` does not rebuild bin targets)` when the *bin* is stale or built from a
|
||||
different tree. `buildRustPackage` builds the bin in `buildPhase` and runs tests from the
|
||||
same tree in `checkPhase`, so this should keep passing as before — but re-read the
|
||||
`checkPhase` log after the bump, because the derivation comment currently asserts
|
||||
"no SKIP line is printed".
|
||||
|
||||
### 4.3 `Cargo.toml` `version` / `license` — ⚠️ one comment in the derivation is now stale
|
||||
|
||||
`[package]` at HEAD vs at the pin:
|
||||
|
||||
| key | pin `de3e99c8` | HEAD `afcc1dc9` |
|
||||
|---|---|---|
|
||||
| `name` | `marmennill` | `marmennill` |
|
||||
| `version` | `1.0.0` | `1.0.0` (unchanged → the "Cargo.toml still says 1.0.0" comment stays accurate) |
|
||||
| `edition` | `2024` | `2024` |
|
||||
| `rust-version` | `1.98` | `1.98` (unchanged → no new toolchain floor) |
|
||||
| `license` | *(absent)* | **`"MIT"` (NEW)** |
|
||||
| `authors` | *(absent)* | `["Fredrik Andersson"]` (NEW) |
|
||||
| `[workspace]` | *(absent)* | `resolver = "2"`, `members = ["crates/zim-search"]` (NEW) |
|
||||
|
||||
Consequences:
|
||||
|
||||
1. **A `LICENSE` file now ships at the repo root** (added by `c98179d023` "docs: add MIT
|
||||
license and update license metadata (#40)"). The `meta.license` comment in
|
||||
`package.nix` — *"Upstream README states MIT, but the repository ships no LICENSE file and
|
||||
Cargo.toml has no license field"* — is now **factually wrong** and should be rewritten
|
||||
(upstream now declares MIT both in `Cargo.toml` and as a shipped `LICENSE`).
|
||||
`lib.licenses.mit` itself remains the correct value. Since the source is fetched from
|
||||
git, you may optionally keep it as-is or switch to a `license = { file = "LICENSE"; … }`
|
||||
style declaration — SPDX hash not required for the bump.
|
||||
2. `version = "1.0.0"` is unchanged, so `version = "0-unstable-YYYY-MM-DD"` (i.e. ignoring
|
||||
the crate version) is still the right call.
|
||||
|
||||
### 4.4 New native build inputs / system deps / submodules / build-time network — ✅ none needed, ⚠️ but `cargoHash` changes and there is a latent trap
|
||||
|
||||
**No new build-time requirements for the package as built today:**
|
||||
|
||||
- `[dependencies]` of the root `marmennill` package is **byte-for-byte identical** pin → HEAD
|
||||
(28 deps + 2 dev-deps + the `cfg(unix)`/`cfg(target_os = "linux")` `libc`/`landlock`
|
||||
blocks). Lockfile reverse-check: the direct dep *set* of `marmennill` is identical.
|
||||
- **No `build.rs` anywhere** in the tree (`find -name build.rs` → 0 hits), **no `.gitmodules`**,
|
||||
**no vendored `vendor/` dir** → no submodules to fetch, no custom build script needing
|
||||
extra tools.
|
||||
- All `include_str!` / `include_bytes!` targets (prompts, embedded modules) resolve inside
|
||||
the source archive — checked programmatically: **0 missing**. So the "binary needs no
|
||||
runtime data files" claim still holds. New embedded prompts
|
||||
(`prompts/tool_reasoning.md`, `prompts/skills/git_workflow.md`) are present in the tree.
|
||||
- No new build-time network need: nothing downloads at build time in the default graph.
|
||||
|
||||
**`Cargo.lock` grew a lot — `cargoHash` must be regenerated:**
|
||||
|
||||
- 399 → **621** lock entries (+196 new package names, 0 removed).
|
||||
- Cause: the new workspace member `crates/zim-search` (ZIM archive reader with Tantivy BM25
|
||||
search): `tantivy 0.26.2`, `zim 0.5.0`, `clap`, `rayon`, `image`/`rav1e` (via zim),
|
||||
`zstd-sys`, `lzma-sys`, plus an **optional** `semantic = ["dep:fastembed"]` feature that
|
||||
drags in `fastembed`/`ort`/`ort-sys` (ONNX), `tokenizers`, `hf-hub`, `ureq`.
|
||||
- `cargo vendor` (what `cargoHash`/`fetchCargoTarball` hashes) resolves the whole workspace,
|
||||
so the vendor tarball gets noticeably bigger even though none of it is compiled. Expect a
|
||||
new `cargoHash` and a longer vendor fetch.
|
||||
|
||||
**Why no extra `nativeBuildInputs` are required (verified, not assumed):**
|
||||
|
||||
- `buildRustPackage` runs bare `cargo build/test --release --locked`, and with a root package
|
||||
present the **default member is the root package only** — `crates/zim-search` is *not*
|
||||
built or tested. Upstream states this deliberately in `Cargo.toml`:
|
||||
*"`crates/zim-search` is reached over MCP stdio only, so it is a member here but is
|
||||
deliberately NOT a path dependency of `marmennill` (no tantivy/zim in this graph)."*
|
||||
- Lockfile graph analysis (name+version edges): `zim`, `tantivy`, `clap`, `rayon`, `ureq`,
|
||||
`hf-hub`, `ort`, `ort-sys`, `fastembed`, `tokenizers`, `zstd-sys`, `lzma-sys` are reachable
|
||||
from `zim-search` **only** — **not** from `marmennill`.
|
||||
- `openssl` / `openssl-sys` / `native-tls` / `hyper-tls` / `tokio-native-tls` / `vcpkg` appear
|
||||
in the lockfile but are reachable only via
|
||||
`zim-search → fastembed (optional `semantic`, off by default) → hf-hub 0.5.0 → reqwest 0.12.28 → native-tls → openssl`.
|
||||
`marmennill` itself uses `reqwest 0.13.5`, whose deps are rustls-only
|
||||
(`rustls`, `rustls-platform-verifier`, `tokio-rustls`, `quinn`) — no OpenSSL, no `cmake`/`pkg-config`.
|
||||
- **Latent trap to record in the derivation comment:** if anyone ever adds `--workspace` /
|
||||
`--all-features` to `cargoBuildFlags`/`cargoTestFlags`, or upstream makes `zim-search` a
|
||||
path dep, the build immediately needs OpenSSL (`openssl-sys`, `vcpkg`) and, with
|
||||
`semantic`, `libonnxruntime`. Keep bare cargo invocations.
|
||||
|
||||
**TLS/trust-store note still valid:** `rustls-native-certs` is still in `marmennill`'s graph
|
||||
(via `reqwest 0.13.5 → rustls-platform-verifier`), so the `nativeCheckInputs = [ cacert ]` +
|
||||
`preCheck` `SSL_CERT_FILE` workaround is still required — do not drop it.
|
||||
|
||||
### 4.5 Test-suite size — ⚠️ comment is stale (low priority)
|
||||
|
||||
Grep proxy over `#[test]` + `#[tokio::test]` (cfg-gated tests are counted regardless of
|
||||
platform, so treat as an upper bound; this also explains why it overshoots the "1055" figure
|
||||
recorded in the derivation):
|
||||
|
||||
| suite | pin `de3e99c8` | HEAD `afcc1dc9` |
|
||||
|---|---|---|
|
||||
| `src/` (lib test binary) | 1036 `#[test]` + 169 `#[tokio::test]` ≈ **1205** | 1562 `#[test]` + 197 `#[tokio::test]` ≈ **1759** |
|
||||
| `tests/` (integration binaries) | ≈ 348 | ≈ 397 |
|
||||
|
||||
→ The lib suite grew **materially** (~+46%, roughly +500 test fns, mostly the new
|
||||
`src/ui/tui/**` tests, `src/harness/fs_path_tests.rs` (+1616 lines), `pty_tests.rs`
|
||||
(+775 lines), `dispatch_integrity_tests.rs` (+853 lines)). The derivation comment's
|
||||
*"the lib suite passes at 1055 tests with that single filter"* is stale; re-measure the real
|
||||
`cargo test --lib` count after the bump and refresh the number.
|
||||
|
||||
### 4.6 Other `checkPhase`-relevant observations (informational)
|
||||
|
||||
- `ca363cca6b` "make test scratch directory names process-unique (#34)" adds
|
||||
`src/test_scratch.rs` — friendlier for sandboxed/parallel runs.
|
||||
- The new PTY tests self-gate at runtime via `pty_or_skip()` / `pty_allocation_blocker()`
|
||||
(`src/harness/pty_tests.rs`) and print `SKIP <test>: this host cannot allocate a PTY (…)`
|
||||
instead of failing when `openpty()` returns `EACCES` (the Nix sandbox `ptmxmode=000`
|
||||
case). Upstream deliberately avoids `#[ignore]` here. So new PTY tests should degrade to
|
||||
visible SKIPs, not failures — check the log for the `SKIP ` lines.
|
||||
- Loopback/HTTP test surface is unchanged in shape (4 files reference `TcpListener` at both
|
||||
pins, 1 file references `resolv.conf` at both) — the cacert `preCheck` rationale is intact.
|
||||
- `--test-threads=1` is still warranted: the shared process-global orchestrator state the
|
||||
comment describes (`src/orchestrator/workers.rs`, `bus.rs`, `preemption.rs`) is untouched
|
||||
in spirit and `src/orchestrator/worker_pause.rs` adds *more* shared state. Keep the flag.
|
||||
- Windows-support commits (#38, #42) are `cfg`-gated; `meta.platforms = lib.platforms.unix`
|
||||
is unaffected.
|
||||
|
||||
## 5. Concrete to-do for the bump (not applied — this file is the only deliverable)
|
||||
|
||||
1. `rev = "afcc1dc971ae4acd59b157f031d4bdbc9d52a7d0"`, `version = "0-unstable-2026-11-07"`.
|
||||
2. Rehash `src` (`fetchFromGitHub`) **and** `cargoHash` (lockfile changed).
|
||||
`nix-update --flake marmel --use-update-script` should handle both; note nix-update's
|
||||
`--version=branch=main` scheme yields exactly `0-unstable-2026-11-07` for this commit date.
|
||||
3. Update the stale `meta.license` comment (MIT is now declared in `Cargo.toml` **and**
|
||||
shipped as `LICENSE` at the repo root).
|
||||
4. Keep `postInstall` as-is (both example configs still exist).
|
||||
5. Keep `cargoTestFlags` as-is (skip filter still matches a real test); keep `preCheck`
|
||||
`SSL_CERT_FILE` + `cacert`.
|
||||
6. After the build, refresh the "1055 tests" figure in the comment and confirm no unexpected
|
||||
`SKIP ` lines; consider adding a one-line note that `crates/zim-search` is intentionally
|
||||
not built (and why no OpenSSL/ONNX inputs are needed).
|
||||
|
||||
## 6. Evidence / commands used
|
||||
|
||||
```bash
|
||||
# HEAD + default branch
|
||||
curl -s https://api.github.com/repos/Na1w/marmel/commits/HEAD
|
||||
curl -s "https://api.github.com/repos/Na1w/marmel/commits?sha=main&per_page=100"
|
||||
curl -s https://api.github.com/repos/Na1w/marmel # default_branch=main, license=MIT
|
||||
# ancestry + commit list + changed files
|
||||
curl -s https://api.github.com/repos/Na1w/marmel/compare/de3e99c89b18bf43fbb471930bd9f7a40e1ca1b2...afcc1dc971ae4acd59b157f031d4bdbc9d52a7d0
|
||||
# tags / releases (both empty)
|
||||
curl -s "https://api.github.com/repos/Na1w/marmel/tags?per_page=5"
|
||||
curl -s "https://api.github.com/repos/Na1w/marmel/releases?per_page=5"
|
||||
# full trees of both revisions, compared locally
|
||||
curl -sL https://codeload.github.com/Na1w/marmel/tar.gz/<sha>
|
||||
```
|
||||
|
||||
Local analysis on the two extracted trees: `diff` of `Cargo.toml`/`Cargo.lock`/
|
||||
`src/harness/sandbox.rs`, TOML-parsed dependency-graph reachability from `marmennill` vs
|
||||
`zim-search`, `include_str!` target resolution, and `#[test]`/`#[tokio::test]` counts.
|
||||
Reference file for the claims above: `packages/marmel/package.nix` (read-only, not modified)
|
||||
— `version` line 14, `rev` line 19, `cargoHash` line 23, `preCheck` line 41, the
|
||||
"no SKIP line … 1055 tests" comment lines 60–61, `cargoTestFlags` line 62, `postInstall`
|
||||
line 72, `meta.license` comment lines 95–96.
|
||||
@@ -1,70 +0,0 @@
|
||||
# TheRock ROCm SDK
|
||||
|
||||
The `therock-rocm` package is maintained in this repository. `packages/therock-rocm/package.nix`
|
||||
pins the version, GPU target and archive hash; `sdk.nix` installs and adapts the
|
||||
official AMD binary SDK to Nix. It was adapted from
|
||||
[`hellas-ai/nix-strix-halo` at b2969bd](https://github.com/hellas-ai/nix-strix-halo/blob/b2969bd90fedc4a1f9d91648bfdf8f21479b8178/pkgs/therock/rocm-sdk/default.nix).
|
||||
It no longer imports that project's ROCm recipe or source metadata. The flake
|
||||
input remains necessary for Gufo's XRT package.
|
||||
|
||||
The SDK archive is
|
||||
[`therock-dist-linux-gfx1151-10.1.0.tar.gz`](https://stable.repo.amd.com/rocm/core/tarball/therock-dist-linux-gfx1151-10.1.0.tar.gz).
|
||||
Its manifest declares `rocm_version = 10.1.0` and an internal
|
||||
`rocm_package_version = 10.1.0rc3`. Both are checked during installation;
|
||||
the internal build stamp is also exposed as `therock-rocm.packageVersion`.
|
||||
Hipfire (including its kernels), Strata, Crucible and Strixite share this package.
|
||||
Crucible retains its official engine binary compiled with ROCm 7.2.4; its runtime
|
||||
comes from this SDK. Kyojin, Gufo and the llama.cpp forks retain their own upstream
|
||||
toolchain choices.
|
||||
|
||||
As reviewed on 2026-11-12, nixpkgs [PR #579527](https://github.com/NixOS/nixpkgs/pull/579527)
|
||||
is open and targets `staging`. It is the final part of a series replacing the
|
||||
7.2.4 scope with ROCm 10.1, including LLVM 24. The author reports hardware checks
|
||||
on gfx1102 and gfx906; this does not validate gfx1151. The PR also adds `hipfile`
|
||||
for torch/vLLM and libdrm for torch. Those source-package changes are not needed
|
||||
for our standalone inference engines' bundled SDK.
|
||||
|
||||
[Issue #563157](https://github.com/NixOS/nixpkgs/issues/563157) discusses the
|
||||
TheRock/ROCm naming transition, LLVM 24 prerequisites, composable-kernel changes,
|
||||
OpenMP/profiler integration and build resource requirements. It remains open.
|
||||
We keep the SDK tarball approach while the source-package migration is under
|
||||
review, without changing the repository's nixpkgs pins to an unmerged PR.
|
||||
|
||||
The [TheRock environment guide](https://github.com/ROCm/TheRock/blob/main/docs/environment_setup_guide.md#patchelf)
|
||||
requires the PHDR fix from [patchelf #544](https://github.com/NixOS/patchelf/pull/544)
|
||||
when rewriting kpack split ELF libraries. Nixpkgs' patchelf 0.19.2 includes
|
||||
that fix, but both 0.19.2 and the newer release 0.19.3 reject this SDK's `librocsparse.so.1.0` with
|
||||
`section content is not naturally aligned` when extending its RPATH. The recipe
|
||||
therefore uses TheRock's pinned patchelf commit
|
||||
`d0f70eea5397606c486857e0a105e53ec123904a`, built locally with its test suite.
|
||||
It includes the PHDR fix. This override is confined to the SDK and exposed as
|
||||
`therock-rocm.patchelf`. The global patchelf package is unchanged. The recipe
|
||||
patches split libraries instead of retaining the old workaround that skipped
|
||||
late PHDR tables. SDK install checks inspect the HSA runtime's program headers
|
||||
and execute the compiler and HIP configuration tools.
|
||||
All top-level ELF tools in the SDK's compiler/bin directories are patched,
|
||||
including LLVM 24's `llvm-offload-binary`, which clang invokes as a subprocess.
|
||||
Its stock `/lib64/ld-linux-x86-64.so.2` interpreter cannot run in a pure Nix build.
|
||||
|
||||
The upstream review also checked [TheRock #6712](https://github.com/ROCm/TheRock/issues/6712)
|
||||
and the pin in the current manylinux Dockerfile: both select the same `d0f70ee`
|
||||
patchelf. A local build of release 0.19.3 passed 69 tests with 6 skipped, but still
|
||||
failed the exact same `librocsparse` RPATH rewrite that the TheRock pin passes.
|
||||
[TheRock #2787](https://github.com/ROCm/TheRock/pull/2787) already added
|
||||
`llvm-offload-binary` to the compiler tool list; our archive contains it and only
|
||||
needs its interpreter adapted to Nix. The recent
|
||||
[PyTorch wheel RPATH change #9515](https://github.com/ROCm/TheRock/pull/9515) addresses
|
||||
the wheel layout rather than this standalone SDK tarball.
|
||||
|
||||
To update, change the SDK version and obtain the flat archive hash with
|
||||
`nix store prefetch-file URL --json`. Keep the official target-specific tarball
|
||||
URL and pin the returned hash. Inspect `share/therock/therock_manifest.json` in
|
||||
the result as well as the archive name: the old 10.0.0 archive reported an rc4
|
||||
package version internally, and the official stable 10.1.0 archive reports rc3.
|
||||
|
||||
Build `nix build .#therock-rocm .#therock-rocm.tests.hip`, then run
|
||||
`nix run .#therock-rocm.tests.hip` on a host with GPU access. The HIP test compiles
|
||||
through the SDK's Nix-aware compiler wrapper and checks vector addition and
|
||||
rocBLAS matrix multiplication on the device. Rebuild the four direct consumers and `hipfire-kernels`; also run
|
||||
`nix run .#strixite.tests.gpu` and the flake evaluation checks. Kernel checks
|
||||
do not replace model inference testing.
|
||||
Generated
-673
@@ -1,673 +0,0 @@
|
||||
{
|
||||
"nodes": {
|
||||
"audio-cpp": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"gufo",
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1789940897,
|
||||
"narHash": "sha256-+9tVcd+0TkDxg7JRU7M06Lvm20sXEbuerm62uhm6JKA=",
|
||||
"owner": "0xShug0",
|
||||
"repo": "audio.cpp",
|
||||
"rev": "e3de8e3f3cbfac55ffa58df71426c41550a8598b",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "0xShug0",
|
||||
"repo": "audio.cpp",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"blueprint": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
],
|
||||
"systems": [
|
||||
"systems"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1776249299,
|
||||
"narHash": "sha256-Dt9t1TGRmJFc0xVYhttNBD6QsAgHOHCArqGa0AyjrJY=",
|
||||
"owner": "numtide",
|
||||
"repo": "blueprint",
|
||||
"rev": "56131e8628f173d24a27f6d27c0215eff57e40dd",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "blueprint",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"bun2nix": {
|
||||
"inputs": {
|
||||
"flake-parts": [
|
||||
"flake-parts"
|
||||
],
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
],
|
||||
"systems": [
|
||||
"systems"
|
||||
],
|
||||
"treefmt-nix": [
|
||||
"treefmt-nix"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1777369708,
|
||||
"narHash": "sha256-1xW7cRZNsFNPQD+cE0fwnLVStnDth0HSoASEIFeT7uI=",
|
||||
"owner": "nix-community",
|
||||
"repo": "bun2nix",
|
||||
"rev": "e659e1cc4b8e1b21d0aa85f1c481f9db61ecfa98",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-community",
|
||||
"ref": "staging-2.1.0",
|
||||
"repo": "bun2nix",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-compat": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1767039857,
|
||||
"narHash": "sha256-vNpUSpF5Nuw8xvDLj2KCwwksIbjua2LZCqhV1LNRDns=",
|
||||
"owner": "NixOS",
|
||||
"repo": "flake-compat",
|
||||
"rev": "5edf11c44bc78a0d334f6334cdaf7d60d732daab",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"repo": "flake-compat",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-parts": {
|
||||
"inputs": {
|
||||
"nixpkgs-lib": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1777988971,
|
||||
"narHash": "sha256-qIoWPDs+0/8JecyYgE3gpKQxW/4bLW/gp45vow9ioCQ=",
|
||||
"owner": "hercules-ci",
|
||||
"repo": "flake-parts",
|
||||
"rev": "0678d8986be1661af6bb555f3489f2fdfc31f6ff",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "hercules-ci",
|
||||
"repo": "flake-parts",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-parts_2": {
|
||||
"inputs": {
|
||||
"nixpkgs-lib": "nixpkgs-lib"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1790898470,
|
||||
"narHash": "sha256-zTwuwezD0w3hpga6a6P8emidzAZFyWqlNeRBlpWOOl8=",
|
||||
"owner": "hercules-ci",
|
||||
"repo": "flake-parts",
|
||||
"rev": "024633cd702b10285db5cb19b40ad48d2399ba60",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "hercules-ci",
|
||||
"repo": "flake-parts",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-utils": {
|
||||
"inputs": {
|
||||
"systems": "systems"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1731533236,
|
||||
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"git-hooks-nix": {
|
||||
"inputs": {
|
||||
"flake-compat": "flake-compat",
|
||||
"nixpkgs": [
|
||||
"kyojin",
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1790500375,
|
||||
"narHash": "sha256-XN3sDtn8TU9hAc9xqZ+SqRB/HHm2wjxM6aSWYLJU+oo=",
|
||||
"owner": "cachix",
|
||||
"repo": "git-hooks.nix",
|
||||
"rev": "a0e4241b51206fbcbf52fd322eb5f0cd80f153c4",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "cachix",
|
||||
"repo": "git-hooks.nix",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"gufo": {
|
||||
"inputs": {
|
||||
"audio-cpp": "audio-cpp",
|
||||
"nixpkgs": "nixpkgs"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1793664946,
|
||||
"narHash": "sha256-fsARElSJAbcRu+OBEZXfE+m90W9Cc/696rMaFhGiSNQ=",
|
||||
"owner": "mikealanni",
|
||||
"repo": "gufo",
|
||||
"rev": "6a107cf6aeba7f28db266c2ba100bfb274f65e5a",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "mikealanni",
|
||||
"ref": "fork-enhancements",
|
||||
"repo": "gufo",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"hipfire": {
|
||||
"inputs": {
|
||||
"flake-utils": "flake-utils",
|
||||
"nixpkgs": [
|
||||
"nixpkgs-engine"
|
||||
],
|
||||
"rust-overlay": "rust-overlay"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1793080987,
|
||||
"narHash": "sha256-g2S6zvHD4BeIpVpVKQDlnE5V7A+5kj9MPR7TARgmIo8=",
|
||||
"owner": "warpfront",
|
||||
"repo": "hipfire",
|
||||
"rev": "75c28fc06486457139e47a4abc2df32dd55470f0",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "warpfront",
|
||||
"ref": "v0.4.4",
|
||||
"repo": "hipfire",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"kyojin": {
|
||||
"inputs": {
|
||||
"flake-parts": "flake-parts_2",
|
||||
"git-hooks-nix": "git-hooks-nix",
|
||||
"nixpkgs": "nixpkgs_2",
|
||||
"pyproject-build-systems": "pyproject-build-systems",
|
||||
"pyproject-nix": "pyproject-nix",
|
||||
"uv2nix": "uv2nix"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1794830954,
|
||||
"narHash": "sha256-7wGtQ6ILsIg224S7ERmSui2mbJkAMyc6YRgBTv566Dg=",
|
||||
"owner": "Yamz-Labs",
|
||||
"repo": "kyojin",
|
||||
"rev": "17dd111585570414a4dda0154e8dc5e533cb0aa4",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "Yamz-Labs",
|
||||
"ref": "v1.8.26",
|
||||
"repo": "kyojin",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nix-strix-halo": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1793862511,
|
||||
"narHash": "sha256-4JsLvkORL3XdZ1mbWbqi+uTvkzlQRbM3YlH2iUGbZ9M=",
|
||||
"owner": "hellas-ai",
|
||||
"repo": "nix-strix-halo",
|
||||
"rev": "b2969bd90fedc4a1f9d91648bfdf8f21479b8178",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "hellas-ai",
|
||||
"repo": "nix-strix-halo",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1786384358,
|
||||
"narHash": "sha256-RzPPiWeUtuvymnpuEWsdtzli5w4kjZs49FqEs3/1u+I=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "2fcb964de67fcf60b43471c55d5d99e61a9ccb5a",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs-engine": {
|
||||
"locked": {
|
||||
"lastModified": 1793726008,
|
||||
"narHash": "sha256-jQp1wKvbwWdLBASTXkSi/VYmDJ5AbBi1WvcMt9HWJC8=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "1d060086d60cb76a40cf37109f979d88a5bd6396",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs-latest": {
|
||||
"locked": {
|
||||
"lastModified": 1789149629,
|
||||
"narHash": "sha256-H6GwaZzZf+4npqv0tph94w9tZddSjFjmQrVsW0z78uk=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "eaad089433ca2bb662274377d33df3d0e51ef28b",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs-lib": {
|
||||
"locked": {
|
||||
"lastModified": 1790477367,
|
||||
"narHash": "sha256-oujbxmVKDhci2E4EM3KyAbRUgp5/IsCoiA/LfEF7OOk=",
|
||||
"owner": "nix-community",
|
||||
"repo": "nixpkgs.lib",
|
||||
"rev": "f7cd230690d9fc982d06129f9189b101fddcfa3b",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-community",
|
||||
"repo": "nixpkgs.lib",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs-rust195": {
|
||||
"locked": {
|
||||
"lastModified": 1793633738,
|
||||
"narHash": "sha256-tItrb9M8eYA6WhFgmT9tpGKueri3+wRuVA952o/2xSU=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "7dcdd87373d72e7a2173e4db02e20d3d7f495cfd",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixos-26.05",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs-torch211": {
|
||||
"locked": {
|
||||
"lastModified": 1777954456,
|
||||
"narHash": "sha256-hGdgeU2Nk87RAuZyYjyDjFL6LK7dAZN5RE9+hrDTkDU=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "549bd84d6279f9852cae6225e372cc67fb91a4c1",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "549bd84d6279f9852cae6225e372cc67fb91a4c1",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs_2": {
|
||||
"locked": {
|
||||
"lastModified": 1791456040,
|
||||
"narHash": "sha256-H83yz/do+hjOO0uujHyH8RgtIQP2v7Mw+cLwcZK/xKc=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "e7439b6b14ad3cc35d05608ebca9bce01a25f5f8",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs_3": {
|
||||
"locked": {
|
||||
"lastModified": 1789149629,
|
||||
"narHash": "sha256-H6GwaZzZf+4npqv0tph94w9tZddSjFjmQrVsW0z78uk=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "eaad089433ca2bb662274377d33df3d0e51ef28b",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs_4": {
|
||||
"locked": {
|
||||
"lastModified": 1794042290,
|
||||
"narHash": "sha256-ziZn2PvCJE5JEEpqTdxXwJpPB+L3YqoCpTAMCzyaP3U=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "f4a03c008967841f2a0b3cb7c436fc6fc31671f6",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"pwilkin-llama-cpp": {
|
||||
"inputs": {
|
||||
"flake-parts": [
|
||||
"flake-parts"
|
||||
],
|
||||
"nixpkgs": [
|
||||
"nixpkgs-engine"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1789554350,
|
||||
"narHash": "sha256-xZcqZroS3rUid6w7bVeilixJxUUFDq5S1EeypWCiZBM=",
|
||||
"owner": "pwilkin",
|
||||
"repo": "llama.cpp",
|
||||
"rev": "b0f31f5876ef3856b55f5bb88072cc96e5effafe",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "pwilkin",
|
||||
"ref": "strix-halo",
|
||||
"repo": "llama.cpp",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"pyproject-build-systems": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"kyojin",
|
||||
"nixpkgs"
|
||||
],
|
||||
"pyproject-nix": [
|
||||
"kyojin",
|
||||
"pyproject-nix"
|
||||
],
|
||||
"uv2nix": [
|
||||
"kyojin",
|
||||
"uv2nix"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1791170410,
|
||||
"narHash": "sha256-pyru9MpuXRiyq0Bd4q0nHpL4T6HCuZT4B+alcgAYE4A=",
|
||||
"owner": "pyproject-nix",
|
||||
"repo": "build-system-pkgs",
|
||||
"rev": "953d35d03a51dbecaf3feb3fb679eb63e90ebeb4",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "pyproject-nix",
|
||||
"repo": "build-system-pkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"pyproject-nix": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"kyojin",
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1788394333,
|
||||
"narHash": "sha256-xYOP0Xym1eVGUaHFx+eJEaycFGoiCbst3fZf0xFHP78=",
|
||||
"owner": "pyproject-nix",
|
||||
"repo": "pyproject.nix",
|
||||
"rev": "6a8a7881d75b6f98967e7b8069f4ead331384301",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "pyproject-nix",
|
||||
"repo": "pyproject.nix",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"blueprint": "blueprint",
|
||||
"bun2nix": "bun2nix",
|
||||
"flake-parts": "flake-parts",
|
||||
"gufo": "gufo",
|
||||
"hipfire": "hipfire",
|
||||
"kyojin": "kyojin",
|
||||
"nix-strix-halo": "nix-strix-halo",
|
||||
"nixpkgs": "nixpkgs_3",
|
||||
"nixpkgs-engine": "nixpkgs-engine",
|
||||
"nixpkgs-latest": "nixpkgs-latest",
|
||||
"nixpkgs-rust195": "nixpkgs-rust195",
|
||||
"nixpkgs-torch211": "nixpkgs-torch211",
|
||||
"pwilkin-llama-cpp": "pwilkin-llama-cpp",
|
||||
"strix-llama-cpp": "strix-llama-cpp",
|
||||
"systems": "systems_2",
|
||||
"treefmt-nix": "treefmt-nix",
|
||||
"voicestudio": "voicestudio",
|
||||
"xdna-driver-src": "xdna-driver-src",
|
||||
"xrt-src": "xrt-src"
|
||||
}
|
||||
},
|
||||
"rust-overlay": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"hipfire",
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1778123869,
|
||||
"narHash": "sha256-hV9D8ET33kXjdoMXBT2bwM/j8WQM1SP/dVKZtjQKhAQ=",
|
||||
"owner": "oxalica",
|
||||
"repo": "rust-overlay",
|
||||
"rev": "592e5dedf04f0eaff1ed0f01ce5db7407d9fc7be",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "oxalica",
|
||||
"repo": "rust-overlay",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"strix-llama-cpp": {
|
||||
"inputs": {
|
||||
"flake-parts": [
|
||||
"flake-parts"
|
||||
],
|
||||
"nixpkgs": [
|
||||
"nixpkgs-engine"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1793787912,
|
||||
"narHash": "sha256-2TlKGpTiwIDoFiWwGEYLcXrEJ5eZR7JeZiUjQMgJ8eY=",
|
||||
"owner": "halo-box",
|
||||
"repo": "strix-llama.cpp",
|
||||
"rev": "ea5285ddfc4eb2e457886c4105c77a0cece5f205",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "halo-box",
|
||||
"repo": "strix-llama.cpp",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"systems": {
|
||||
"locked": {
|
||||
"lastModified": 1681028828,
|
||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"systems_2": {
|
||||
"locked": {
|
||||
"lastModified": 1681028828,
|
||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"treefmt-nix": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1775636079,
|
||||
"narHash": "sha256-pc20NRoMdiar8oPQceQT47UUZMBTiMdUuWrYu2obUP0=",
|
||||
"owner": "numtide",
|
||||
"repo": "treefmt-nix",
|
||||
"rev": "790751ff7fd3801feeaf96d7dc416a8d581265ba",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "treefmt-nix",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"uv2nix": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"kyojin",
|
||||
"nixpkgs"
|
||||
],
|
||||
"pyproject-nix": [
|
||||
"kyojin",
|
||||
"pyproject-nix"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1790341335,
|
||||
"narHash": "sha256-wFnDm/o/4OebDlpGFyVXP8DLUx0/gR/jUFuGqmTwsQg=",
|
||||
"owner": "pyproject-nix",
|
||||
"repo": "uv2nix",
|
||||
"rev": "a24323e9e6ecbbf305c238845ff6c612d50467c0",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "pyproject-nix",
|
||||
"repo": "uv2nix",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"voicestudio": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs_4"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1794443361,
|
||||
"narHash": "sha256-i6/8SR9jisXKpEhQV1AXVQgj4tZy/uYD0VJ+XMCswqQ=",
|
||||
"owner": "debpalash",
|
||||
"repo": "VoiceStudio",
|
||||
"rev": "c1050c16d9b3881e5d4161ee58ccc0582b3f20f9",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "debpalash",
|
||||
"ref": "v0.5.8",
|
||||
"repo": "VoiceStudio",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"xdna-driver-src": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1784758690,
|
||||
"narHash": "sha256-YUiM9u9vtISttbThTt9fTtBB/w3d5UatGyVK5mAgWNM=",
|
||||
"ref": "1.7",
|
||||
"rev": "4e5aed38f3b74a5a9a2c7a6222eaff1a8be54305",
|
||||
"revCount": 874,
|
||||
"submodules": true,
|
||||
"type": "git",
|
||||
"url": "https://github.com/amd/xdna-driver"
|
||||
},
|
||||
"original": {
|
||||
"ref": "1.7",
|
||||
"submodules": true,
|
||||
"type": "git",
|
||||
"url": "https://github.com/amd/xdna-driver"
|
||||
}
|
||||
},
|
||||
"xrt-src": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1780589208,
|
||||
"narHash": "sha256-JrqJIGJoQiXTwXjZpqAXVaHx+6i09B1qtqkJzoRPZKw=",
|
||||
"ref": "XRT-2.21",
|
||||
"rev": "8661761775a266b11992a3bd6eb08209d88aa845",
|
||||
"revCount": 8684,
|
||||
"submodules": true,
|
||||
"type": "git",
|
||||
"url": "https://github.com/Xilinx/XRT"
|
||||
},
|
||||
"original": {
|
||||
"ref": "XRT-2.21",
|
||||
"submodules": true,
|
||||
"type": "git",
|
||||
"url": "https://github.com/Xilinx/XRT"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
||||
@@ -1,112 +0,0 @@
|
||||
{
|
||||
description = "Various packages for Nix";
|
||||
|
||||
inputs = {
|
||||
|
||||
nixpkgs-engine.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
hipfire = {
|
||||
url = "github:warpfront/hipfire/v0.4.4";
|
||||
inputs.nixpkgs.follows = "nixpkgs-engine";
|
||||
};
|
||||
nix-strix-halo = {
|
||||
url = "github:hellas-ai/nix-strix-halo";
|
||||
flake = false;
|
||||
};
|
||||
xrt-src = {
|
||||
url = "git+https://github.com/Xilinx/XRT?ref=XRT-2.21&submodules=1";
|
||||
flake = false;
|
||||
};
|
||||
xdna-driver-src = {
|
||||
url = "git+https://github.com/amd/xdna-driver?ref=1.7&submodules=1";
|
||||
flake = false;
|
||||
};
|
||||
pwilkin-llama-cpp = {
|
||||
url = "github:pwilkin/llama.cpp/strix-halo";
|
||||
inputs.nixpkgs.follows = "nixpkgs-engine";
|
||||
inputs.flake-parts.follows = "flake-parts";
|
||||
};
|
||||
strix-llama-cpp = {
|
||||
url = "github:halo-box/strix-llama.cpp";
|
||||
inputs.nixpkgs.follows = "nixpkgs-engine";
|
||||
inputs.flake-parts.follows = "flake-parts";
|
||||
};
|
||||
# VoiceStudio ships its own flake that builds the Electron app. It does not
|
||||
# follow our nixpkgs: its package needs electron_44-bin, which our pinned
|
||||
# nixpkgs revision does not have yet (it stops at electron_43-bin).
|
||||
voicestudio.url = "github:debpalash/VoiceStudio/v0.5.8";
|
||||
gufo.url = "github:mikealanni/gufo/fork-enhancements";
|
||||
kyojin.url = "github:Yamz-Labs/kyojin/v1.8.26";
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
# Newer nixpkgs whose toolchains are required by some packages:
|
||||
# rustc >= 1.95 (mcp-gateway >= 3.4.0), go >= 1.26.3 (kubernetes-mcp-server >= 0.0.66).
|
||||
nixpkgs-latest.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
# freetoken pins torch>=2.11,<2.12 and triton==3.6.0; current
|
||||
# nixos-unstable only ships torch 2.13 / triton 3.7. Keep the previous
|
||||
# nixpkgs revision for freetoken so its CUDA 12.9 / torch 2.11 stack is
|
||||
# unchanged.
|
||||
nixpkgs-torch211.url = "github:NixOS/nixpkgs/549bd84d6279f9852cae6225e372cc67fb91a4c1";
|
||||
# nixos-unstable's Rust 1.98/1.99 cannot assemble AVX-VNNI intrinsics: every call to
|
||||
# _mm512_dpbusd_epi32 / _mm512_dpwssd_epi32 / _mm*_dpwssd_avx_epi32 fails with
|
||||
# "intrinsic signature mismatch for llvm.x86.avx512.vpdp*" against its LLVM 21.1.8. pdfcraft
|
||||
# needs rustc >= 1.95 and pulls that instruction in through rten-gemm, pic-scale and zlib-rs, so
|
||||
# it builds against stable's 1.95.0, which assembles them fine.
|
||||
nixpkgs-rust195.url = "github:NixOS/nixpkgs/nixos-26.05";
|
||||
systems.url = "github:nix-systems/default";
|
||||
blueprint = {
|
||||
url = "github:numtide/blueprint";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
inputs.systems.follows = "systems";
|
||||
};
|
||||
treefmt-nix = {
|
||||
url = "github:numtide/treefmt-nix";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
flake-parts = {
|
||||
url = "github:hercules-ci/flake-parts";
|
||||
inputs.nixpkgs-lib.follows = "nixpkgs";
|
||||
};
|
||||
bun2nix = {
|
||||
# TODO(#4001): drop the branch pin once catalog support
|
||||
# (nix-community/bun2nix#86) reaches the default branch.
|
||||
url = "github:nix-community/bun2nix/staging-2.1.0";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
inputs.systems.follows = "systems";
|
||||
inputs.treefmt-nix.follows = "treefmt-nix";
|
||||
inputs.flake-parts.follows = "flake-parts";
|
||||
};
|
||||
};
|
||||
|
||||
outputs =
|
||||
{ self, ... }@inputs:
|
||||
let
|
||||
blueprintOutputs = inputs.blueprint {
|
||||
inherit inputs;
|
||||
};
|
||||
in
|
||||
blueprintOutputs
|
||||
// {
|
||||
overlays = {
|
||||
hipfire = inputs.hipfire.overlays.default;
|
||||
default = import ./overlays {
|
||||
inherit (blueprintOutputs) packages;
|
||||
};
|
||||
shared-nixpkgs = import ./overlays/shared-nixpkgs.nix {
|
||||
inherit (blueprintOutputs) mkPackagesFor;
|
||||
};
|
||||
};
|
||||
|
||||
nixosModules.hipfire = inputs.hipfire.nixosModules.default;
|
||||
|
||||
nixosModules.default = {
|
||||
nixpkgs.overlays = [ self.overlays.default ];
|
||||
};
|
||||
|
||||
homeManagerModules.default = {
|
||||
imports = [
|
||||
./modules/codex-oauth-proxy-hm.nix
|
||||
./modules/open-code-review-hm.nix
|
||||
./modules/pdfcraft-hm.nix
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,131 +0,0 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.programs.codex-oauth-proxy;
|
||||
marker = ".codex-oauth-proxy-hm-managed";
|
||||
unit = "codex-oauth-proxy.service";
|
||||
unitPath = "${lib.removePrefix config.home.homeDirectory config.xdg.configHome}/systemd/user/${unit}";
|
||||
systemctl = "${pkgs.coreutils}/bin/timeout 30s ${lib.escapeShellArg config.systemd.user.systemctlPath} --user";
|
||||
managerSetup = ''
|
||||
export XDG_RUNTIME_DIR="''${XDG_RUNTIME_DIR:-/run/user/$(id -u)}"
|
||||
case "$(${systemctl} is-system-running 2>/dev/null || true)" in
|
||||
running|degraded) ;;
|
||||
*)
|
||||
echo "codex-oauth-proxy: user systemd manager is unavailable; lifecycle activation failed." >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
'';
|
||||
in
|
||||
{
|
||||
options.programs.codex-oauth-proxy = {
|
||||
enable = lib.mkEnableOption "the codex-oauth-proxy systemd user service";
|
||||
|
||||
package = lib.mkOption {
|
||||
type = lib.types.package;
|
||||
default = pkgs.millerson-nix-overlay.codex-oauth-proxy or pkgs.codex-oauth-proxy;
|
||||
defaultText = lib.literalExpression "pkgs.millerson-nix-overlay.codex-oauth-proxy or pkgs.codex-oauth-proxy";
|
||||
description = "The codex-oauth-proxy package to use.";
|
||||
};
|
||||
|
||||
admin_api_key = lib.mkOption {
|
||||
type = lib.types.nullOr (
|
||||
lib.types.addCheck lib.types.str (value: builtins.match "[ -~]*" value != null)
|
||||
);
|
||||
default = null;
|
||||
description = ''
|
||||
Optional printable ASCII value for this service's ADMIN_API_KEY environment variable.
|
||||
Null omits the assignment. An empty string supplies an empty value.
|
||||
This value is public in the Nix store and through systemd introspection.
|
||||
Do not use this option for a confidential production key.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkMerge [
|
||||
{
|
||||
home.activation.codexOauthProxyStop =
|
||||
lib.hm.dag.entryBetween [ "linkGeneration" ] [ "writeBoundary" ]
|
||||
''
|
||||
(
|
||||
:
|
||||
${lib.optionalString (!cfg.enable) ''
|
||||
if [[ -n "''${oldGenPath:-}" && -f "$oldGenPath/home-files/${marker}" ]]; then
|
||||
${managerSetup}
|
||||
loadState=$(${systemctl} show --property=LoadState --value ${unit}) || exit $?
|
||||
if [[ "$loadState" != not-found ]]; then
|
||||
run ${systemctl} stop ${unit}
|
||||
fi
|
||||
fi
|
||||
''}
|
||||
)
|
||||
'';
|
||||
|
||||
home.activation.codexOauthProxyStart = lib.hm.dag.entryAfter [ "linkGeneration" "reloadSystemd" ] ''
|
||||
(
|
||||
if ${
|
||||
if cfg.enable then
|
||||
"true"
|
||||
else
|
||||
''[[ -n "''${oldGenPath:-}" && -f "$oldGenPath/home-files/${marker}" ]]''
|
||||
}; then
|
||||
${managerSetup}
|
||||
run ${systemctl} daemon-reload
|
||||
${lib.optionalString cfg.enable ''
|
||||
action=start
|
||||
${lib.optionalString
|
||||
(builtins.elem config.systemd.user.startServices [
|
||||
false
|
||||
"suggest"
|
||||
])
|
||||
''
|
||||
if [[ -n "''${oldGenPath:-}" && -f "$oldGenPath/home-files/${marker}" ]] &&
|
||||
! cmp -s "$oldGenPath/home-files"${lib.escapeShellArg unitPath} "$newGenPath/home-files"${lib.escapeShellArg unitPath}; then
|
||||
action=restart
|
||||
fi
|
||||
''
|
||||
}
|
||||
run ${systemctl} "$action" ${unit}
|
||||
''}
|
||||
fi
|
||||
)
|
||||
'';
|
||||
}
|
||||
(lib.mkIf cfg.enable {
|
||||
assertions = [
|
||||
{
|
||||
assertion = pkgs.stdenv.hostPlatform.isLinux;
|
||||
message = "programs.codex-oauth-proxy requires a Linux systemd user manager.";
|
||||
}
|
||||
];
|
||||
|
||||
home.packages = [ cfg.package ];
|
||||
home.file.${marker}.text = "codex-oauth-proxy Home Manager ownership\n";
|
||||
|
||||
systemd.user.services.codex-oauth-proxy = {
|
||||
Unit.Description = "Codex OAuth proxy";
|
||||
Service = {
|
||||
Type = "simple";
|
||||
ExecStart = "${lib.getExe cfg.package} --creds-store=auto --creds-path=%S/codex-oauth-proxy/auth.json";
|
||||
StateDirectory = "codex-oauth-proxy";
|
||||
StateDirectoryMode = "0700";
|
||||
UMask = "0077";
|
||||
Restart = "on-failure";
|
||||
RestartSec = 5;
|
||||
StandardOutput = "null";
|
||||
StandardError = "null";
|
||||
}
|
||||
// lib.optionalAttrs (cfg.admin_api_key != null) {
|
||||
Environment = [
|
||||
(builtins.replaceStrings [ "%" ] [ "%%" ] (builtins.toJSON ("ADMIN_API_KEY=" + cfg.admin_api_key)))
|
||||
];
|
||||
};
|
||||
Install.WantedBy = [ "default.target" ];
|
||||
};
|
||||
})
|
||||
];
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
# Home Manager module: installs the OpenCode plugin for OpenCodeReview.
|
||||
#
|
||||
# Creates symlinks under ~/.config/opencode/plugins/ for the plugin file and
|
||||
# its runtime node_modules, and puts the matching `ocr` CLI on PATH.
|
||||
#
|
||||
# Note: the node_modules symlink is shared by everything in the plugins
|
||||
# directory. Plugins installed by other means that need conflicting npm
|
||||
# dependencies cannot coexist with this one.
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
cfg = config.programs.open-code-review;
|
||||
in
|
||||
{
|
||||
options.programs.open-code-review = {
|
||||
enable = lib.mkEnableOption "OpenCodeReview AI code review CLI and its OpenCode plugin";
|
||||
|
||||
package = lib.mkOption {
|
||||
type = lib.types.package;
|
||||
default = pkgs.open-code-review;
|
||||
defaultText = lib.literalExpression "pkgs.open-code-review";
|
||||
description = "The open-code-review package to use.";
|
||||
};
|
||||
|
||||
opencode = {
|
||||
enable = lib.mkEnableOption "symlink the bundled OpenCode plugin into ~/.config/opencode";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable (lib.mkMerge [
|
||||
{
|
||||
home.packages = [ cfg.package ];
|
||||
}
|
||||
(lib.mkIf cfg.opencode.enable {
|
||||
# The plugin resolves its imports Node-style: node_modules next to the
|
||||
# plugin file, or in any parent directory (via the file's realpath).
|
||||
# Linking both the file and node_modules covers either resolution.
|
||||
xdg.configFile."opencode/plugins/open-code-review.ts".source =
|
||||
"${cfg.package.passthru.opencode-plugin}/share/open-code-review/opencode/open-code-review.ts";
|
||||
|
||||
xdg.configFile."opencode/plugins/node_modules".source =
|
||||
"${cfg.package.passthru.opencode-plugin}/share/open-code-review/opencode/node_modules";
|
||||
})
|
||||
]);
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
# Home Manager module: installs PdfCraft and its command-line tool.
|
||||
#
|
||||
# The package puts both `pdfcraft` (the desktop app) and `pdfcraft-cli` (headless runner and
|
||||
# opt-in MCP server) on PATH, and its icons, desktop entry and AppStream metadata in
|
||||
# $out/share, which a NixOS system profile or an XDG_DATA_DIRS that covers ~/.nix-profile/share
|
||||
# shows in the application launcher.
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
cfg = config.programs.pdfcraft;
|
||||
in
|
||||
{
|
||||
options.programs.pdfcraft = {
|
||||
enable = lib.mkEnableOption "PdfCraft PDF workbench and its pdfcraft-cli tool";
|
||||
|
||||
package = lib.mkOption {
|
||||
type = lib.types.package;
|
||||
# The flake's overlay keeps its packages under the `millerson-nix-overlay` namespace.
|
||||
default = pkgs.millerson-nix-overlay.pdfcraft or pkgs.pdfcraft;
|
||||
defaultText = lib.literalExpression "pkgs.millerson-nix-overlay.pdfcraft or pkgs.pdfcraft";
|
||||
description = "The pdfcraft package to use.";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
home.packages = [ cfg.package ];
|
||||
};
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
{
|
||||
packages,
|
||||
}:
|
||||
final: _prev: {
|
||||
millerson-nix-overlay =
|
||||
packages.${final.stdenv.hostPlatform.system}
|
||||
or (final.lib.warn "millerson-overlay: no packages for system ${final.stdenv.hostPlatform.system}"
|
||||
{ }
|
||||
);
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
{
|
||||
mkPackagesFor,
|
||||
}:
|
||||
# Builds the packages/ tree against the consumer's `final`, so deps are
|
||||
# shared with the rest of their system and no second nixpkgs is
|
||||
# evaluated. Trade-off vs overlays.default: the binary cache only hits
|
||||
# when the consumer's nixpkgs revision matches ours.
|
||||
final: _prev: {
|
||||
millerson-nix-overlay = mkPackagesFor final;
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
{ pkgs, ... }:
|
||||
pkgs.callPackage ./package.nix { }
|
||||
@@ -1,52 +0,0 @@
|
||||
{
|
||||
lib,
|
||||
rustPlatform,
|
||||
fetchFromGitHub,
|
||||
}:
|
||||
|
||||
rustPlatform.buildRustPackage rec {
|
||||
pname = "agnix";
|
||||
version = "0.60.3";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "agent-sh";
|
||||
repo = "agnix";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-XXrt9bgWLMPgsdiIp88SajpQpQ6nbSfGWu2WtHk2q8c=";
|
||||
};
|
||||
|
||||
cargoHash = "sha256-wA2xnizHT5OuKOasxMYya/eJHWD0JaGUTYZpVcsEOFc=";
|
||||
|
||||
# One build for the three native binaries, like upstream's release job. The
|
||||
# wasm crate is left out: it only compiles for wasm targets.
|
||||
cargoBuildFlags = [
|
||||
"-p"
|
||||
"agnix-cli"
|
||||
"-p"
|
||||
"agnix-lsp"
|
||||
"-p"
|
||||
"agnix-mcp"
|
||||
"--bins"
|
||||
];
|
||||
|
||||
passthru.category = "AI Coding Agents";
|
||||
|
||||
passthru.updateScript = [
|
||||
"nix-update"
|
||||
"--flake"
|
||||
".#agnix"
|
||||
];
|
||||
|
||||
meta = with lib; {
|
||||
description = "Linter for AI agent config files (CLAUDE.md, AGENTS.md, SKILL.md, hooks, MCP), with agnix-lsp and agnix-mcp";
|
||||
homepage = "https://github.com/agent-sh/agnix";
|
||||
changelog = "https://github.com/agent-sh/agnix/blob/v${version}/CHANGELOG.md";
|
||||
license = with licenses; [
|
||||
mit
|
||||
asl20
|
||||
];
|
||||
sourceProvenance = with sourceTypes; [ fromSource ];
|
||||
mainProgram = "agnix";
|
||||
platforms = platforms.all;
|
||||
};
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
{
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
pkgs.callPackage ./package.nix { }
|
||||
@@ -1,230 +0,0 @@
|
||||
{
|
||||
lib,
|
||||
stdenv,
|
||||
fetchFromGitHub,
|
||||
bun,
|
||||
nodejs,
|
||||
node-gyp,
|
||||
electron,
|
||||
autoPatchelfHook,
|
||||
makeWrapper,
|
||||
copyDesktopItems,
|
||||
imagemagick,
|
||||
python3,
|
||||
cacert,
|
||||
}:
|
||||
|
||||
let
|
||||
version = "2.2.2";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "iOfficeAI";
|
||||
repo = "AionUi";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-HyDzlUOg0OAGNhNveG/5Ba2UbgoR4VTQsbUGUzGmKd4=";
|
||||
};
|
||||
|
||||
# FOD 1: All dependencies (dev + prod) for the build phase.
|
||||
bunBuildDeps = stdenv.mkDerivation {
|
||||
name = "aionui-build-deps-${version}";
|
||||
inherit src;
|
||||
nativeBuildInputs = [
|
||||
bun
|
||||
cacert
|
||||
];
|
||||
outputHashAlgo = "sha256";
|
||||
outputHashMode = "recursive";
|
||||
outputHash = "sha256-+vLK5f1rhcXAhHz0v1LkMbcBjBLFCHVTWbdamZIjOwY=";
|
||||
dontPatchShebangs = true;
|
||||
dontFixup = true;
|
||||
SSL_CERT_FILE = "${cacert}/etc/ssl/certs/ca-bundle.crt";
|
||||
|
||||
buildPhase = ''
|
||||
export HOME=$TMPDIR
|
||||
bun install --frozen-lockfile --ignore-scripts
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out
|
||||
cp -r node_modules $out/
|
||||
cp -r packages $out/
|
||||
cp tsconfig.json $out/
|
||||
'';
|
||||
};
|
||||
|
||||
# FOD 2: Production-only dependencies for the runtime output.
|
||||
# Mirrors the Dockerfile's `bun install --production --ignore-scripts`.
|
||||
bunProdDeps = stdenv.mkDerivation {
|
||||
name = "aionui-prod-deps-${version}";
|
||||
inherit src;
|
||||
nativeBuildInputs = [
|
||||
bun
|
||||
cacert
|
||||
];
|
||||
outputHashAlgo = "sha256";
|
||||
outputHashMode = "recursive";
|
||||
outputHash = "sha256-CzVH9zQsssdkCX/BpUxQw1wnJQKzLYWWXZt3sn7eBFI=";
|
||||
dontPatchShebangs = true;
|
||||
dontFixup = true;
|
||||
SSL_CERT_FILE = "${cacert}/etc/ssl/certs/ca-bundle.crt";
|
||||
|
||||
buildPhase = ''
|
||||
export HOME=$TMPDIR
|
||||
bun install --frozen-lockfile --production --ignore-scripts
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out
|
||||
cp -r node_modules $out/
|
||||
'';
|
||||
};
|
||||
in
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "aionui";
|
||||
inherit version src;
|
||||
|
||||
nativeBuildInputs = [
|
||||
bun
|
||||
nodejs
|
||||
node-gyp
|
||||
autoPatchelfHook
|
||||
makeWrapper
|
||||
copyDesktopItems
|
||||
imagemagick
|
||||
python3
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
stdenv.cc.cc.lib
|
||||
];
|
||||
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
|
||||
export HOME=$TMPDIR
|
||||
|
||||
# Use the full dependency set for the build
|
||||
ln -sf ${bunBuildDeps}/node_modules .
|
||||
|
||||
# ── Build better-sqlite3 native addon ──────────────────────
|
||||
echo "Building better-sqlite3 from source..."
|
||||
BT3_SRC=$TMPDIR/bts3-src
|
||||
BT3_OUT=$TMPDIR/bts3-out
|
||||
mkdir -p "$BT3_SRC" "$BT3_OUT"
|
||||
cp -rL node_modules/better-sqlite3/* "$BT3_SRC/"
|
||||
chmod -R u+w "$BT3_SRC"
|
||||
(
|
||||
cd "$BT3_SRC"
|
||||
export npm_config_nodedir=${nodejs}
|
||||
node-gyp rebuild
|
||||
mkdir -p "$BT3_OUT/build/Release"
|
||||
cp build/Release/better_sqlite3.node "$BT3_OUT/build/Release/" 2>/dev/null || true
|
||||
)
|
||||
|
||||
# ── electron-vite build ───────────────────────────────────
|
||||
echo "Running electron-vite build..."
|
||||
${nodejs}/bin/node node_modules/.bin/electron-vite build \
|
||||
--config packages/desktop/electron.vite.config.ts
|
||||
|
||||
# ── Bundle MCP servers ────────────────────────────────────
|
||||
echo "Building MCP servers..."
|
||||
${nodejs}/bin/node scripts/build-mcp-servers.js
|
||||
|
||||
runHook postBuild
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
mkdir -p $out/{bin,lib/aionui}
|
||||
|
||||
# ── Built output ──────────────────────────────────────────
|
||||
cp -r out $out/lib/aionui/
|
||||
cp -r public $out/lib/aionui/
|
||||
cp package.json $out/lib/aionui/
|
||||
|
||||
# ── Production-only node_modules (mirrors Dockerfile) ─────
|
||||
cp -a ${bunProdDeps}/node_modules $out/lib/aionui/node_modules
|
||||
chmod -R u+w $out/lib/aionui/node_modules
|
||||
|
||||
# Remove workspace symlink – @aionui/web-host is bundled by
|
||||
# electron-vite (excluded from externalizeDepsPlugin), so the
|
||||
# symlink to packages/web-host is not needed at runtime.
|
||||
rm -f $out/lib/aionui/node_modules/@aionui/web-host
|
||||
|
||||
# @sentry/electron requires @sentry/node at runtime, but bun
|
||||
# nests it inside .bun/ rather than hoisting to top-level.
|
||||
# Electron's require() walks up from the resolved realpath
|
||||
# and needs it accessible either at top-level or via the
|
||||
# symlink target's node_modules. We ensure top-level access.
|
||||
if [ ! -e $out/lib/aionui/node_modules/@sentry/node ]; then
|
||||
SRC=$(echo $out/lib/aionui/node_modules/.bun/@sentry+node@*/node_modules/@sentry/node)
|
||||
if [ -d "$SRC" ]; then
|
||||
ln -sf "$(realpath --relative-to=$out/lib/aionui/node_modules/@sentry "$SRC")" \
|
||||
$out/lib/aionui/node_modules/@sentry/node
|
||||
fi
|
||||
fi
|
||||
|
||||
# Inject compiled better-sqlite3 .node into the runtime tree
|
||||
if [ -f "$TMPDIR/bts3-out/build/Release/better_sqlite3.node" ]; then
|
||||
rm -rf $out/lib/aionui/node_modules/better-sqlite3
|
||||
cp -rL ${bunProdDeps}/node_modules/better-sqlite3 $out/lib/aionui/node_modules/better-sqlite3 2>/dev/null || true
|
||||
chmod -R u+w $out/lib/aionui/node_modules/better-sqlite3
|
||||
mkdir -p $out/lib/aionui/node_modules/better-sqlite3/build/Release
|
||||
cp "$TMPDIR/bts3-out/build/Release/better_sqlite3.node" \
|
||||
$out/lib/aionui/node_modules/better-sqlite3/build/Release/
|
||||
fi
|
||||
|
||||
# ── Desktop entry ─────────────────────────────────────────
|
||||
mkdir -p $out/share/applications
|
||||
cat > $out/share/applications/aionui.desktop << EOF
|
||||
[Desktop Entry]
|
||||
Name=AionUi
|
||||
Comment=Free, open-source Cowork app with AI Agents
|
||||
Exec=$out/bin/aionui
|
||||
Icon=aionui
|
||||
Terminal=false
|
||||
Type=Application
|
||||
Categories=Office;Utility;
|
||||
EOF
|
||||
|
||||
mkdir -p $out/share/icons/hicolor/256x256/apps
|
||||
if [ -f resources/app.png ]; then
|
||||
convert resources/app.png -resize 256x256 \
|
||||
$out/share/icons/hicolor/256x256/apps/aionui.png
|
||||
fi
|
||||
|
||||
# ── Launcher ──────────────────────────────────────────────
|
||||
makeWrapper ${electron}/bin/electron $out/bin/aionui \
|
||||
--add-flags "$out/lib/aionui"
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
dontStrip = true;
|
||||
autoPatchelfIgnoreMissingDeps = true;
|
||||
|
||||
desktopItems = [ "aionui.desktop" ];
|
||||
|
||||
doCheck = false;
|
||||
|
||||
passthru = {
|
||||
category = "AI Coding Agents";
|
||||
updateScript = [
|
||||
"nix-update"
|
||||
"--flake"
|
||||
".#aionui"
|
||||
];
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
description = "Free, open-source, Cowork app with AI Agents";
|
||||
homepage = "https://github.com/iOfficeAI/AionUi";
|
||||
changelog = "https://github.com/iOfficeAI/AionUi/releases/tag/v${version}";
|
||||
license = licenses.asl20;
|
||||
sourceProvenance = with sourceTypes; [ fromSource ];
|
||||
mainProgram = "aionui";
|
||||
platforms = platforms.linux;
|
||||
};
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
{
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
pkgs.callPackage ./package.nix { }
|
||||
@@ -1,51 +0,0 @@
|
||||
{
|
||||
lib,
|
||||
rustPlatform,
|
||||
fetchFromGitHub,
|
||||
cmake,
|
||||
perl,
|
||||
}:
|
||||
|
||||
rustPlatform.buildRustPackage rec {
|
||||
pname = "awg-tool";
|
||||
version = "0.5.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "Vadim-Khristenko";
|
||||
repo = "awg-containers-and-tools";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-mO4xKUHee2zR14rFgJexeTr0kj9mdahg37tCtQUq2dI=";
|
||||
};
|
||||
|
||||
# awg-core builds ssh2 with vendored-openssl, which compiles libssh2
|
||||
# (via cmake) and OpenSSL (via perl Configure) from source.
|
||||
nativeBuildInputs = [
|
||||
cmake
|
||||
perl
|
||||
];
|
||||
|
||||
cargoHash = "sha256-NDTwo0j5ufuFM0BVYOtnju1G9y9M6SKuiWMWIb7idBY=";
|
||||
|
||||
# Upstream tests exercise Docker/SSH targets; unit tests are already
|
||||
# covered by the upstream CI before a release is cut.
|
||||
doCheck = false;
|
||||
|
||||
passthru = {
|
||||
category = "Networking";
|
||||
updateScript = [
|
||||
"nix-update"
|
||||
"--flake"
|
||||
".#awg-tool"
|
||||
];
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
description = "CLI for AmneziaWG self-hosting — generates 1.0/1.5/2.0/3.0 obfuscation parameters, exports .conf and vpn:// configs, installs servers over SSH";
|
||||
homepage = "https://github.com/Vadim-Khristenko/awg-containers-and-tools";
|
||||
changelog = "https://github.com/Vadim-Khristenko/awg-containers-and-tools/releases/tag/v${version}";
|
||||
license = licenses.mit;
|
||||
sourceProvenance = with sourceTypes; [ fromSource ];
|
||||
mainProgram = "awg-tool";
|
||||
platforms = platforms.linux;
|
||||
};
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
{
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
pkgs.callPackage ./package.nix { }
|
||||
@@ -1,38 +0,0 @@
|
||||
{
|
||||
lib,
|
||||
rustPlatform,
|
||||
fetchFromGitea,
|
||||
}:
|
||||
|
||||
rustPlatform.buildRustPackage rec {
|
||||
pname = "awgen";
|
||||
version = "0.3.3";
|
||||
|
||||
src = fetchFromGitea {
|
||||
domain = "git.millerson.name";
|
||||
owner = "alex";
|
||||
repo = "awgen";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-AVETCmkiHAXT22izrluuJZLEPi0C/DD02heBb0f/aqI=";
|
||||
};
|
||||
|
||||
cargoHash = "sha256-e2XBzPhEvZ5sHvqPwEFXTNsCvmMdgQIj5v2eaKsgrLQ=";
|
||||
|
||||
passthru = {
|
||||
category = "Networking";
|
||||
updateScript = [
|
||||
"nix-update"
|
||||
"--flake"
|
||||
"awgen"
|
||||
];
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
description = "Offline, stateless CLI for AmneziaWG configurations — harmonises native .conf and vpn:// inputs, generates client participants and tunnels, and analyses obfuscation";
|
||||
homepage = "https://git.millerson.name/alex/awgen";
|
||||
changelog = "https://git.millerson.name/alex/awgen/commits/tag/v${version}";
|
||||
license = licenses.mit;
|
||||
mainProgram = "awgen";
|
||||
platforms = platforms.unix;
|
||||
};
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
{
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
pkgs.callPackage ./package.nix {
|
||||
# Not a package of its own: codeaf is the only consumer, and codeaf is the one
|
||||
# that knows which furrow version it pinned. See ./furrow.nix.
|
||||
furrow = pkgs.callPackage ./furrow.nix { };
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
{
|
||||
lib,
|
||||
rustPlatform,
|
||||
fetchFromGitHub,
|
||||
}:
|
||||
|
||||
# furrow is the copy-on-write workspace snapper codeaf drives. codeaf ships a
|
||||
# copy of it inside the go binary: the release asset from GitHub, glibc-dynamic
|
||||
# and untouched by anything in this build, so the file codeaf writes out to
|
||||
# ~/.codeaf/bin/furrow-<version> cannot start here — NixOS answers "Could not
|
||||
# start dynamically linked executable" and names stub-ld. Building furrow here
|
||||
# instead gives the same version as an ordinary Nix binary, and codeaf is told
|
||||
# to use it through CODEAF_FURROW, which internal/furrow reads before it ever
|
||||
# looks at the embedded copy. See ./package.nix.
|
||||
#
|
||||
# The version here has to be the one codeaf pinned in
|
||||
# internal/furrowbin/pin.json: the decoders in codeaf were written for that
|
||||
# furrow. Bump the two together.
|
||||
rustPlatform.buildRustPackage rec {
|
||||
pname = "furrow";
|
||||
version = "0.1.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "Agent-Field";
|
||||
repo = "furrow";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-xknfvnBDFxDYeBE1yAjXl1Fx3VDHrNSUhXEWQO3PK6s=";
|
||||
};
|
||||
|
||||
cargoHash = "sha256-FGtrKtWFPcT3R8nF5OQFlmIiKSuZ8aiHfj76bBvga5A=";
|
||||
|
||||
# Only the unit tests run here. Every cli integration test builds a fixture
|
||||
# whose first step is `xattr::set(…, "user.furrow-test", …)`, and the sandbox
|
||||
# /tmp is a tmpfs that answers EOPNOTSUPP for user.* xattrs, so all 54 of them
|
||||
# die in setup — same reason forks_files_links_modes_and_xattrs is skipped, in
|
||||
# the one lib test that touches an xattr. Upstream's CI runs the whole suite on
|
||||
# a filesystem that supports them.
|
||||
cargoTestFlags = [ "--lib" ];
|
||||
checkFlags = [
|
||||
"--skip"
|
||||
"forks_files_links_modes_and_xattrs"
|
||||
];
|
||||
|
||||
meta = with lib; {
|
||||
description = "Local-first working-state snapshots for agentic development";
|
||||
homepage = "https://github.com/Agent-Field/furrow";
|
||||
changelog = "https://github.com/Agent-Field/furrow/releases/tag/v${version}";
|
||||
license = licenses.asl20;
|
||||
# Thirteen source files use std::os::unix with no windows guards, so the
|
||||
# upstream release has no windows asset either.
|
||||
platforms = platforms.unix;
|
||||
mainProgram = "furrow";
|
||||
};
|
||||
}
|
||||
@@ -1,94 +0,0 @@
|
||||
{
|
||||
lib,
|
||||
buildGoModule,
|
||||
fetchFromGitHub,
|
||||
makeWrapper,
|
||||
furrow,
|
||||
}:
|
||||
|
||||
# codeaf carries a furrow inside itself: internal/furrowbin embeds whatever is
|
||||
# staged in internal/furrowbin/cache and, on first use, writes it out to
|
||||
# ~/.codeaf/bin/furrow-<version>. Upstream stages the GitHub release asset there,
|
||||
# whose bytes are someone else's glibc-dynamic build that no Nix phase ever
|
||||
# touched, so the file that lands in the state root cannot start here. Staging a
|
||||
# rebuilt furrow is not an option either: upstream's fetcher re-checks the sha256
|
||||
# named in internal/furrowbin/pin.json and would refuse one. So this build stages
|
||||
# nothing, and hands over ./furrow.nix through CODEAF_FURROW instead, which
|
||||
# internal/furrow reads before it looks at the embedded copy at all. Nothing of
|
||||
# furrow's ends up in the codeaf binary; without that variable codeaf looks for
|
||||
# furrow on PATH, the way a plain `go build` does.
|
||||
#
|
||||
# A codeaf run without this wrapper is not the same program: it has no furrow
|
||||
# unless one is on PATH.
|
||||
buildGoModule rec {
|
||||
pname = "codeaf";
|
||||
version = "0.8.2";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "Agent-Field";
|
||||
repo = "CodeAF";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-Gz/o32b/HeDsOJtC4nKL79ArPdNtD3kIq3nzp+vLffE=";
|
||||
};
|
||||
|
||||
vendorHash = "sha256-stp2h8l3MkewQXuOVbExQu1LjKoET/jvCSqtqIGMItY=";
|
||||
|
||||
env.CGO_ENABLED = 0;
|
||||
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
|
||||
# The shipped binary carries the packed manual rather than the raw Markdown.
|
||||
tags = [ "codeaf_packed_manual" ];
|
||||
|
||||
subPackages = [ "cmd/codeaf" ];
|
||||
|
||||
# Upstream's own suite is a CI matrix (make test / make check) with network
|
||||
# and timing assumptions; it is not buildGoModule-shaped.
|
||||
doCheck = false;
|
||||
|
||||
# `make build` runs a host-side step before compiling: packing the manual into
|
||||
# what the codeaf_packed_manual tag embeds. It is built for the build machine
|
||||
# even when codeaf targets another platform, hence the unset GOOS/GOARCH. The
|
||||
# vendoring derivation runs preBuild too, before vendor/ exists, and this step
|
||||
# needs the vendored dependencies, so it waits for it. Upstream's other step,
|
||||
# staging the furrow release, is deliberately not run: see ./furrow.nix.
|
||||
preBuild = ''
|
||||
if [ -d vendor ]; then
|
||||
env -u GOOS -u GOARCH go generate ./internal/manual
|
||||
fi
|
||||
'';
|
||||
|
||||
postInstall = ''
|
||||
wrapProgram $out/bin/codeaf --set CODEAF_FURROW ${furrow}/bin/furrow
|
||||
'';
|
||||
|
||||
ldflags = [
|
||||
"-s"
|
||||
"-w"
|
||||
"-X github.com/Agent-Field/codeaf/internal/buildinfo.rev=${version}"
|
||||
"-X github.com/Agent-Field/codeaf/internal/buildinfo.dirty=false"
|
||||
];
|
||||
|
||||
passthru = {
|
||||
inherit furrow;
|
||||
category = "AI Coding Agents";
|
||||
updateScript = [
|
||||
"nix-update"
|
||||
"--flake"
|
||||
".#codeaf"
|
||||
# furrow.nix is not a flake output, so nix-update never touches it: bump it
|
||||
# by hand alongside the version codeaf pins in internal/furrowbin/pin.json.
|
||||
];
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
description = "Coding harness and software factory for open models: hand off work and watch every project from one terminal";
|
||||
homepage = "https://github.com/Agent-Field/CodeAF";
|
||||
changelog = "https://github.com/Agent-Field/CodeAF/blob/v${version}/CHANGELOG.md";
|
||||
license = licenses.asl20;
|
||||
# Runs the furrow built from source by ./furrow.nix, not the release asset
|
||||
# upstream would have embedded.
|
||||
mainProgram = "codeaf";
|
||||
platforms = platforms.linux ++ platforms.darwin;
|
||||
};
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
--- a/src/codex_api_proxy/cli.py
|
||||
+++ b/src/codex_api_proxy/cli.py
|
||||
@@ -405,11 +405,15 @@
|
||||
if args.proxy:
|
||||
command.extend(["--proxy", args.proxy])
|
||||
|
||||
+ env = dict(os.environ)
|
||||
+ env["PYTHONPATH"] = os.pathsep.join(path for path in sys.path if path)
|
||||
+
|
||||
with args.log_file.open("ab") as log:
|
||||
process = subprocess.Popen(
|
||||
command,
|
||||
stdin=subprocess.DEVNULL,
|
||||
stdout=log,
|
||||
stderr=subprocess.STDOUT,
|
||||
+ env=env,
|
||||
start_new_session=True,
|
||||
)
|
||||
args.pid_file.write_text(f"{process.pid}\n", encoding="utf-8")
|
||||
@@ -1,5 +0,0 @@
|
||||
{
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
pkgs.callPackage ./package.nix { }
|
||||
@@ -1,76 +0,0 @@
|
||||
{
|
||||
lib,
|
||||
python3Packages,
|
||||
fetchPypi,
|
||||
}:
|
||||
|
||||
python3Packages.buildPythonApplication rec {
|
||||
pname = "codex-api-proxy";
|
||||
version = "0.1.6";
|
||||
pyproject = true;
|
||||
|
||||
# The sdist filename uses an underscore; PyPI's legacy source path only
|
||||
# resolves that spelling.
|
||||
src = fetchPypi {
|
||||
pname = "codex_api_proxy";
|
||||
inherit version;
|
||||
hash = "sha256-EjH5Lz1hYH0K/i6kzcXVZMJSWSppuibOP5hVreod6po=";
|
||||
};
|
||||
|
||||
# pyproject.toml has no [build-system] table, so the default setuptools
|
||||
# backend builds the src/ layout.
|
||||
build-system = with python3Packages; [
|
||||
setuptools
|
||||
];
|
||||
|
||||
# `start` re-runs sys.executable with `-m codex_api_proxy.cli`. The Nix
|
||||
# console wrapper injects site paths with site.addsitedir, not PYTHONPATH,
|
||||
# so the daemon child cannot import the package. Pass the parent's sys.path
|
||||
# through the environment.
|
||||
patches = [ ./daemon-pythonpath.patch ];
|
||||
|
||||
# [project.dependencies] plus the uvicorn[standard] extra.
|
||||
dependencies = with python3Packages; [
|
||||
fastapi
|
||||
httpx
|
||||
uvicorn
|
||||
] ++ uvicorn.optional-dependencies.standard;
|
||||
|
||||
nativeCheckInputs = with python3Packages; [
|
||||
pytestCheckHook
|
||||
pytest-asyncio
|
||||
];
|
||||
|
||||
# test_release_version.py imports scripts/set_version.py and expects the
|
||||
# Makefile, neither of which is part of the sdist.
|
||||
disabledTestPaths = [ "tests/test_release_version.py" ];
|
||||
|
||||
# These two monkeypatch main's auth loader, but models.list_models calls the
|
||||
# auth module's loader directly, so they need a real ~/.codex/auth.json.
|
||||
disabledTests = [
|
||||
"test_models_endpoint_uses_cache"
|
||||
"test_models_endpoint_refresh_bypasses_cache"
|
||||
];
|
||||
|
||||
pythonImportsCheck = [ "codex_api_proxy" ];
|
||||
|
||||
passthru = {
|
||||
category = "AI LLM Gateway";
|
||||
updateScript = [
|
||||
"nix-update"
|
||||
"--flake"
|
||||
".#codex-api-proxy"
|
||||
];
|
||||
};
|
||||
|
||||
meta = {
|
||||
description = "Local OpenAI-compatible HTTP proxy backed by Codex/OpenAI credentials";
|
||||
homepage = "https://pypi.org/project/codex-api-proxy/";
|
||||
changelog = "https://pypi.org/project/codex-api-proxy/#history";
|
||||
license = lib.licenses.mit;
|
||||
sourceProvenance = with lib.sourceTypes; [ fromSource ];
|
||||
mainProgram = "codex-api-proxy";
|
||||
platforms = lib.platforms.unix;
|
||||
maintainers = [ ];
|
||||
};
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
[Unit]
|
||||
Description=Codex OAuth proxy
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=@out@/bin/codex-oauth-proxy --creds-store=auto --creds-path=%S/codex-oauth-proxy/auth.json
|
||||
StateDirectory=codex-oauth-proxy
|
||||
StateDirectoryMode=0700
|
||||
UMask=0077
|
||||
Restart=on-failure
|
||||
RestartSec=5
|
||||
StandardOutput=null
|
||||
StandardError=null
|
||||
|
||||
[Install]
|
||||
WantedBy=default.target
|
||||
@@ -1,5 +0,0 @@
|
||||
{
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
pkgs.callPackage ./package.nix { }
|
||||
@@ -1,65 +0,0 @@
|
||||
diff --git a/internal/server/models.go b/internal/server/models.go
|
||||
index 5f253c22aad5..7c8531d0a9cb 100644
|
||||
--- a/internal/server/models.go
|
||||
+++ b/internal/server/models.go
|
||||
@@ -20,6 +20,7 @@ const (
|
||||
modelGPT6Astra = "gpt-6-astra"
|
||||
modelGPT6Sol = "gpt-6-sol"
|
||||
modelGPT61Sol = "gpt-6.1-sol"
|
||||
+ modelGPT61Terra = "gpt-6.1-terra"
|
||||
modelGPT6Luna = "gpt-6-luna"
|
||||
modelDaybreakBlue = "gpt-daybreak-blue-latest"
|
||||
|
||||
@@ -41,6 +42,7 @@ var modelAllowedEfforts = map[string][]string{
|
||||
modelGPT6Astra: {"low", "medium", "high", "xhigh", "max"},
|
||||
modelGPT6Sol: {"low", "medium", "high", "xhigh", "max"},
|
||||
modelGPT61Sol: {"low", "medium", "high", "xhigh", "max"},
|
||||
+ modelGPT61Terra: {"low", "medium", "high", "xhigh", "max"},
|
||||
modelGPT6Luna: {"low", "medium", "high", "xhigh", "max"},
|
||||
modelDaybreakBlue: {"none", "low", "medium", "high", "xhigh", "max"},
|
||||
}
|
||||
@@ -57,6 +59,7 @@ var modelDefaultEffort = map[string]string{
|
||||
modelGPT6Astra: "medium",
|
||||
modelGPT6Sol: "medium",
|
||||
modelGPT61Sol: "low",
|
||||
+ modelGPT61Terra: "low",
|
||||
modelGPT6Luna: "medium",
|
||||
modelDaybreakBlue: "low",
|
||||
}
|
||||
diff --git a/internal/server/transform.go b/internal/server/transform.go
|
||||
index 142fa2afc5a4..6f035742e42b 100644
|
||||
--- a/internal/server/transform.go
|
||||
+++ b/internal/server/transform.go
|
||||
@@ -281,7 +281,7 @@ func normalizeModel(model string) string {
|
||||
// Exact matches on currently-served models first, so a valid ID is never
|
||||
// rewritten by the looser prefix matching below.
|
||||
switch lower {
|
||||
- case modelGPT53Spark, modelGPT54Mini, modelGPT55, modelGPT5Sol, modelGPT5Terra, modelGPT5Luna, modelGPT6Astra, modelGPT6Sol, modelGPT61Sol, modelGPT6Luna, modelDaybreakBlue:
|
||||
+ case modelGPT53Spark, modelGPT54Mini, modelGPT55, modelGPT5Sol, modelGPT5Terra, modelGPT5Luna, modelGPT6Astra, modelGPT6Sol, modelGPT61Sol, modelGPT61Terra, modelGPT6Luna, modelDaybreakBlue:
|
||||
return lower
|
||||
}
|
||||
|
||||
diff --git a/internal/server/transform_test.go b/internal/server/transform_test.go
|
||||
index b5d289bbb479..35064bc85452 100644
|
||||
--- a/internal/server/transform_test.go
|
||||
+++ b/internal/server/transform_test.go
|
||||
@@ -159,6 +159,9 @@ func TestNormalizeModel(t *testing.T) {
|
||||
{"gpt-6.1-sol with max suffix", "gpt-6.1-sol-max", modelGPT61Sol},
|
||||
{"gpt-6.1-sol with high suffix", "gpt-6.1-sol-high", modelGPT61Sol},
|
||||
{"gpt-6.1-sol uppercase and whitespace", " GPT-6.1-SOL-XHIGH ", modelGPT61Sol},
|
||||
+ {"gpt-6.1-terra base", "gpt-6.1-terra", modelGPT61Terra},
|
||||
+ {"gpt-6.1-terra with max suffix", "gpt-6.1-terra-max", modelGPT61Terra},
|
||||
+ {"gpt-6.1-terra uppercase and whitespace", " GPT-6.1-TERRA-HIGH ", modelGPT61Terra},
|
||||
{"gpt-6-luna base", "gpt-6-luna", modelGPT6Luna},
|
||||
{"gpt-6-luna with high suffix", "gpt-6-luna-high", modelGPT6Luna},
|
||||
{"gpt-5.3-codex-spark base", "gpt-5.3-codex-spark", "gpt-5.3-codex-spark"},
|
||||
@@ -334,6 +337,9 @@ func TestClampReasoningEffortForModel(t *testing.T) {
|
||||
{"gpt-6.1-sol allows xhigh", modelGPT61Sol, "xhigh", "xhigh"},
|
||||
{"gpt-6.1-sol rejects none -> default", modelGPT61Sol, "none", "low"},
|
||||
{"gpt-6.1-sol rejects ultra -> default", modelGPT61Sol, "ultra", "low"},
|
||||
+ {"gpt-6.1-terra defaults to low", modelGPT61Terra, "", "low"},
|
||||
+ {"gpt-6.1-terra allows max", modelGPT61Terra, "max", "max"},
|
||||
+ {"gpt-6.1-terra rejects none -> default", modelGPT61Terra, "none", "low"},
|
||||
{"gpt-6-luna defaults to medium", modelGPT6Luna, "", "medium"},
|
||||
{"gpt-6-luna rejects none -> default", modelGPT6Luna, "none", "medium"},
|
||||
{"gpt-6-luna allows xhigh", modelGPT6Luna, "xhigh", "xhigh"},
|
||||
@@ -1,84 +0,0 @@
|
||||
{
|
||||
lib,
|
||||
buildGoModule,
|
||||
fetchFromGitHub,
|
||||
}:
|
||||
|
||||
buildGoModule rec {
|
||||
pname = "codex-oauth-proxy";
|
||||
version = "1.1.1";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "dvcrn";
|
||||
repo = "codex-oauth-proxy";
|
||||
# Upstream tags are bare semver, without the "v" prefix.
|
||||
rev = version;
|
||||
hash = "sha256-WZN+OVvK5/R46Ko01jw4m9jI9BcvpZzxWifcui90/g4=";
|
||||
};
|
||||
|
||||
vendorHash = "sha256-hb0rGd+HZHSV/sLXiIa7LPkXVuRqdXrQHZxM4v5sgvs=";
|
||||
|
||||
# 1.1.1 rewrites gpt-6.1-terra to gpt-5.5, which ChatGPT accounts reject.
|
||||
# Drop once upstream lists the model in normalizeModel.
|
||||
patches = [ ./gpt-6.1-terra.patch ];
|
||||
|
||||
env.CGO_ENABLED = 0;
|
||||
|
||||
# cmd/codex-oauth-proxy-worker and parts of internal/server are js && wasm
|
||||
# Cloudflare Worker code needing syscall/js, so only the server is buildable.
|
||||
subPackages = [ "cmd/codex-oauth-proxy" ];
|
||||
|
||||
# The Nix source tree has no .git, so Go's VCS stamping fails without it.
|
||||
# Set before the build and check phases, which both call `go`.
|
||||
preConfigure = ''
|
||||
export GOFLAGS="$GOFLAGS -buildvcs=false"
|
||||
'';
|
||||
|
||||
ldflags = [
|
||||
"-s"
|
||||
"-w"
|
||||
];
|
||||
|
||||
# Upstream CI runs `go test -v ./...` and the suite only uses httptest and
|
||||
# t.Setenv, so it needs neither network nor credentials. The default check
|
||||
# phase would reuse subPackages and test only the server, hence the override.
|
||||
doCheck = true;
|
||||
|
||||
checkPhase = ''
|
||||
runHook preCheck
|
||||
|
||||
# Tests may read assets relative to their package directory.
|
||||
export GOFLAGS=''${GOFLAGS//-trimpath/}
|
||||
|
||||
go test -v ./...
|
||||
|
||||
runHook postCheck
|
||||
'';
|
||||
|
||||
postInstall = ''
|
||||
install -Dm644 ${./codex-oauth-proxy.service} \
|
||||
"$out/lib/systemd/user/codex-oauth-proxy.service"
|
||||
substituteInPlace "$out/lib/systemd/user/codex-oauth-proxy.service" \
|
||||
--replace-fail '@out@' "$out"
|
||||
'';
|
||||
|
||||
passthru = {
|
||||
category = "AI LLM Gateway";
|
||||
updateScript = [
|
||||
"nix-update"
|
||||
"--flake"
|
||||
".#codex-oauth-proxy"
|
||||
];
|
||||
};
|
||||
|
||||
meta = {
|
||||
description = "Local proxy exposing a ChatGPT Codex account through OpenAI-compatible APIs";
|
||||
homepage = "https://github.com/dvcrn/codex-oauth-proxy";
|
||||
changelog = "https://github.com/dvcrn/codex-oauth-proxy/releases/tag/${version}";
|
||||
license = lib.licenses.mit;
|
||||
sourceProvenance = with lib.sourceTypes; [ fromSource ];
|
||||
mainProgram = "codex-oauth-proxy";
|
||||
platforms = lib.platforms.unix;
|
||||
maintainers = [ ];
|
||||
};
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
{ pkgs, ... }: pkgs.callPackage ./package.nix { }
|
||||
@@ -1,53 +0,0 @@
|
||||
{
|
||||
lib,
|
||||
buildGoModule,
|
||||
fetchFromGitHub,
|
||||
}:
|
||||
|
||||
buildGoModule rec {
|
||||
pname = "container-use";
|
||||
version = "0.4.2";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "dagger";
|
||||
repo = "container-use";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-YKgS142a9SL1ZEjS+VArxwUzQX961zwlGuHW43AMxQA=";
|
||||
};
|
||||
|
||||
vendorHash = "sha256-M7YhEm9Gmjv2gxB2r7AS5JLLThEkvtJfLBrB+cvsN5c=";
|
||||
|
||||
env.CGO_ENABLED = 0;
|
||||
|
||||
subPackages = [ "cmd/container-use" ];
|
||||
|
||||
# Tests require network access to container registries and a running
|
||||
# Docker engine, neither of which are available in the Nix sandbox
|
||||
doCheck = false;
|
||||
|
||||
postInstall = ''
|
||||
ln -s $out/bin/container-use $out/bin/cu
|
||||
'';
|
||||
|
||||
ldflags = [
|
||||
"-s -w -X main.version=v${version}"
|
||||
];
|
||||
|
||||
passthru = {
|
||||
category = "AI Coding Agents";
|
||||
updateScript = [
|
||||
"nix-update"
|
||||
"--flake"
|
||||
".#container-use"
|
||||
];
|
||||
};
|
||||
|
||||
meta = {
|
||||
description = "Containerized environments for coding agents";
|
||||
homepage = "https://github.com/dagger/container-use";
|
||||
changelog = "https://github.com/dagger/container-use/releases/tag/v${version}";
|
||||
license = lib.licenses.asl20;
|
||||
mainProgram = "container-use";
|
||||
platforms = lib.platforms.linux ++ lib.platforms.darwin;
|
||||
};
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
{ pkgs, inputs, ... }:
|
||||
(import ../../_lib/llm-packages.nix {
|
||||
inherit inputs;
|
||||
system = pkgs.stdenv.hostPlatform.system;
|
||||
}).crucible-strix-halo
|
||||
@@ -1,92 +0,0 @@
|
||||
{
|
||||
lib,
|
||||
stdenv,
|
||||
fetchFromGitHub,
|
||||
fetchurl,
|
||||
autoPatchelfHook,
|
||||
makeWrapper,
|
||||
python3,
|
||||
therockRocm,
|
||||
}:
|
||||
let
|
||||
python = python3.withPackages (ps: [
|
||||
ps.numpy
|
||||
ps.jinja2
|
||||
ps.tokenizers
|
||||
ps.pillow
|
||||
]);
|
||||
in
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "crucible-strix-halo";
|
||||
version = "0.37.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "jaedync";
|
||||
repo = "crucible-strix-halo";
|
||||
tag = "v${finalAttrs.version}";
|
||||
hash = "sha256-Uv7/bM0zLc01hciLSdvY9fHJdpSYoOrgSK6WwyWHnWQ=";
|
||||
};
|
||||
|
||||
# Upstream built this release engine with ROCm 7.2.4 and tested it on ROCm 10.1.
|
||||
# Keep the official gfx1151 code objects.
|
||||
engine = fetchurl {
|
||||
url = "https://github.com/jaedync/crucible-strix-halo/releases/download/v${finalAttrs.version}/crucible-engine-v${finalAttrs.version}-gfx1151-rocm7.2-linux-x86_64.gz";
|
||||
hash = "sha256-U6P7SRFB86QgXQljvBQwTm8dNFHV5OrPEb/JkxX6Uzo=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
autoPatchelfHook
|
||||
makeWrapper
|
||||
];
|
||||
buildInputs = [
|
||||
therockRocm
|
||||
stdenv.cc.cc.lib
|
||||
];
|
||||
dontBuild = true;
|
||||
dontStrip = true;
|
||||
|
||||
doCheck = true;
|
||||
checkPhase = ''
|
||||
runHook preCheck
|
||||
${python}/bin/python -m unittest server.tests.test_api server.tests.test_template
|
||||
runHook postCheck
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
mkdir -p $out/bin $out/share/crucible/build/engine
|
||||
gzip -dc $engine > $out/share/crucible/build/engine/crucible
|
||||
chmod +x $out/share/crucible/build/engine/crucible
|
||||
ln -s ../share/crucible/build/engine/crucible $out/bin/crucible-engine
|
||||
cp -r server $out/share/crucible/
|
||||
cp VERSION LICENSE NOTICE $out/share/crucible/
|
||||
makeWrapper ${python}/bin/python $out/bin/crucible-server \
|
||||
--add-flags "-m server" \
|
||||
--prefix PYTHONPATH : $out/share/crucible \
|
||||
--set-default CRUCIBLE_NO_UPDATE_CHECK 1
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
doInstallCheck = true;
|
||||
installCheckPhase = ''
|
||||
runHook preInstallCheck
|
||||
$out/bin/crucible-engine --version | grep -Fx 'crucible ${finalAttrs.version}'
|
||||
$out/bin/crucible-server --version | grep -Fx 'crucible ${finalAttrs.version}'
|
||||
$out/bin/crucible-server --help > /dev/null
|
||||
runHook postInstallCheck
|
||||
'';
|
||||
|
||||
passthru = {
|
||||
rocm = therockRocm;
|
||||
category = "AI Inference";
|
||||
};
|
||||
|
||||
meta = {
|
||||
description = "Crucible EXL3 inference engine and OpenAI-compatible server for AMD Strix Halo";
|
||||
homepage = "https://github.com/jaedync/crucible-strix-halo";
|
||||
license = lib.licenses.asl20;
|
||||
sourceProvenance = [ lib.sourceTypes.binaryNativeCode ];
|
||||
platforms = [ "x86_64-linux" ];
|
||||
mainProgram = "crucible-server";
|
||||
};
|
||||
})
|
||||
@@ -1,21 +0,0 @@
|
||||
{
|
||||
pkgs,
|
||||
perSystem,
|
||||
...
|
||||
}:
|
||||
let
|
||||
allPackages = perSystem.self;
|
||||
|
||||
# Filter to visible, runnable packages
|
||||
visibleNames = builtins.filter (
|
||||
name: name != "default" && !(allPackages.${name}.passthru.hideFromDocs or false)
|
||||
) (builtins.attrNames allPackages);
|
||||
|
||||
# Build "name\tdescription" lines
|
||||
packageLines = map (name: "${name}\t${allPackages.${name}.meta.description or ""}") visibleNames;
|
||||
|
||||
packageList = builtins.concatStringsSep "\n" packageLines;
|
||||
|
||||
flakeUrl = "git+https://git.millerson.name/alex/millerson-overlay.nix.git";
|
||||
in
|
||||
pkgs.callPackage ./package.nix { inherit packageList flakeUrl; }
|
||||
@@ -1,61 +0,0 @@
|
||||
{
|
||||
lib,
|
||||
writeShellApplication,
|
||||
fzf,
|
||||
nix,
|
||||
util-linux,
|
||||
packageList,
|
||||
flakeUrl,
|
||||
}:
|
||||
|
||||
let
|
||||
packageListFile = builtins.toFile "millerson-overlay-packages.tsv" packageList;
|
||||
in
|
||||
writeShellApplication {
|
||||
name = "millerson-overlay-launcher";
|
||||
|
||||
runtimeInputs = [
|
||||
fzf
|
||||
nix
|
||||
util-linux # column
|
||||
];
|
||||
|
||||
text = ''
|
||||
# Format for fzf: "name description" (tab-aligned)
|
||||
entries=$(column -t -s $'\t' < "${packageListFile}")
|
||||
|
||||
if [[ -z $entries ]]; then
|
||||
echo "No packages found" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Let user pick with fzf
|
||||
selected=$(echo "$entries" | fzf \
|
||||
--header="Select an pkg to run (ESC to cancel)" \
|
||||
--preview-window=hidden \
|
||||
--no-multi \
|
||||
--height=~40% \
|
||||
--layout=reverse) || exit 0
|
||||
|
||||
# Extract package name (first word)
|
||||
pkg_name=$(echo "$selected" | awk '{print $1}')
|
||||
|
||||
if [[ -z $pkg_name ]]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "→ Running: nix run ${flakeUrl}#$pkg_name"
|
||||
exec nix run "${flakeUrl}#$pkg_name"
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "Interactive fzf launcher for millerson-overlay.nix packages";
|
||||
license = lib.licenses.mit;
|
||||
mainProgram = "millerson-overlay-launcher";
|
||||
platforms = lib.platforms.all;
|
||||
};
|
||||
|
||||
passthru = {
|
||||
hideFromDocs = true;
|
||||
};
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
{ pkgs, ... }: pkgs.callPackage ./package.nix { }
|
||||
@@ -1,54 +0,0 @@
|
||||
{
|
||||
lib,
|
||||
python3Packages,
|
||||
fetchFromGitHub,
|
||||
}:
|
||||
|
||||
python3Packages.buildPythonApplication rec {
|
||||
pname = "desloppify";
|
||||
version = "1.0";
|
||||
pyproject = true;
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "peteromallet";
|
||||
repo = "desloppify";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-USFofGy0SUZV0oeh5x5KAWeFReD45GxlyYqpmc23NFM=";
|
||||
};
|
||||
|
||||
build-system = with python3Packages; [
|
||||
setuptools
|
||||
];
|
||||
|
||||
# Include all [full] optional dependencies for complete functionality.
|
||||
# Upstream has no base dependencies - all features are behind optional extras.
|
||||
dependencies = with python3Packages; [
|
||||
tree-sitter
|
||||
tree-sitter-language-pack
|
||||
defusedxml
|
||||
bandit
|
||||
pillow
|
||||
pyyaml
|
||||
];
|
||||
|
||||
doCheck = false;
|
||||
pythonImportsCheck = [ "desloppify" ];
|
||||
|
||||
passthru = {
|
||||
category = "AI Coding Agents";
|
||||
updateScript = [
|
||||
"nix-update"
|
||||
"--flake"
|
||||
".#desloppify"
|
||||
];
|
||||
};
|
||||
|
||||
meta = {
|
||||
description = "Multi-language codebase health scanner and technical debt tracker for AI agents";
|
||||
homepage = "https://github.com/peteromallet/desloppify";
|
||||
changelog = "https://github.com/peteromallet/desloppify/releases/tag/v${version}";
|
||||
license = lib.licenses.unfreeRedistributable;
|
||||
mainProgram = "desloppify";
|
||||
platforms = lib.platforms.all;
|
||||
};
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
{ pkgs, ... }: pkgs.callPackage ./package.nix { }
|
||||
@@ -1,102 +0,0 @@
|
||||
{
|
||||
lib,
|
||||
stdenv,
|
||||
fetchFromGitHub,
|
||||
gnumake,
|
||||
rocmPackages,
|
||||
autoPatchelfHook,
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
pname = "ds4";
|
||||
version = "0-unstable-2026-10-21";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "antirez";
|
||||
repo = "ds4";
|
||||
rev = "ee7e8405232c8971000cc7ba2b945b00bf6d20d3";
|
||||
hash = "sha256-o2F3OA2eHIac2iRvck/z3Nj/YYijoSXfPi+1zbdd2tU=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
gnumake
|
||||
rocmPackages.hipcc
|
||||
autoPatchelfHook
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
rocmPackages.clr
|
||||
rocmPackages.hipblas
|
||||
rocmPackages.hipblas-common
|
||||
rocmPackages.hipblaslt
|
||||
rocmPackages.hipcub
|
||||
rocmPackages.rocblas
|
||||
rocmPackages.rocprim
|
||||
rocmPackages.rocwmma
|
||||
];
|
||||
|
||||
# STRIXHALO.md: rocwmma/internal/ headers may be missing in distro packages.
|
||||
# nixpkgs builds rocwmma from source so all headers (including internal/) are present.
|
||||
# ROCM_ARCH defaults to gfx1151 (Strix Halo / Radeon 8060S) in the upstream Makefile.
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
|
||||
make strix-halo -j"$NIX_BUILD_CORES" \
|
||||
HIPCC="${rocmPackages.hipcc}/bin/hipcc" \
|
||||
ROCM_CFLAGS="-O3 -ffast-math -g -fno-finite-math-only -pthread -D__HIP_PLATFORM_AMD__ -Wno-unused-command-line-argument --offload-arch=gfx1151 \
|
||||
-I${rocmPackages.clr}/include \
|
||||
-I${rocmPackages.hipblas}/include \
|
||||
-I${rocmPackages.hipblas-common}/include \
|
||||
-I${rocmPackages.hipblaslt}/include \
|
||||
-I${rocmPackages.hipcub}/include \
|
||||
-I${rocmPackages.rocblas}/include \
|
||||
-I${rocmPackages.rocprim}/include \
|
||||
-I${rocmPackages.rocwmma}/include" \
|
||||
ROCM_LDLIBS="-lm -pthread \
|
||||
-L${rocmPackages.hipblas}/lib -lhipblas \
|
||||
-L${rocmPackages.hipblaslt}/lib -lhipblaslt \
|
||||
-L${rocmPackages.rocblas}/lib -lrocblas \
|
||||
-L${rocmPackages.clr}/lib -lamdhip64"
|
||||
|
||||
runHook postBuild
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
mkdir -p $out/bin
|
||||
cp ds4 ds4-server ds4-bench ds4-eval ds4-agent $out/bin/
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
passthru = {
|
||||
category = "AI Inference";
|
||||
updateScript = [
|
||||
"nix-update"
|
||||
"--flake"
|
||||
"--version=branch=main"
|
||||
".#ds4"
|
||||
];
|
||||
};
|
||||
|
||||
meta = {
|
||||
description = "DeepSeek 4 Flash and PRO local inference engine for ROCm (Strix Halo)";
|
||||
longDescription = ''
|
||||
DS4 is a self-contained local inference engine specifically built for
|
||||
DeepSeek V4 Flash and PRO. It bundles a CLI, HTTP server, and native
|
||||
coding agent. This package is built with the ROCm backend for AMD
|
||||
Strix Halo GPUs (gfx1151, Radeon 8060S).
|
||||
|
||||
Runtime requirements (from STRIXHALO.md):
|
||||
- User must be in 'render' and 'video' groups for /dev/kfd and DRM access
|
||||
- GPU-visible memory must be increased via kernel parameters:
|
||||
amd_iommu=off amdgpu.gttsize=126976 ttm.pages_limit=32505856 ttm.page_pool_size=32505856
|
||||
'';
|
||||
homepage = "https://github.com/antirez/ds4";
|
||||
changelog = "https://github.com/antirez/ds4/commits/main";
|
||||
license = lib.licenses.mit;
|
||||
platforms = [ "x86_64-linux" ];
|
||||
mainProgram = "ds4";
|
||||
};
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
{
|
||||
inputs,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
# A derivation that references all flake inputs to ensure they get cached
|
||||
let
|
||||
inputsList = pkgs.lib.concatMapStringsSep " " (name: inputs.${name}) (builtins.attrNames inputs);
|
||||
in
|
||||
pkgs.runCommand "flake-inputs" { } ''
|
||||
cat ${builtins.toFile "flake-inputs-list" inputsList} > $out
|
||||
''
|
||||
// {
|
||||
passthru.hideFromDocs = true;
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
{ pkgs, ... }: pkgs.callPackage ./package.nix { glibc = pkgs.stdenv.cc.libc; }
|
||||
@@ -1,153 +0,0 @@
|
||||
{
|
||||
lib,
|
||||
stdenv,
|
||||
fetchurl,
|
||||
nodejs,
|
||||
makeWrapper,
|
||||
patchelf,
|
||||
glibc,
|
||||
}:
|
||||
|
||||
let
|
||||
version = "0.2.34";
|
||||
|
||||
freebuffSrc = fetchurl {
|
||||
url = "https://registry.npmjs.org/freebuff/-/freebuff-${version}.tgz";
|
||||
hash = "sha256-oYthWoPDTbwOBNCdht1cQKzH7MLPkyzSKyQmM6KNer0=";
|
||||
};
|
||||
|
||||
pkgTar = fetchurl {
|
||||
url = "https://registry.npmjs.org/tar/-/tar-7.5.15.tgz";
|
||||
hash = "sha256-hl60jJtM1W2THQyGZj8G72GEG8QvVrHvNnr7EU1liBw=";
|
||||
};
|
||||
|
||||
pkgFsMinipass = fetchurl {
|
||||
url = "https://registry.npmjs.org/@isaacs/fs-minipass/-/fs-minipass-4.0.1.tgz";
|
||||
hash = "sha256-esKG48zMHqiYDnniA53va7l9MYLheVHNkJTwQA7ZgjY=";
|
||||
};
|
||||
|
||||
pkgChownr = fetchurl {
|
||||
url = "https://registry.npmjs.org/chownr/-/chownr-3.0.0.tgz";
|
||||
hash = "sha256-TCT12qYwFCJS2oneZV998JDqR5RQqIJYl3UdeDIbE2A=";
|
||||
};
|
||||
|
||||
pkgMinipass = fetchurl {
|
||||
url = "https://registry.npmjs.org/minipass/-/minipass-7.1.3.tgz";
|
||||
hash = "sha256-UqxhvnQ3VeP9yY5WAIbQ1KHix/02Qzh3kts44yLSfRI=";
|
||||
};
|
||||
|
||||
pkgMinizlib = fetchurl {
|
||||
url = "https://registry.npmjs.org/minizlib/-/minizlib-3.1.0.tgz";
|
||||
hash = "sha256-mb8uKWGBct1x8GVHN0kMaPcbx+I3nUc+OPn+8tvs4uM=";
|
||||
};
|
||||
|
||||
pkgYallist = fetchurl {
|
||||
url = "https://registry.npmjs.org/yallist/-/yallist-5.0.0.tgz";
|
||||
hash = "sha256-fJ1D26t8qzsxM7Dmpa8UAUSCKFMWs57J9QjvrdnrzpU=";
|
||||
};
|
||||
|
||||
binarySrc = fetchurl {
|
||||
url = "https://github.com/CodebuffAI/codebuff-community/releases/download/freebuff-v${version}/freebuff-linux-x64.tar.gz";
|
||||
hash = "sha256-XZ8YtaVqyA5FdUfKOFl2aij9jd0yw5ZJLyzbKLklB+I=";
|
||||
};
|
||||
|
||||
in
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "freebuff";
|
||||
version = "0.2.34";
|
||||
|
||||
src = freebuffSrc;
|
||||
|
||||
nativeBuildInputs = [
|
||||
makeWrapper
|
||||
patchelf
|
||||
];
|
||||
|
||||
dontStrip = true;
|
||||
dontPatchelf = true;
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
# Extract and patch the pre-built binary for NixOS compatibility
|
||||
mkdir -p "$out/bin" /tmp/fb-engine
|
||||
tar xzf "${binarySrc}" -C /tmp/fb-engine --strip-components=0
|
||||
cp /tmp/fb-engine/freebuff "$out/bin/freebuff-engine"
|
||||
chmod 755 "$out/bin/freebuff-engine"
|
||||
|
||||
patchelf \
|
||||
--set-interpreter "${glibc}/lib/ld-linux-x86-64.so.2" \
|
||||
--set-rpath "${glibc}/lib:" \
|
||||
"$out/bin/freebuff-engine"
|
||||
|
||||
if [ -f /tmp/fb-engine/tree-sitter.wasm ]; then
|
||||
cp /tmp/fb-engine/tree-sitter.wasm "$out/bin/"
|
||||
fi
|
||||
|
||||
rm -rf /tmp/fb-engine
|
||||
|
||||
# Extract npm dependencies from pre-fetched tarballs
|
||||
extractNpmPkg() {
|
||||
local src="$1" target="$2"
|
||||
mkdir -p "$target"
|
||||
tar xzf "$src" -C "$target" --strip-components=1
|
||||
}
|
||||
|
||||
mkdir -p "$out/lib/node_modules/tar"
|
||||
mkdir -p "$out/lib/node_modules/chownr"
|
||||
mkdir -p "$out/lib/node_modules/minipass"
|
||||
mkdir -p "$out/lib/node_modules/minizlib"
|
||||
mkdir -p "$out/lib/node_modules/yallist"
|
||||
mkdir -p "$out/lib/node_modules/@isaacs/fs-minipass"
|
||||
|
||||
extractNpmPkg "${pkgTar}" "$out/lib/node_modules/tar"
|
||||
extractNpmPkg "${pkgChownr}" "$out/lib/node_modules/chownr"
|
||||
extractNpmPkg "${pkgMinipass}" "$out/lib/node_modules/minipass"
|
||||
extractNpmPkg "${pkgMinizlib}" "$out/lib/node_modules/minizlib"
|
||||
extractNpmPkg "${pkgYallist}" "$out/lib/node_modules/yallist"
|
||||
extractNpmPkg "${pkgFsMinipass}" "$out/lib/node_modules/@isaacs/fs-minipass"
|
||||
|
||||
# Launcher: run the patched engine directly from nix-store
|
||||
cat > "$out/bin/launcher.js" << LAUNCHER_EOF
|
||||
#!/usr/bin/env node
|
||||
const { spawn } = require('child_process');
|
||||
const TERMINAL_RESET = '\x1b[?1049l\x1b[?1000l\x1b[?1002l\x1b[?1003l\x1b[?1006l\x1b[?2004l\x1b[?25h';
|
||||
const engine = '${placeholder "out"}/bin/freebuff-engine';
|
||||
|
||||
function reset() {
|
||||
try { if (process.stdin.isTTY && process.stdin.setRawMode) process.stdin.setRawMode(false); } catch(e){}
|
||||
try { if (process.stdout.isTTY) process.stdout.write(TERMINAL_RESET); } catch(e){}
|
||||
}
|
||||
|
||||
const child = spawn(engine, process.argv.slice(2), { stdio: 'inherit' });
|
||||
child.on('exit', (code, signal) => { reset(); process.exit(signal ? 1 : code || 0); });
|
||||
child.on('error', (e) => { console.error('Failed to start freebuff:', e.message); process.exit(1); });
|
||||
LAUNCHER_EOF
|
||||
|
||||
makeWrapper "${nodejs}/bin/node" "$out/bin/freebuff" \
|
||||
--set NODE_PATH "$out/lib/node_modules" \
|
||||
--add-flags "$out/bin/launcher.js"
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
doCheck = false;
|
||||
|
||||
passthru = {
|
||||
category = "AI Coding Agents";
|
||||
updateScript = [
|
||||
"nix-update"
|
||||
"--flake"
|
||||
".#freebuff"
|
||||
];
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
description = "The world's strongest free coding agent";
|
||||
homepage = "https://codebuff.com";
|
||||
license = licenses.mit;
|
||||
mainProgram = "freebuff";
|
||||
platforms = platforms.linux;
|
||||
};
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
{
|
||||
pkgs,
|
||||
inputs,
|
||||
...
|
||||
}:
|
||||
# freetoken pins torch>=2.11,<2.12 and triton==3.6.0, but current
|
||||
# nixos-unstable ships torch 2.13 + triton 3.7 and no older torch. Build it
|
||||
# with the pinned nixpkgs-torch211 revision (CUDA 12.9 / torch-bin 2.11).
|
||||
inputs.nixpkgs-torch211.legacyPackages.${pkgs.stdenv.hostPlatform.system}.callPackage ./package.nix
|
||||
{ }
|
||||
@@ -1,51 +0,0 @@
|
||||
{
|
||||
lib,
|
||||
buildPythonPackage,
|
||||
fetchurl,
|
||||
# dependencies
|
||||
numpy,
|
||||
numba,
|
||||
# torch-bin (CUDA wheel build) and triton-bin are passed by the caller;
|
||||
# the python scope defaults are the source-built torch (CPU-only) and
|
||||
# triton — using them would duplicate torch/triton in the closure.
|
||||
torch,
|
||||
triton,
|
||||
tqdm,
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "flashlib";
|
||||
version = "0.3.0";
|
||||
format = "wheel";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://files.pythonhosted.org/packages/e5/b8/4c085892462e521bb9f2d943ff34fa219e3a5a206798f3c96a983538039f/flashlib-0.3.0-py3-none-any.whl";
|
||||
hash = "sha256-kDeRHzFf7zyfRFMmFZc2Ory4OGiBOtGyWKsTCLNP0Ro=";
|
||||
};
|
||||
|
||||
# freetoken pins flashlib==0.3.0 (not in nixpkgs) and only uses its Triton
|
||||
# kernels (flashlib.kernels.slot_cache). nvidia-cutlass-dsl — needed only by
|
||||
# the CuTeDSL GEMM backends in flashlib.linalg, which drag in cuda-python and
|
||||
# nvdisasm binary wheels — is deliberately not packaged (and removed from
|
||||
# the wheel metadata so the runtime deps check passes).
|
||||
pythonRemoveDeps = [ "nvidia-cutlass-dsl" ];
|
||||
|
||||
dependencies = [
|
||||
numpy
|
||||
numba
|
||||
torch
|
||||
triton
|
||||
tqdm
|
||||
];
|
||||
|
||||
# flashlib is CPU-safe at import time: CuteDSL imports are lazy and hardware
|
||||
# detection (flashlib._hw) is cuda-optional.
|
||||
pythonImportsCheck = [ "flashlib" ];
|
||||
|
||||
meta = {
|
||||
description = "High-performance ML primitives — Triton and CuteDSL kernels for NVIDIA GPUs";
|
||||
homepage = "https://pypi.org/project/flashlib/";
|
||||
license = lib.licenses.asl20;
|
||||
platforms = lib.platforms.linux;
|
||||
};
|
||||
}
|
||||
@@ -1,191 +0,0 @@
|
||||
{
|
||||
lib,
|
||||
pkgs,
|
||||
fetchFromGitHub,
|
||||
}:
|
||||
|
||||
let
|
||||
# FreeToken is an NVIDIA-GPU inference engine: setup.py builds two C++
|
||||
# extensions that link the CUDA runtime, and the runtime needs a
|
||||
# CUDA-enabled torch. CUDA libraries carry the unfree "CUDA EULA" license,
|
||||
# so this package re-imports the flake's nixpkgs with allowUnfree enabled —
|
||||
# scoped to freetoken only, leaving the rest of the overlay unchanged.
|
||||
nixpkgsUnfree = import pkgs.path {
|
||||
inherit (pkgs.stdenv.hostPlatform) system;
|
||||
config.allowUnfree = true;
|
||||
};
|
||||
|
||||
py = nixpkgsUnfree.python3Packages;
|
||||
|
||||
# torch>=2.11,<2.12: torch-bin 2.11 is this nixpkgs' CUDA build (it links
|
||||
# the cuda12.9-* libraries). The extensions must link the same libcudart
|
||||
# instance torch-bin links, so CUDA_HOME below is built from the matching
|
||||
# cudaPackages.cuda_cudart.
|
||||
cudart = nixpkgsUnfree.cudaPackages.cuda_cudart;
|
||||
# cuda_runtime_api.h includes crt/host_defines.h & co., which ship with
|
||||
# nvcc's header set, not with cudart.
|
||||
nvccHeaders = nixpkgsUnfree.cudaPackages.cuda_nvcc;
|
||||
|
||||
# setup.py requires CUDA_HOME containing CUDA headers and libcudart.
|
||||
# Single-output cudart provides ${cudart}/include and ${cudart}/lib; the
|
||||
# crt/ headers come from nvcc; lib64/ is added for torch's cpp_extension,
|
||||
# lib/ is picked up by setup.py's cuda-home/lib fallback.
|
||||
cudaHome = nixpkgsUnfree.runCommand "freetoken-cuda-home" { } ''
|
||||
mkdir -p $out/include $out/lib64
|
||||
ln -s ${cudart}/include/* $out/include/
|
||||
ln -s ${nvccHeaders}/include/crt $out/include/crt
|
||||
ln -s ${cudart}/lib $out/lib
|
||||
for f in ${cudart}/lib/*.so*; do
|
||||
ln -s "$f" "$out/lib64/$(basename "$f")"
|
||||
done
|
||||
'';
|
||||
|
||||
# flashlib==0.3.0, pinned by freetoken, is not in nixpkgs. torch and triton
|
||||
# come from the prebuilt wheel builds (torch-bin / triton-bin), the same
|
||||
# instances torch-bin propagates — the scope defaults (source-built torch
|
||||
# and triton) would put two tritons/torches into the closure.
|
||||
flashlib = py.callPackage ./flashlib.nix {
|
||||
torch = py.torch-bin;
|
||||
triton = py.triton-bin;
|
||||
};
|
||||
|
||||
# freetoken pins apache-tvm-ffi==0.1.13.post3; nixpkgs has 0.1.10.
|
||||
# 0.1.13 needs cython>=3.2.8 (nixpkgs: 3.2.4), so build it with a newer
|
||||
# cython, scoped to this package only.
|
||||
apache-tvm-ffi =
|
||||
(py.apache-tvm-ffi.override {
|
||||
cython = py.cython.overridePythonAttrs (old: rec {
|
||||
version = "3.3.0";
|
||||
src = fetchFromGitHub {
|
||||
owner = "cython";
|
||||
repo = "cython";
|
||||
tag = version;
|
||||
hash = "sha256-gIEqq8DAJF197gH1cMuq5JxI4rV/VHS70vg8hywXDqw=";
|
||||
};
|
||||
});
|
||||
}).overridePythonAttrs
|
||||
(old: {
|
||||
version = "0.1.13.post3";
|
||||
src = fetchFromGitHub {
|
||||
owner = "apache";
|
||||
repo = "tvm-ffi";
|
||||
tag = "v0.1.13-post3";
|
||||
fetchSubmodules = true;
|
||||
hash = "sha256-AN7AqBl62T8DqnRt7KRvGjqo/c0SJ66QZrCQQ5yicHw=";
|
||||
};
|
||||
# 0.1.13 runs its suite with pytest-xdist (pyproject addopts = [ "-n"
|
||||
# "auto" ]) and touches GPUs; the nixpkgs check inputs have neither
|
||||
# xdist nor a GPU. The imports check still runs (and passes).
|
||||
dontUsePytestCheck = true;
|
||||
});
|
||||
in
|
||||
py.buildPythonApplication (finalAttrs: {
|
||||
pname = "freetoken";
|
||||
version = "0.1.3";
|
||||
pyproject = true;
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "FlashML-org";
|
||||
repo = "FreeToken";
|
||||
tag = "v${finalAttrs.version}";
|
||||
hash = "sha256-59itjnwDr4P7I/ZLIbkNw9/8CCPvTP7yNWl9ogBnZ3o=";
|
||||
};
|
||||
|
||||
# setup.py imports torch.utils.cpp_extension at build time and compiles two
|
||||
# C++ extensions (freetoken.kernel._pinned_tensor and _cpu_moe) that link
|
||||
# libcudart from CUDA_HOME. ninja is required by BuildExtension.
|
||||
build-system = with py; [
|
||||
ninja
|
||||
setuptools
|
||||
torch-bin
|
||||
wheel
|
||||
];
|
||||
|
||||
nativeBuildInputs = [ nixpkgsUnfree.autoPatchelfHook ];
|
||||
|
||||
# cudart: RPATH target for the built extensions (autoPatchelf finds
|
||||
# libcudart.so.12 here); libtorch comes from torch-bin via dependencies.
|
||||
buildInputs = [ cudart ];
|
||||
|
||||
env.CUDA_HOME = cudaHome;
|
||||
|
||||
dependencies = with py; [
|
||||
apache-tvm-ffi
|
||||
einops
|
||||
fastapi
|
||||
flashlib
|
||||
gguf
|
||||
huggingface-hub
|
||||
# freetoken's floor is modelscope>=1.37 (nixpkgs has 1.36.2); the only
|
||||
# API used is modelscope.snapshot_download (server/args.py), which is
|
||||
# stable across both.
|
||||
modelscope
|
||||
msgpack
|
||||
numpy
|
||||
openai
|
||||
partial-json-parser
|
||||
prompt-toolkit
|
||||
pydantic
|
||||
pyzmq
|
||||
safetensors
|
||||
torch-bin
|
||||
# triton==3.6.0 pin, satisfied with the wheel build (triton-bin) — the
|
||||
# same instance torch-bin propagates, keeping one triton in the closure.
|
||||
triton-bin
|
||||
tqdm
|
||||
transformers
|
||||
uvicorn
|
||||
];
|
||||
|
||||
# Tests need an NVIDIA GPU and real model checkpoints (pytest markers
|
||||
# slow/needs_weights) — impossible in the build sandbox.
|
||||
doCheck = false;
|
||||
pythonImportsCheck = [ "freetoken" ];
|
||||
|
||||
# Wheel metadata constraints that nixpkgs packages do not match:
|
||||
# - gguf is versioned by upstream git rev in nixpkgs ("8951") rather than
|
||||
# PyPI semver; the reader API freetoken uses is stable.
|
||||
# - modelscope floor is 1.37 (nixpkgs: 1.36.2); only the stable
|
||||
# snapshot_download API is used.
|
||||
pythonRelaxDeps = [
|
||||
"gguf"
|
||||
"modelscope"
|
||||
];
|
||||
|
||||
passthru = {
|
||||
category = "AI Inference";
|
||||
updateScript = [
|
||||
"nix-update"
|
||||
"--flake"
|
||||
".#freetoken"
|
||||
];
|
||||
};
|
||||
|
||||
meta = {
|
||||
description = "Local MoE-offload LLM inference runtime with OpenAI- and Anthropic-compatible APIs";
|
||||
longDescription = ''
|
||||
FreeToken is an edge-native MoE serving engine for running
|
||||
frontier-scale open-weight models on consumer NVIDIA GPUs (RTX
|
||||
30/40/50 series). It treats GPUs, CPUs and host memory as one elastic
|
||||
inference platform, with semantic-aware KV/expert caching and runtime
|
||||
VRAM re-allocation between caches. It serves OpenAI- and
|
||||
Anthropic-compatible APIs.
|
||||
|
||||
Nix packaging notes:
|
||||
- Built against this nixpkgs' CUDA 12.9 stack (torch-bin 2.11 +
|
||||
cudaPackages.cuda_cudart) instead of upstream's cu130 wheels; CUDA
|
||||
12.9 supports the same GPU range, including RTX 50 (sm_120).
|
||||
- The optional native accel extras (flashinfer, sglang-kernel) and the
|
||||
freetoken-kernel-cache companion wheel are not packaged; the runtime
|
||||
falls back to its pure-Triton kernels where those would be used.
|
||||
- Requires an NVIDIA GPU at runtime.
|
||||
'';
|
||||
homepage = "https://github.com/FlashML-org/FreeToken";
|
||||
changelog = "https://github.com/FlashML-org/FreeToken/releases/tag/v${finalAttrs.version}";
|
||||
# Upstream code is Apache-2.0, but this derivation links CUDA libraries
|
||||
# under the unfree CUDA EULA (same as nixpkgs' torch-bin).
|
||||
license = lib.licenses.unfree;
|
||||
platforms = [ "x86_64-linux" ];
|
||||
mainProgram = "ft";
|
||||
};
|
||||
})
|
||||
@@ -1,5 +0,0 @@
|
||||
{
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
pkgs.callPackage ./package.nix { }
|
||||
@@ -1,95 +0,0 @@
|
||||
{
|
||||
lib,
|
||||
stdenv,
|
||||
rustPlatform,
|
||||
fetchFromGitHub,
|
||||
pkg-config,
|
||||
openssl,
|
||||
cmake,
|
||||
libx11,
|
||||
libxtst,
|
||||
llvmPackages,
|
||||
}:
|
||||
|
||||
rustPlatform.buildRustPackage rec {
|
||||
pname = "g3";
|
||||
# Upstream has no git tags or releases; pin main and let nix-update
|
||||
# track the branch. Version shape matches nix-update --version=branch=main
|
||||
# for a tagless repository (package version is 0.1.0 upstream).
|
||||
version = "0-unstable-2026-09-06";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "dhanji";
|
||||
repo = "g3";
|
||||
rev = "9793144520d290a9ea621a06cf7d8322e6fa4a35";
|
||||
hash = "sha256-s4QlOah7ffoFjiTw2nO/SbCbvIRxr4HB/3pOpQpGWRM=";
|
||||
};
|
||||
|
||||
# Cargo.lock has a git dependency (tree-sitter-haskell); cargoHash /
|
||||
# fetchCargoVendor covers registry + git sources.
|
||||
cargoHash = "sha256-6dvN4//NNuo9s5QzTcrxYiNkxP0Ivysg6f1F9soFrL4=";
|
||||
|
||||
nativeBuildInputs = [
|
||||
pkg-config
|
||||
cmake
|
||||
# llama-cpp-sys-2 runs bindgen, which needs libclang.
|
||||
llvmPackages.libclang
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
openssl
|
||||
libx11
|
||||
libxtst
|
||||
];
|
||||
|
||||
# bindgen (via llama-cpp-sys-2) needs libclang and the C library headers.
|
||||
env = {
|
||||
LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib";
|
||||
BINDGEN_EXTRA_CLANG_ARGS = "-isystem ${lib.getDev stdenv.cc.libc}/include";
|
||||
};
|
||||
|
||||
# Root package only builds/installs its own bins; studio is a sibling
|
||||
# workspace member. Match upstream install.sh: ship g3 and studio
|
||||
# (renamed to g3-studio).
|
||||
cargoBuildFlags = [
|
||||
"-p"
|
||||
"g3"
|
||||
"-p"
|
||||
"studio"
|
||||
];
|
||||
cargoInstallFlags = [
|
||||
"-p"
|
||||
"g3"
|
||||
"-p"
|
||||
"studio"
|
||||
];
|
||||
|
||||
# Provider and computer-control tests need network, LLM credentials, and a
|
||||
# display; not runnable in the Nix sandbox.
|
||||
doCheck = false;
|
||||
|
||||
# Upstream install.sh names the companion workspace manager g3-studio.
|
||||
postInstall = ''
|
||||
mv "$out/bin/studio" "$out/bin/g3-studio"
|
||||
'';
|
||||
|
||||
passthru = {
|
||||
category = "AI Coding Agents";
|
||||
updateScript = [
|
||||
"nix-update"
|
||||
"--flake"
|
||||
".#g3"
|
||||
"--version=branch=main"
|
||||
];
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
description = "AI coding agent that writes code and executes commands, with multi-provider LLM support, context compaction, and desktop automation";
|
||||
homepage = "https://github.com/dhanji/g3";
|
||||
# Cargo.toml declares MIT; the repository ships no LICENSE file.
|
||||
license = licenses.mit;
|
||||
sourceProvenance = with sourceTypes; [ fromSource ];
|
||||
mainProgram = "g3";
|
||||
platforms = platforms.unix;
|
||||
};
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
{
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
pkgs.callPackage ./package.nix { }
|
||||
@@ -1,96 +0,0 @@
|
||||
{
|
||||
lib,
|
||||
python3Packages,
|
||||
fetchFromGitHub,
|
||||
}:
|
||||
|
||||
python3Packages.buildPythonApplication rec {
|
||||
pname = "graphify";
|
||||
version = "0.9.95";
|
||||
pyproject = true;
|
||||
|
||||
# Do not bump to the v1.0.0 tag: it is a stale branch 2126 commits behind
|
||||
# the v0.9.x releases (pyproject still says graphifyy 0.1.10) and was never
|
||||
# published to PyPI, where 0.9.95 is the latest release. nix-update picks
|
||||
# v1.0.0 as the highest tag, so check PyPI before taking its result.
|
||||
src = fetchFromGitHub {
|
||||
owner = "Graphify-Labs";
|
||||
repo = "graphify";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-/OdOq9RXzjflrFY2UFGxYVQBESh9PWUQjZFox0Q59hw=";
|
||||
};
|
||||
|
||||
build-system = with python3Packages; [
|
||||
setuptools
|
||||
];
|
||||
|
||||
# Only tree-sitter grammars available in nixpkgs are included.
|
||||
# Missing grammars will be downloaded by tree-sitter at runtime on demand.
|
||||
dependencies = with python3Packages; [
|
||||
networkx
|
||||
numpy
|
||||
pyyaml
|
||||
rapidfuzz
|
||||
tree-sitter
|
||||
tree-sitter-python
|
||||
tree-sitter-javascript
|
||||
tree-sitter-rust
|
||||
tree-sitter-c-sharp
|
||||
tree-sitter-sql
|
||||
];
|
||||
|
||||
# Remove unavailable tree-sitter grammars from pyproject.toml.
|
||||
# Since 0.9.35 upstream pins versions ("tree-sitter-X>=v,<v"), and GNU sed
|
||||
# mishandles `"` inside bracket expressions, match the name followed by
|
||||
# either `>` (versioned) or `"` (bare) via alternation. This also avoids
|
||||
# prefix collisions (e.g. tree-sitter-c vs tree-sitter-c-sharp).
|
||||
postPatch = ''
|
||||
# relax the build-backend pin: nixpkgs' setuptools is older than 83, but
|
||||
# the PEP 639 license metadata graphify relies on needs only >=77.
|
||||
sed -i 's/setuptools>=83\.[0-9.]*/setuptools/' pyproject.toml
|
||||
sed -i \
|
||||
-e '/tree-sitter-typescript>\|tree-sitter-typescript"/d' \
|
||||
-e '/tree-sitter-go>\|tree-sitter-go"/d' \
|
||||
-e '/tree-sitter-java>\|tree-sitter-java"/d' \
|
||||
-e '/tree-sitter-groovy>\|tree-sitter-groovy"/d' \
|
||||
-e '/tree-sitter-c>\|tree-sitter-c"/d' \
|
||||
-e '/tree-sitter-cpp>\|tree-sitter-cpp"/d' \
|
||||
-e '/tree-sitter-ruby>\|tree-sitter-ruby"/d' \
|
||||
-e '/tree-sitter-kotlin>\|tree-sitter-kotlin"/d' \
|
||||
-e '/tree-sitter-scala>\|tree-sitter-scala"/d' \
|
||||
-e '/tree-sitter-php>\|tree-sitter-php"/d' \
|
||||
-e '/tree-sitter-swift>\|tree-sitter-swift"/d' \
|
||||
-e '/tree-sitter-lua>\|tree-sitter-lua"/d' \
|
||||
-e '/tree-sitter-zig>\|tree-sitter-zig"/d' \
|
||||
-e '/tree-sitter-powershell>\|tree-sitter-powershell"/d' \
|
||||
-e '/tree-sitter-elixir>\|tree-sitter-elixir"/d' \
|
||||
-e '/tree-sitter-objc>\|tree-sitter-objc"/d' \
|
||||
-e '/tree-sitter-julia>\|tree-sitter-julia"/d' \
|
||||
-e '/tree-sitter-verilog>\|tree-sitter-verilog"/d' \
|
||||
-e '/tree-sitter-fortran>\|tree-sitter-fortran"/d' \
|
||||
-e '/tree-sitter-bash>\|tree-sitter-bash"/d' \
|
||||
-e '/tree-sitter-json>\|tree-sitter-json"/d' \
|
||||
pyproject.toml
|
||||
'';
|
||||
|
||||
doCheck = false;
|
||||
pythonImportsCheck = [ "graphify" ];
|
||||
|
||||
passthru = {
|
||||
category = "AI Coding Agents";
|
||||
updateScript = [
|
||||
"nix-update"
|
||||
"--flake"
|
||||
".#graphify"
|
||||
];
|
||||
};
|
||||
|
||||
meta = {
|
||||
description = "AI coding assistant skill - turn any folder of code, docs, papers, images, or videos into a queryable knowledge graph";
|
||||
homepage = "https://github.com/Graphify-Labs/graphify";
|
||||
changelog = "https://github.com/Graphify-Labs/graphify/releases/tag/v${version}";
|
||||
license = lib.licenses.asl20;
|
||||
mainProgram = "graphify";
|
||||
platforms = lib.platforms.all;
|
||||
};
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
{ pkgs, inputs, ... }:
|
||||
(import ../../_lib/llm-packages.nix {
|
||||
inherit inputs;
|
||||
system = pkgs.stdenv.hostPlatform.system;
|
||||
}).gufo
|
||||
@@ -1,58 +0,0 @@
|
||||
--- a/src/core/gguf_reader.cpp
|
||||
+++ b/src/core/gguf_reader.cpp
|
||||
@@ -747,8 +747,11 @@
|
||||
tensors_.push_back(std::move(info));
|
||||
}
|
||||
|
||||
- // Align data payload base to alignment boundary
|
||||
+ // Align data payload base to alignment boundary. A tensorless file, such as
|
||||
+ // a metadata-only first split shard, may end unpadded after its header.
|
||||
const auto padding = (alignment_ - offset % alignment_) % alignment_;
|
||||
+ if (tensors_.empty())
|
||||
+ return true;
|
||||
if (offset > size_ || padding > size_ - offset)
|
||||
return false;
|
||||
const std::size_t data_base = offset + padding;
|
||||
--- a/src/models/qwen38_flash_next/weights.cpp
|
||||
+++ b/src/models/qwen38_flash_next/weights.cpp
|
||||
@@ -292,7 +292,9 @@
|
||||
b.Fail("per_layer_token_embd.weight is missing or too short");
|
||||
} else {
|
||||
w.ple_table = b.Get("per_layer_token_embd.weight", c.ple_head_dim, rows,
|
||||
- 1, {GgmlType::kIQ4_NL, GgmlType::kBF16});
|
||||
+ 1,
|
||||
+ {GgmlType::kIQ4_NL, GgmlType::kQ8_0,
|
||||
+ GgmlType::kBF16});
|
||||
}
|
||||
}
|
||||
w.layers.reserve(c.num_layers);
|
||||
--- a/src/models/qwen38_flash_next/ngram.cpp
|
||||
+++ b/src/models/qwen38_flash_next/ngram.cpp
|
||||
@@ -81,10 +81,14 @@
|
||||
int file_descriptor, std::uint64_t file_offset, std::uint64_t rows,
|
||||
std::uint32_t row_dim, core::GgmlType type, std::string* error_msg) {
|
||||
std::unique_ptr<NgramTable> t(new NgramTable());
|
||||
- const std::size_t block = type == core::GgmlType::kIQ4_NL ? 32 : 1;
|
||||
- const std::size_t block_bytes = type == core::GgmlType::kIQ4_NL ? 18 : 2;
|
||||
- if ((type != core::GgmlType::kIQ4_NL && type != core::GgmlType::kBF16) ||
|
||||
- row_dim == 0 || row_dim % block != 0) {
|
||||
+ const bool blocked =
|
||||
+ type == core::GgmlType::kIQ4_NL || type == core::GgmlType::kQ8_0;
|
||||
+ const std::size_t block = blocked ? 32 : 1;
|
||||
+ const std::size_t block_bytes = type == core::GgmlType::kIQ4_NL ? 18
|
||||
+ : type == core::GgmlType::kQ8_0 ? 34
|
||||
+ : 2;
|
||||
+ if ((!blocked && type != core::GgmlType::kBF16) || row_dim == 0 ||
|
||||
+ row_dim % block != 0) {
|
||||
if (error_msg != nullptr) {
|
||||
*error_msg = "unsupported n-gram table format";
|
||||
}
|
||||
@@ -127,6 +131,8 @@
|
||||
void NgramTable::DecodeRow(const std::uint8_t* src, float* dst) const {
|
||||
if (type_ == core::GgmlType::kIQ4_NL) {
|
||||
gufo::quant::DequantizeIQ4_NL(src, dst, row_dim_);
|
||||
+ } else if (type_ == core::GgmlType::kQ8_0) {
|
||||
+ gufo::quant::DequantizeQ8_0(src, dst, row_dim_);
|
||||
} else {
|
||||
for (std::uint32_t i = 0; i < row_dim_; ++i) {
|
||||
std::uint16_t bits = 0;
|
||||
@@ -1,44 +0,0 @@
|
||||
{ system, inputs }:
|
||||
let
|
||||
gufoPkgs = import inputs.gufo.inputs.nixpkgs {
|
||||
inherit system;
|
||||
config.allowUnfree = true;
|
||||
};
|
||||
nsh = inputs.nix-strix-halo;
|
||||
|
||||
xrt =
|
||||
(gufoPkgs.callPackage (nsh + /pkgs/xrt) {
|
||||
src = inputs.xrt-src;
|
||||
version = "2.21";
|
||||
xdnaSrc = inputs.xdna-driver-src;
|
||||
xdnaVersion = "1.7";
|
||||
}).xdna.overrideAttrs
|
||||
(old: {
|
||||
meta = (old.meta or { }) // {
|
||||
mainProgram = "xrt-smi";
|
||||
};
|
||||
});
|
||||
|
||||
package = inputs.gufo.packages.${system}.release.overrideAttrs (old: {
|
||||
nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [
|
||||
gufoPkgs.libuuid.dev
|
||||
xrt
|
||||
];
|
||||
cmakeFlags = old.cmakeFlags ++ [
|
||||
"-DGUFO_ENABLE_NPU=ON"
|
||||
"-DGUFO_XRT_INCLUDE_DIR=${xrt}/include"
|
||||
"-DGUFO_XRT_LIB_DIR=${xrt}/lib"
|
||||
];
|
||||
patches = (old.patches or [ ]) ++ [ ./gufo-unsloth-ud3.patch ];
|
||||
});
|
||||
|
||||
npuDir = "${inputs.gufo}/tools/npu";
|
||||
|
||||
fabricClock = "${inputs.gufo}/tools/npu/fabric-clock.sh";
|
||||
in
|
||||
package.overrideAttrs (old: {
|
||||
passthru = (old.passthru or { }) // {
|
||||
inherit xrt npuDir fabricClock;
|
||||
category = "AI Inference";
|
||||
};
|
||||
})
|
||||
@@ -1 +0,0 @@
|
||||
{ pkgs, ... }: pkgs.callPackage ./package.nix { }
|
||||
@@ -1,459 +0,0 @@
|
||||
--- a/haivemind_tui.py
|
||||
+++ b/haivemind_tui.py
|
||||
@@ -1197,0 +1198,8 @@
|
||||
+ def on_mount(self) -> None:
|
||||
+ app = self.app
|
||||
+ if (
|
||||
+ getattr(app, "_prompt", None) is not None
|
||||
+ and getattr(app, "_config", None) is not None
|
||||
+ ):
|
||||
+ app.start_run(app._prompt, app._config)
|
||||
+
|
||||
@@ -1220,13 +1220,13 @@
|
||||
self._engine: HaivemindEngine | None = None
|
||||
self._run_started = False
|
||||
self._run_start_time: float = 0.0
|
||||
+ self._main_screen = None
|
||||
|
||||
def on_mount(self) -> None:
|
||||
- self.push_screen(MainScreen())
|
||||
+ self._main_screen = MainScreen()
|
||||
+ self.push_screen(self._main_screen)
|
||||
self.set_interval(0.15, self._tick_spinner)
|
||||
- if self._prompt is not None and self._config is not None:
|
||||
- self.start_run(self._prompt, self._config)
|
||||
- else:
|
||||
+ if self._prompt is None or self._config is None:
|
||||
self.push_screen(ConfigScreen())
|
||||
|
||||
def start_run(self, prompt: str, config: HaivemindConfig) -> None:
|
||||
@@ -1303,7 +1303,7 @@
|
||||
def _tick_spinner(self) -> None:
|
||||
_advance_spinner()
|
||||
try:
|
||||
- hbar = self.query_one("#health-bar", ModelHealthBar)
|
||||
+ hbar = self._main_screen.query_one("#health-bar", ModelHealthBar)
|
||||
if "streaming" in hbar._model_status.values():
|
||||
hbar._refresh()
|
||||
except NoMatches:
|
||||
@@ -1315,20 +1315,20 @@
|
||||
def _on_probe_start(self) -> None:
|
||||
import time as _time
|
||||
self._run_start_time = _time.time()
|
||||
- chat = self.query_one("#chat-log", ChatLog)
|
||||
+ chat = self._main_screen.query_one("#chat-log", ChatLog)
|
||||
chat.add_summary("[bold yellow]Probing models...[/]")
|
||||
if self._config is not None:
|
||||
- hbar = self.query_one("#health-bar", ModelHealthBar)
|
||||
+ hbar = self._main_screen.query_one("#health-bar", ModelHealthBar)
|
||||
hbar.set_models(self._config.models)
|
||||
- header = self.query_one("#header-bar", HeaderBar)
|
||||
+ header = self._main_screen.query_one("#header-bar", HeaderBar)
|
||||
header.consensus_info = "probing"
|
||||
header.progress_pct = 0.0
|
||||
|
||||
@on(ProbeResult)
|
||||
def _on_probe_result(self, event: ProbeResult) -> None:
|
||||
- hbar = self.query_one("#health-bar", ModelHealthBar)
|
||||
+ hbar = self._main_screen.query_one("#health-bar", ModelHealthBar)
|
||||
hbar.set_status(event.model, "done" if event.ok else "failed")
|
||||
- chat = self.query_one("#chat-log", ChatLog)
|
||||
+ chat = self._main_screen.query_one("#chat-log", ChatLog)
|
||||
if event.ok:
|
||||
color = hbar.model_color(event.model)
|
||||
chat.add_summary(f"[{color}][probe] ok: {event.model}[/]")
|
||||
@@ -1339,44 +1339,44 @@
|
||||
|
||||
@on(ProbeDone)
|
||||
def _on_probe_done(self, event: ProbeDone) -> None:
|
||||
- chat = self.query_one("#chat-log", ChatLog)
|
||||
+ chat = self._main_screen.query_one("#chat-log", ChatLog)
|
||||
chat.add_summary(
|
||||
f"[bold yellow]Probe complete:[/] {len(event.healthy)} healthy, "
|
||||
f"{len(event.failures)} failed"
|
||||
)
|
||||
- header = self.query_one("#header-bar", HeaderBar)
|
||||
+ header = self._main_screen.query_one("#header-bar", HeaderBar)
|
||||
header.consensus_info = ""
|
||||
if event.healthy:
|
||||
- hbar = self.query_one("#health-bar", ModelHealthBar)
|
||||
+ hbar = self._main_screen.query_one("#health-bar", ModelHealthBar)
|
||||
hbar.set_models(event.healthy)
|
||||
- theatre = self.query_one("#theatre-container", TheatrePanel)
|
||||
+ theatre = self._main_screen.query_one("#theatre-container", TheatrePanel)
|
||||
theatre.update_layout(event.healthy, hbar._model_colors)
|
||||
|
||||
@on(RoundStart)
|
||||
def _on_round_start(self, event: RoundStart) -> None:
|
||||
- chat = self.query_one("#chat-log", ChatLog)
|
||||
+ chat = self._main_screen.query_one("#chat-log", ChatLog)
|
||||
chat.add_summary(f"\n[bold cyan]\u2500\u2500 Round {event.round_idx}/{event.total} \u2500\u2500[/]")
|
||||
- header = self.query_one("#header-bar", HeaderBar)
|
||||
+ header = self._main_screen.query_one("#header-bar", HeaderBar)
|
||||
header.round_info = f"hAIvemind \u2502 Round {event.round_idx}/{event.total}"
|
||||
header.consensus_info = ""
|
||||
try:
|
||||
- theatre = self.query_one("#theatre-container", TheatrePanel)
|
||||
+ theatre = self._main_screen.query_one("#theatre-container", TheatrePanel)
|
||||
theatre.clear_all()
|
||||
except NoMatches:
|
||||
pass
|
||||
|
||||
@on(ModelStart)
|
||||
def _on_model_start(self, event: ModelStart) -> None:
|
||||
- hbar = self.query_one("#health-bar", ModelHealthBar)
|
||||
+ hbar = self._main_screen.query_one("#health-bar", ModelHealthBar)
|
||||
hbar.set_status(event.model, "streaming")
|
||||
- header = self.query_one("#header-bar", HeaderBar)
|
||||
+ header = self._main_screen.query_one("#header-bar", HeaderBar)
|
||||
total = len(hbar._model_status) if hbar._model_status else 0
|
||||
done_count = sum(
|
||||
1 for s in hbar._model_status.values() if s in ("streaming", "done")
|
||||
)
|
||||
header.model_info = f"Models: {done_count}/{total}"
|
||||
try:
|
||||
- theatre = self.query_one("#theatre-container", TheatrePanel)
|
||||
+ theatre = self._main_screen.query_one("#theatre-container", TheatrePanel)
|
||||
active = [
|
||||
m for m, s in hbar._model_status.items() if s != "dropped"
|
||||
]
|
||||
@@ -1386,27 +1386,27 @@
|
||||
|
||||
@on(ModelStream)
|
||||
def _on_model_stream(self, event: ModelStream) -> None:
|
||||
- chat = self.query_one("#chat-log", ChatLog)
|
||||
- hbar = self.query_one("#health-bar", ModelHealthBar)
|
||||
+ chat = self._main_screen.query_one("#chat-log", ChatLog)
|
||||
+ hbar = self._main_screen.query_one("#health-bar", ModelHealthBar)
|
||||
color = hbar.model_color(event.model)
|
||||
t = event.fragment.strip()
|
||||
if t:
|
||||
chat.add_summary(f"[{color}][{event.model}][/] {t}")
|
||||
try:
|
||||
- theatre = self.query_one("#theatre-container", TheatrePanel)
|
||||
+ theatre = self._main_screen.query_one("#theatre-container", TheatrePanel)
|
||||
theatre.stream_to_model(event.model, event.fragment)
|
||||
except NoMatches:
|
||||
pass
|
||||
|
||||
@on(ModelDone)
|
||||
def _on_model_done(self, event: ModelDone) -> None:
|
||||
- hbar = self.query_one("#health-bar", ModelHealthBar)
|
||||
+ hbar = self._main_screen.query_one("#health-bar", ModelHealthBar)
|
||||
ar = event.agent_round
|
||||
if ar.error and ar.error not in ("stderr",):
|
||||
hbar.set_status(event.model, "failed")
|
||||
else:
|
||||
hbar.set_status(event.model, "done")
|
||||
- chat = self.query_one("#chat-log", ChatLog)
|
||||
+ chat = self._main_screen.query_one("#chat-log", ChatLog)
|
||||
color = hbar.model_color(event.model)
|
||||
if ar.has_valid_draft:
|
||||
chat.add_summary(
|
||||
@@ -1419,14 +1419,14 @@
|
||||
|
||||
@on(ModelDropped)
|
||||
def _on_model_dropped(self, event: ModelDropped) -> None:
|
||||
- hbar = self.query_one("#health-bar", ModelHealthBar)
|
||||
+ hbar = self._main_screen.query_one("#health-bar", ModelHealthBar)
|
||||
hbar.set_status(event.model, "dropped")
|
||||
- chat = self.query_one("#chat-log", ChatLog)
|
||||
+ chat = self._main_screen.query_one("#chat-log", ChatLog)
|
||||
chat.add_summary(
|
||||
f"[red]\u26a0 {event.model} dropped:[/] {event.reason}"
|
||||
)
|
||||
try:
|
||||
- theatre = self.query_one("#theatre-container", TheatrePanel)
|
||||
+ theatre = self._main_screen.query_one("#theatre-container", TheatrePanel)
|
||||
remaining = [
|
||||
m for m, s in hbar._model_status.items() if s != "dropped"
|
||||
]
|
||||
@@ -1436,7 +1436,7 @@
|
||||
|
||||
@on(RoundDone)
|
||||
def _on_round_done(self, event: RoundDone) -> None:
|
||||
- chat = self.query_one("#chat-log", ChatLog)
|
||||
+ chat = self._main_screen.query_one("#chat-log", ChatLog)
|
||||
dur = event.record.get("duration_s", 0)
|
||||
chat.add_summary(
|
||||
f"[dim]\u2500\u2500 end round {event.round_idx} ({dur}s) \u2500\u2500[/]"
|
||||
@@ -1446,15 +1446,15 @@
|
||||
best_sim = _compute_best_similarity(drafts)
|
||||
threshold = self._config.threshold if self._config else 0.75
|
||||
pct = min(1.0, best_sim / threshold) if threshold > 0 else 0.0
|
||||
- header = self.query_one("#header-bar", HeaderBar)
|
||||
+ header = self._main_screen.query_one("#header-bar", HeaderBar)
|
||||
header.progress_pct = pct
|
||||
header.consensus_info = f"sim: {best_sim:.2f}"
|
||||
|
||||
@on(Consensus)
|
||||
def _on_consensus(self, event: Consensus) -> None:
|
||||
- chat = self.query_one("#chat-log", ChatLog)
|
||||
- header = self.query_one("#header-bar", HeaderBar)
|
||||
- hbar = self.query_one("#health-bar", ModelHealthBar)
|
||||
+ chat = self._main_screen.query_one("#chat-log", ChatLog)
|
||||
+ header = self._main_screen.query_one("#header-bar", HeaderBar)
|
||||
+ hbar = self._main_screen.query_one("#health-bar", ModelHealthBar)
|
||||
total_models = len(hbar._model_status) if hbar._model_status else 0
|
||||
import time as _time
|
||||
elapsed = (
|
||||
@@ -1493,9 +1493,9 @@
|
||||
|
||||
@on(Fallback)
|
||||
def _on_fallback(self, event: Fallback) -> None:
|
||||
- chat = self.query_one("#chat-log", ChatLog)
|
||||
- header = self.query_one("#header-bar", HeaderBar)
|
||||
- hbar = self.query_one("#health-bar", ModelHealthBar)
|
||||
+ chat = self._main_screen.query_one("#chat-log", ChatLog)
|
||||
+ header = self._main_screen.query_one("#header-bar", HeaderBar)
|
||||
+ hbar = self._main_screen.query_one("#health-bar", ModelHealthBar)
|
||||
total_models = len(hbar._model_status) if hbar._model_status else 0
|
||||
header.consensus_info = "fallback"
|
||||
header.progress_pct = 0.0
|
||||
@@ -1518,30 +1518,30 @@
|
||||
|
||||
@on(EngineError)
|
||||
def _on_engine_error(self, event: EngineError) -> None:
|
||||
- chat = self.query_one("#chat-log", ChatLog)
|
||||
+ chat = self._main_screen.query_one("#chat-log", ChatLog)
|
||||
chat.add_summary(f"[red]Error:[/] {event.message}")
|
||||
- header = self.query_one("#header-bar", HeaderBar)
|
||||
+ header = self._main_screen.query_one("#header-bar", HeaderBar)
|
||||
header.consensus_info = "error"
|
||||
|
||||
@on(EngineLog)
|
||||
def _on_engine_log(self, event: EngineLog) -> None:
|
||||
- chat = self.query_one("#chat-log", ChatLog)
|
||||
+ chat = self._main_screen.query_one("#chat-log", ChatLog)
|
||||
chat.add_summary(event.message)
|
||||
|
||||
@on(MoaRefStart)
|
||||
def _on_moa_ref_start(self, event: MoaRefStart) -> None:
|
||||
- chat = self.query_one("#chat-log", ChatLog)
|
||||
- hbar = self.query_one("#health-bar", ModelHealthBar)
|
||||
+ chat = self._main_screen.query_one("#chat-log", ChatLog)
|
||||
+ hbar = self._main_screen.query_one("#health-bar", ModelHealthBar)
|
||||
hbar.set_status(event.model, "streaming")
|
||||
color = hbar.model_color(event.model)
|
||||
chat.add_summary(f"[{color}]\U0001f4e1 [ref] {event.model} analyzing...[/]")
|
||||
- header = self.query_one("#header-bar", HeaderBar)
|
||||
+ header = self._main_screen.query_one("#header-bar", HeaderBar)
|
||||
header.round_info = "hAIvemind \u2502 MoA \u2502 References"
|
||||
|
||||
@on(MoaRefDone)
|
||||
def _on_moa_ref_done(self, event: MoaRefDone) -> None:
|
||||
- hbar = self.query_one("#health-bar", ModelHealthBar)
|
||||
- chat = self.query_one("#chat-log", ChatLog)
|
||||
+ hbar = self._main_screen.query_one("#health-bar", ModelHealthBar)
|
||||
+ chat = self._main_screen.query_one("#chat-log", ChatLog)
|
||||
color = hbar.model_color(event.model)
|
||||
if event.err and not event.raw.strip():
|
||||
hbar.set_status(event.model, "failed")
|
||||
@@ -1552,32 +1552,32 @@
|
||||
|
||||
@on(MoaRefStream)
|
||||
def _on_moa_ref_stream(self, event: MoaRefStream) -> None:
|
||||
- chat = self.query_one("#chat-log", ChatLog)
|
||||
- hbar = self.query_one("#health-bar", ModelHealthBar)
|
||||
+ chat = self._main_screen.query_one("#chat-log", ChatLog)
|
||||
+ hbar = self._main_screen.query_one("#health-bar", ModelHealthBar)
|
||||
color = hbar.model_color(event.model)
|
||||
t = event.fragment.strip()
|
||||
if t:
|
||||
chat.add_summary(f"[{color}][ref:{event.model}][/] {t}")
|
||||
try:
|
||||
- theatre = self.query_one("#theatre-container", TheatrePanel)
|
||||
+ theatre = self._main_screen.query_one("#theatre-container", TheatrePanel)
|
||||
theatre.stream_to_model(event.model, event.fragment)
|
||||
except NoMatches:
|
||||
pass
|
||||
|
||||
@on(MoaAggStart)
|
||||
def _on_moa_agg_start(self, event: MoaAggStart) -> None:
|
||||
- chat = self.query_one("#chat-log", ChatLog)
|
||||
- hbar = self.query_one("#health-bar", ModelHealthBar)
|
||||
+ chat = self._main_screen.query_one("#chat-log", ChatLog)
|
||||
+ hbar = self._main_screen.query_one("#health-bar", ModelHealthBar)
|
||||
hbar.set_status(event.model, "streaming")
|
||||
color = hbar.model_color(event.model)
|
||||
chat.add_summary(f"\n[bold {color}]\U0001f9e0 [aggregator] {event.model} synthesizing...[/]")
|
||||
- header = self.query_one("#header-bar", HeaderBar)
|
||||
+ header = self._main_screen.query_one("#header-bar", HeaderBar)
|
||||
header.round_info = "hAIvemind \u2502 MoA \u2502 Aggregating"
|
||||
|
||||
@on(MoaAggDone)
|
||||
def _on_moa_agg_done(self, event: MoaAggDone) -> None:
|
||||
- hbar = self.query_one("#health-bar", ModelHealthBar)
|
||||
- chat = self.query_one("#chat-log", ChatLog)
|
||||
+ hbar = self._main_screen.query_one("#health-bar", ModelHealthBar)
|
||||
+ chat = self._main_screen.query_one("#chat-log", ChatLog)
|
||||
color = hbar.model_color(event.model)
|
||||
if event.raw.strip():
|
||||
hbar.set_status(event.model, "done")
|
||||
@@ -1588,14 +1588,14 @@
|
||||
|
||||
@on(MoaAggStream)
|
||||
def _on_moa_agg_stream(self, event: MoaAggStream) -> None:
|
||||
- chat = self.query_one("#chat-log", ChatLog)
|
||||
- hbar = self.query_one("#health-bar", ModelHealthBar)
|
||||
+ chat = self._main_screen.query_one("#chat-log", ChatLog)
|
||||
+ hbar = self._main_screen.query_one("#health-bar", ModelHealthBar)
|
||||
color = hbar.model_color(event.model)
|
||||
t = event.fragment.strip()
|
||||
if t:
|
||||
chat.add_summary(f"[{color}][agg:{event.model}][/] {t}")
|
||||
try:
|
||||
- theatre = self.query_one("#theatre-container", TheatrePanel)
|
||||
+ theatre = self._main_screen.query_one("#theatre-container", TheatrePanel)
|
||||
theatre.stream_to_model(event.model, event.fragment)
|
||||
except NoMatches:
|
||||
pass
|
||||
@@ -1604,18 +1604,18 @@
|
||||
|
||||
@on(FusionPanelStart)
|
||||
def _on_fusion_panel_start(self, event: FusionPanelStart) -> None:
|
||||
- chat = self.query_one("#chat-log", ChatLog)
|
||||
- hbar = self.query_one("#health-bar", ModelHealthBar)
|
||||
+ chat = self._main_screen.query_one("#chat-log", ChatLog)
|
||||
+ hbar = self._main_screen.query_one("#health-bar", ModelHealthBar)
|
||||
hbar.set_status(event.model, "streaming")
|
||||
color = hbar.model_color(event.model)
|
||||
chat.add_summary(f"[{color}]\U0001f52c [panel] {event.model} analyzing...[/]")
|
||||
- header = self.query_one("#header-bar", HeaderBar)
|
||||
+ header = self._main_screen.query_one("#header-bar", HeaderBar)
|
||||
header.round_info = "hAIvemind \u2502 Fusion \u2502 Panel"
|
||||
|
||||
@on(FusionPanelDone)
|
||||
def _on_fusion_panel_done(self, event: FusionPanelDone) -> None:
|
||||
- hbar = self.query_one("#health-bar", ModelHealthBar)
|
||||
- chat = self.query_one("#chat-log", ChatLog)
|
||||
+ hbar = self._main_screen.query_one("#health-bar", ModelHealthBar)
|
||||
+ chat = self._main_screen.query_one("#chat-log", ChatLog)
|
||||
color = hbar.model_color(event.model)
|
||||
if event.err and not event.raw.strip():
|
||||
hbar.set_status(event.model, "failed")
|
||||
@@ -1626,32 +1626,32 @@
|
||||
|
||||
@on(FusionPanelStream)
|
||||
def _on_fusion_panel_stream(self, event: FusionPanelStream) -> None:
|
||||
- chat = self.query_one("#chat-log", ChatLog)
|
||||
- hbar = self.query_one("#health-bar", ModelHealthBar)
|
||||
+ chat = self._main_screen.query_one("#chat-log", ChatLog)
|
||||
+ hbar = self._main_screen.query_one("#health-bar", ModelHealthBar)
|
||||
color = hbar.model_color(event.model)
|
||||
t = event.fragment.strip()
|
||||
if t:
|
||||
chat.add_summary(f"[{color}][panel:{event.model}][/] {t}")
|
||||
try:
|
||||
- theatre = self.query_one("#theatre-container", TheatrePanel)
|
||||
+ theatre = self._main_screen.query_one("#theatre-container", TheatrePanel)
|
||||
theatre.stream_to_model(event.model, event.fragment)
|
||||
except NoMatches:
|
||||
pass
|
||||
|
||||
@on(FusionJudgeStart)
|
||||
def _on_fusion_judge_start(self, event: FusionJudgeStart) -> None:
|
||||
- chat = self.query_one("#chat-log", ChatLog)
|
||||
- hbar = self.query_one("#health-bar", ModelHealthBar)
|
||||
+ chat = self._main_screen.query_one("#chat-log", ChatLog)
|
||||
+ hbar = self._main_screen.query_one("#health-bar", ModelHealthBar)
|
||||
hbar.set_status(event.model, "streaming")
|
||||
color = hbar.model_color(event.model)
|
||||
chat.add_summary(f"\n[bold {color}]\u2696\ufe0f [judge] {event.model} analyzing...[/]")
|
||||
- header = self.query_one("#header-bar", HeaderBar)
|
||||
+ header = self._main_screen.query_one("#header-bar", HeaderBar)
|
||||
header.round_info = "hAIvemind \u2502 Fusion \u2502 Judging"
|
||||
|
||||
@on(FusionJudgeDone)
|
||||
def _on_fusion_judge_done(self, event: FusionJudgeDone) -> None:
|
||||
- hbar = self.query_one("#health-bar", ModelHealthBar)
|
||||
- chat = self.query_one("#chat-log", ChatLog)
|
||||
+ hbar = self._main_screen.query_one("#health-bar", ModelHealthBar)
|
||||
+ chat = self._main_screen.query_one("#chat-log", ChatLog)
|
||||
color = hbar.model_color(event.model)
|
||||
if event.raw.strip():
|
||||
hbar.set_status(event.model, "done")
|
||||
@@ -1662,32 +1662,32 @@
|
||||
|
||||
@on(FusionJudgeStream)
|
||||
def _on_fusion_judge_stream(self, event: FusionJudgeStream) -> None:
|
||||
- chat = self.query_one("#chat-log", ChatLog)
|
||||
- hbar = self.query_one("#health-bar", ModelHealthBar)
|
||||
+ chat = self._main_screen.query_one("#chat-log", ChatLog)
|
||||
+ hbar = self._main_screen.query_one("#health-bar", ModelHealthBar)
|
||||
color = hbar.model_color(event.model)
|
||||
t = event.fragment.strip()
|
||||
if t:
|
||||
chat.add_summary(f"[{color}][judge:{event.model}][/] {t}")
|
||||
try:
|
||||
- theatre = self.query_one("#theatre-container", TheatrePanel)
|
||||
+ theatre = self._main_screen.query_one("#theatre-container", TheatrePanel)
|
||||
theatre.stream_to_model(event.model, event.fragment)
|
||||
except NoMatches:
|
||||
pass
|
||||
|
||||
@on(FusionSynthStart)
|
||||
def _on_fusion_synth_start(self, event: FusionSynthStart) -> None:
|
||||
- chat = self.query_one("#chat-log", ChatLog)
|
||||
- hbar = self.query_one("#health-bar", ModelHealthBar)
|
||||
+ chat = self._main_screen.query_one("#chat-log", ChatLog)
|
||||
+ hbar = self._main_screen.query_one("#health-bar", ModelHealthBar)
|
||||
hbar.set_status(event.model, "streaming")
|
||||
color = hbar.model_color(event.model)
|
||||
chat.add_summary(f"\n[bold {color}]\u270d\ufe0f [synth] {event.model} writing final answer...[/]")
|
||||
- header = self.query_one("#header-bar", HeaderBar)
|
||||
+ header = self._main_screen.query_one("#header-bar", HeaderBar)
|
||||
header.round_info = "hAIvemind \u2502 Fusion \u2502 Synthesizing"
|
||||
|
||||
@on(FusionSynthDone)
|
||||
def _on_fusion_synth_done(self, event: FusionSynthDone) -> None:
|
||||
- hbar = self.query_one("#health-bar", ModelHealthBar)
|
||||
- chat = self.query_one("#chat-log", ChatLog)
|
||||
+ hbar = self._main_screen.query_one("#health-bar", ModelHealthBar)
|
||||
+ chat = self._main_screen.query_one("#chat-log", ChatLog)
|
||||
color = hbar.model_color(event.model)
|
||||
if event.raw.strip():
|
||||
hbar.set_status(event.model, "done")
|
||||
@@ -1698,14 +1698,14 @@
|
||||
|
||||
@on(FusionSynthStream)
|
||||
def _on_fusion_synth_stream(self, event: FusionSynthStream) -> None:
|
||||
- chat = self.query_one("#chat-log", ChatLog)
|
||||
- hbar = self.query_one("#health-bar", ModelHealthBar)
|
||||
+ chat = self._main_screen.query_one("#chat-log", ChatLog)
|
||||
+ hbar = self._main_screen.query_one("#health-bar", ModelHealthBar)
|
||||
color = hbar.model_color(event.model)
|
||||
t = event.fragment.strip()
|
||||
if t:
|
||||
chat.add_summary(f"[{color}][synth:{event.model}][/] {t}")
|
||||
try:
|
||||
- theatre = self.query_one("#theatre-container", TheatrePanel)
|
||||
+ theatre = self._main_screen.query_one("#theatre-container", TheatrePanel)
|
||||
theatre.stream_to_model(event.model, event.fragment)
|
||||
except NoMatches:
|
||||
pass
|
||||
@@ -1720,7 +1720,7 @@
|
||||
|
||||
def action_toggle_theatre(self) -> None:
|
||||
try:
|
||||
- tc = self.query_one("#theatre-container")
|
||||
+ tc = self._main_screen.query_one("#theatre-container")
|
||||
if tc.has_class("visible"):
|
||||
tc.remove_class("visible")
|
||||
else:
|
||||
@@ -1734,13 +1734,13 @@
|
||||
|
||||
def action_clear_theatre(self) -> None:
|
||||
try:
|
||||
- theatre = self.query_one("#theatre-container", TheatrePanel)
|
||||
+ theatre = self._main_screen.query_one("#theatre-container", TheatrePanel)
|
||||
theatre.clear_all()
|
||||
except NoMatches:
|
||||
pass
|
||||
|
||||
def action_show_artifacts(self) -> None:
|
||||
- chat = self.query_one("#chat-log", ChatLog)
|
||||
+ chat = self._main_screen.query_one("#chat-log", ChatLog)
|
||||
if self._engine and self._engine.run_dir:
|
||||
chat.add_summary(f"[bold]Artifacts:[/] {self._engine.run_dir}")
|
||||
else:
|
||||
@@ -1,62 +0,0 @@
|
||||
{
|
||||
lib,
|
||||
fetchFromGitHub,
|
||||
python3Packages,
|
||||
}:
|
||||
|
||||
python3Packages.buildPythonApplication rec {
|
||||
pname = "haivemind";
|
||||
version = "0-unstable-2026-07-01";
|
||||
pyproject = true;
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "dev-boz";
|
||||
repo = "haivemind";
|
||||
rev = "ce4a0437d41f57638b71a17e2ff3af524d5a1b6e";
|
||||
hash = "sha256-x7NM2wHwi11i07jHTL9NgYJkzzlP+tOmJy027itRtWs=";
|
||||
};
|
||||
|
||||
build-system = with python3Packages; [
|
||||
setuptools
|
||||
];
|
||||
|
||||
dependencies = with python3Packages; [
|
||||
textual
|
||||
];
|
||||
|
||||
patches = [
|
||||
./fix-chat-log-race.patch
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace haivemind_tui.py \
|
||||
--replace-fail "sel.value = Select.BLANK" "sel.clear()" \
|
||||
--replace-fail "v is Select.BLANK" "v is Select.NULL"
|
||||
'';
|
||||
|
||||
doCheck = false;
|
||||
pythonImportsCheck = [
|
||||
"haivemind"
|
||||
"haivemind_tui"
|
||||
"haivemind_curses"
|
||||
];
|
||||
|
||||
passthru = {
|
||||
category = "AI Coding Agents";
|
||||
updateScript = [
|
||||
"nix-update"
|
||||
"--flake"
|
||||
".#haivemind"
|
||||
"--version=branch=main"
|
||||
];
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
description = "Multi-model AI consensus, aggregation, and fusion runner for popular AI CLIs";
|
||||
homepage = "https://github.com/dev-boz/haivemind";
|
||||
changelog = "https://github.com/dev-boz/haivemind/commits/main";
|
||||
license = licenses.mit;
|
||||
mainProgram = "haivemind";
|
||||
platforms = platforms.all;
|
||||
};
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
{
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
# hipEngine >= 0.5.0 requires llguidance >= 1.8,<2; nixpkgs only provides
|
||||
# 1.7.x. Override nixpkgs' llguidance to 1.8.0 and hand the resulting
|
||||
# interpreter/package set to the package.
|
||||
let
|
||||
python = pkgs.python3.override {
|
||||
packageOverrides = self: super: {
|
||||
llguidance = super.llguidance.overridePythonAttrs (old: rec {
|
||||
version = "1.8.0";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "guidance-ai";
|
||||
repo = "llguidance";
|
||||
tag = "v${version}";
|
||||
hash = "sha256-/rHTefKTq5ch38NqbcLYTXBJwkW+WzG5OFvignDIie4=";
|
||||
};
|
||||
cargoDeps = pkgs.rustPlatform.fetchCargoVendor {
|
||||
pname = "llguidance";
|
||||
inherit src version;
|
||||
hash = "sha256-aa9R+6xgFVGAD3snHbkPRF5jMYwC3DFNjXcUtaOzDbU=";
|
||||
};
|
||||
});
|
||||
};
|
||||
};
|
||||
in
|
||||
python.pkgs.callPackage ./package.nix {
|
||||
python3Packages = python.pkgs;
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
{
|
||||
lib,
|
||||
python3Packages,
|
||||
fetchFromGitHub,
|
||||
}:
|
||||
|
||||
python3Packages.buildPythonApplication rec {
|
||||
pname = "hipengine";
|
||||
version = "0.8.3";
|
||||
pyproject = true;
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "shisa-ai";
|
||||
repo = "hipEngine";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-T5mRTG0LGb6dbsyNjKuuqOK0H81cQtWPi2iZD6QTcwc=";
|
||||
};
|
||||
|
||||
build-system = with python3Packages; [
|
||||
hatchling
|
||||
];
|
||||
|
||||
dependencies = with python3Packages; [
|
||||
fastapi
|
||||
jinja2
|
||||
llguidance
|
||||
numpy
|
||||
safetensors
|
||||
tokenizers
|
||||
uvicorn
|
||||
];
|
||||
|
||||
doCheck = false;
|
||||
pythonImportsCheck = [ "hipengine" ];
|
||||
|
||||
passthru = {
|
||||
category = "AI Inference";
|
||||
updateScript = [
|
||||
"nix-update"
|
||||
"--flake"
|
||||
".#hipengine"
|
||||
];
|
||||
};
|
||||
|
||||
meta = {
|
||||
description = "ROCm-native local LLM inference engine with a torch-free runtime hot path for AMD RDNA GPUs";
|
||||
homepage = "https://github.com/shisa-ai/hipEngine";
|
||||
changelog = "https://github.com/shisa-ai/hipEngine/releases/tag/v${version}";
|
||||
license = lib.licenses.agpl3Plus;
|
||||
platforms = lib.platforms.linux;
|
||||
# Upstream replaced the hipengine-server console script with
|
||||
# a top-level `hipengine` command (e.g. `hipengine serve`).
|
||||
mainProgram = "hipengine";
|
||||
};
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
{ pkgs, inputs, ... }:
|
||||
(import ../../_lib/llm-packages.nix {
|
||||
inherit inputs;
|
||||
system = pkgs.stdenv.hostPlatform.system;
|
||||
}).hipfire-kernels
|
||||
@@ -1,5 +0,0 @@
|
||||
{ pkgs, inputs, ... }:
|
||||
(import ../../_lib/llm-packages.nix {
|
||||
inherit inputs;
|
||||
system = pkgs.stdenv.hostPlatform.system;
|
||||
}).hipfire
|
||||
@@ -1,128 +0,0 @@
|
||||
{
|
||||
pkgs,
|
||||
hipfireSource,
|
||||
therockRocm,
|
||||
modelDir ? "/var/lib/hipfire/models",
|
||||
}:
|
||||
let
|
||||
lib = pkgs.lib;
|
||||
gcc = pkgs.stdenv.cc;
|
||||
|
||||
hipccFixed = pkgs.writeShellScriptBin "hipcc" ''
|
||||
export ROCM_PATH=${therockRocm}
|
||||
exec ${therockRocm}/bin/hipcc \
|
||||
--gcc-toolchain=${gcc.cc} \
|
||||
-idirafter ${gcc.libc.dev}/include \
|
||||
-B${gcc.libc}/lib \
|
||||
-L${gcc.libc}/lib \
|
||||
-L${gcc.cc.lib}/lib \
|
||||
-L${gcc.cc}/lib \
|
||||
"$@"
|
||||
'';
|
||||
|
||||
glibcLoader = "${pkgs.glibc}/lib/ld-linux-x86-64.so.2";
|
||||
llvmRunPath = lib.makeSearchPathOutput "lib" "lib" [
|
||||
gcc.cc.lib
|
||||
gcc.cc
|
||||
];
|
||||
therockLlvmTool =
|
||||
name:
|
||||
pkgs.writeShellScriptBin name ''
|
||||
exec ${glibcLoader} --library-path ${therockRocm}/lib:${llvmRunPath} \
|
||||
${therockRocm}/lib/llvm/bin/${name} "$@"
|
||||
'';
|
||||
llvmReadobj = therockLlvmTool "llvm-readobj";
|
||||
llvmObjdump = therockLlvmTool "llvm-objdump";
|
||||
|
||||
therockDeviceLibs = pkgs.runCommand "therock-device-libs" { } ''
|
||||
mkdir -p $out/amdgcn
|
||||
ln -sfn ${therockRocm}/amdgcn/bitcode $out/amdgcn/bitcode
|
||||
'';
|
||||
|
||||
hipfireKernelsPkg =
|
||||
(pkgs.callPackage (hipfireSource + "/nix/kernels.nix") {
|
||||
src = hipfireSource;
|
||||
cargoLockFile = hipfireSource + "/Cargo.lock";
|
||||
gpuTargets = [ "gfx1151" ];
|
||||
rocmPackages = pkgs.rocmPackages // {
|
||||
clr = therockRocm;
|
||||
rocm-device-libs = therockDeviceLibs;
|
||||
};
|
||||
}).overrideAttrs
|
||||
(old: {
|
||||
nativeBuildInputs = old.nativeBuildInputs ++ [ hipccFixed ];
|
||||
env.HIPFIRE_HIPCC = "${hipccFixed}/bin/hipcc";
|
||||
preBuild = (old.preBuild or "") + ''
|
||||
export CARGO_BUILD_JOBS="$NIX_BUILD_CORES"
|
||||
export HIPFIRE_PACK_JOBS="$NIX_BUILD_CORES"
|
||||
'';
|
||||
});
|
||||
|
||||
hipfireWithQuantize = pkgs.hipfire.overrideAttrs (_: {
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
export CARGO_BUILD_JOBS="$NIX_BUILD_CORES"
|
||||
cargo build --release -p hipfire-daemon
|
||||
cargo build --release -p hipfire-cli
|
||||
cargo build --release -p hipfire-quantize \
|
||||
--bin hipfire-quantize --bin dflash_convert --bin draft_to_mq4
|
||||
runHook postBuild
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
mkdir -p $out/bin
|
||||
|
||||
cp target/release/daemon $out/bin/hipfire-daemon-unwrapped
|
||||
makeWrapper $out/bin/hipfire-daemon-unwrapped $out/bin/hipfire-daemon \
|
||||
--set HIPFIRE_ROCM_PATH ${therockRocm} \
|
||||
--set HIPFIRE_HIPCC ${hipccFixed}/bin/hipcc \
|
||||
--set ROCM_PATH ${therockRocm} \
|
||||
--set RADIOWAVE_READOBJ ${llvmReadobj}/bin/llvm-readobj \
|
||||
--set RADIOWAVE_OBJDUMP ${llvmObjdump}/bin/llvm-objdump \
|
||||
--prefix PATH : ${
|
||||
pkgs.lib.makeBinPath [
|
||||
hipccFixed
|
||||
pkgs.pciutils
|
||||
]
|
||||
} \
|
||||
--prefix LD_LIBRARY_PATH : ${therockRocm}/lib
|
||||
|
||||
cp target/release/hipfire $out/bin/hipfire-unwrapped
|
||||
makeWrapper $out/bin/hipfire-unwrapped $out/bin/hipfire \
|
||||
--set HIPFIRE_DAEMON_BIN $out/bin/hipfire-daemon \
|
||||
--set HIPFIRE_NORMALIZE_PROMPT "1" \
|
||||
--set HIPFIRE_MODELS_DIR "${modelDir}" \
|
||||
--set HIP_PATH "${therockRocm}" \
|
||||
--set HIPFIRE_HIPCC ${hipccFixed}/bin/hipcc \
|
||||
--set ROCM_PATH ${therockRocm} \
|
||||
--set RADIOWAVE_READOBJ ${llvmReadobj}/bin/llvm-readobj \
|
||||
--set RADIOWAVE_OBJDUMP ${llvmObjdump}/bin/llvm-objdump \
|
||||
--prefix PATH : ${
|
||||
pkgs.lib.makeBinPath [
|
||||
hipccFixed
|
||||
pkgs.pciutils
|
||||
]
|
||||
} \
|
||||
--prefix LD_LIBRARY_PATH : ${therockRocm}/lib
|
||||
|
||||
mkdir -p $out/share/hipfire/target/release
|
||||
cp target/release/hipfire-quantize $out/share/hipfire/target/release/
|
||||
cp target/release/dflash_convert $out/share/hipfire/target/release/
|
||||
cp target/release/draft_to_mq4 $out/share/hipfire/target/release/
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
});
|
||||
|
||||
in
|
||||
hipfireWithQuantize.overrideAttrs (old: {
|
||||
passthru = (old.passthru or { }) // {
|
||||
kernels = hipfireKernelsPkg;
|
||||
hipcc = hipccFixed;
|
||||
inherit llvmReadobj llvmObjdump;
|
||||
rocm = therockRocm;
|
||||
category = "AI Inference";
|
||||
};
|
||||
})
|
||||
@@ -1,11 +0,0 @@
|
||||
{
|
||||
pkgs,
|
||||
inputs,
|
||||
...
|
||||
}:
|
||||
# kubernetes-mcp-server >= 0.0.66 requires go >= 1.26.3, which the flake's
|
||||
# pinned nixpkgs does not provide yet. Build with the newer nixpkgs-latest input.
|
||||
let
|
||||
latestPkgs = inputs.nixpkgs-latest.legacyPackages.${pkgs.stdenv.hostPlatform.system};
|
||||
in
|
||||
latestPkgs.callPackage ./package.nix { }
|
||||
@@ -1,52 +0,0 @@
|
||||
{
|
||||
lib,
|
||||
buildGoModule,
|
||||
fetchFromGitHub,
|
||||
go_1_27,
|
||||
}:
|
||||
|
||||
# go.mod requires go >= 1.26.10; nixpkgs-latest still ships 1.26.x.
|
||||
(buildGoModule.override { go = go_1_27; }) rec {
|
||||
pname = "kubernetes-mcp-server";
|
||||
version = "0.0.69";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "containers";
|
||||
repo = "kubernetes-mcp-server";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-mvWFYxI1m8awaNl7p1utQ7lLwCwVdm+6e8K/lbpBSv4=";
|
||||
};
|
||||
|
||||
vendorHash = "sha256-iKexsARqV4pvYpjzd2nP79U6pzhEB7Ou5O6ET05iMQ4=";
|
||||
|
||||
env.CGO_ENABLED = 0;
|
||||
|
||||
subPackages = [ "cmd/kubernetes-mcp-server" ];
|
||||
|
||||
# Tests require access to a live Kubernetes cluster
|
||||
doCheck = false;
|
||||
|
||||
ldflags = [
|
||||
"-s"
|
||||
"-w"
|
||||
];
|
||||
|
||||
passthru = {
|
||||
category = "MCP Servers";
|
||||
updateScript = [
|
||||
"nix-update"
|
||||
"--flake"
|
||||
".#kubernetes-mcp-server"
|
||||
];
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
description = "Model Context Protocol (MCP) server for Kubernetes and OpenShift";
|
||||
homepage = "https://github.com/containers/kubernetes-mcp-server";
|
||||
changelog = "https://github.com/containers/kubernetes-mcp-server/releases/tag/v${version}";
|
||||
license = licenses.asl20;
|
||||
sourceProvenance = with sourceTypes; [ fromSource ];
|
||||
mainProgram = "kubernetes-mcp-server";
|
||||
platforms = platforms.all;
|
||||
};
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
{ pkgs, inputs, ... }:
|
||||
(import ../../_lib/llm-packages.nix {
|
||||
inherit inputs;
|
||||
system = pkgs.stdenv.hostPlatform.system;
|
||||
}).kyojin
|
||||
@@ -1,12 +0,0 @@
|
||||
--- a/exllamav3/modules/expert_store.py
|
||||
+++ b/exllamav3/modules/expert_store.py
|
||||
@@ -1182,6 +1182,9 @@
|
||||
if r <= 0:
|
||||
break # EOF inside the last block: the copies only touch real tensor bytes
|
||||
got += r
|
||||
+ # An unaligned EOF cannot be used as the offset for another O_DIRECT read.
|
||||
+ if got < n and off + got == os.fstat(fd).st_size:
|
||||
+ break
|
||||
return got
|
||||
|
||||
def _publish(self, lt: LayerTier, item, e: int, s: int):
|
||||
@@ -1,105 +0,0 @@
|
||||
--- a/tools/qwen/serve.py
|
||||
+++ b/tools/qwen/serve.py
|
||||
@@ -1262,6 +1262,15 @@
|
||||
for serial, evs in by_serial.items():
|
||||
route = self._routes.get(serial)
|
||||
if route is not None: # None: cancelled after the step started
|
||||
+ if evs[-1].get("eos") and self.generator.num_remaining_jobs():
|
||||
+ # A requeued replacement keeps its serial. Retire only a finished request,
|
||||
+ # before the next GPU step can delay its handler's final _drop().
|
||||
+ live = self.generator.active_jobs + self.generator.pending_jobs
|
||||
+ if all(job.serial_number != serial for job in live):
|
||||
+ del self._routes[serial]
|
||||
+ finished = loop.create_future()
|
||||
+ finished.set_result(None)
|
||||
+ route[0]._qserve_finished = finished
|
||||
route[1].put_nowait(evs)
|
||||
|
||||
def _fail_unroutable(self, ev, exc: Exception) -> None:
|
||||
@@ -1298,6 +1307,10 @@
|
||||
def _drop(self, job) -> asyncio.Future:
|
||||
"""Stop routing the job and remove it from the Generator (a no-op when it already finished). Runs on the driver, after
|
||||
any enqueue posted before it, so a job cancelled while its enqueue is still queued does not stay behind."""
|
||||
+ finished = getattr(job, "_qserve_finished", None)
|
||||
+ if finished is not None:
|
||||
+ return finished
|
||||
+
|
||||
def forget():
|
||||
serial = getattr(job, "serial_number", None)
|
||||
route = self._routes.get(serial)
|
||||
--- a/tools/qwen/test_serve.py
|
||||
+++ b/tools/qwen/test_serve.py
|
||||
@@ -4,10 +4,12 @@
|
||||
|
||||
import asyncio
|
||||
import base64
|
||||
+import contextlib
|
||||
import io
|
||||
import json
|
||||
import os
|
||||
import sys
|
||||
+import threading
|
||||
import types
|
||||
import unittest
|
||||
import unittest.mock
|
||||
@@ -1246,5 +1248,60 @@
|
||||
self.assertIn(b"hel", body)
|
||||
|
||||
|
||||
+class FinishedRouteTests(unittest.IsolatedAsyncioTestCase):
|
||||
+ async def start_driver(self, mode):
|
||||
+ engine = object.__new__(serve.QwenEngine)
|
||||
+ old = types.SimpleNamespace(serial_number=4)
|
||||
+ other = types.SimpleNamespace(serial_number=5)
|
||||
+ replacement = types.SimpleNamespace(serial_number=4)
|
||||
+ generator = types.SimpleNamespace(active_jobs=[old], pending_jobs=[])
|
||||
+ release = threading.Event()
|
||||
+
|
||||
+ def iterate():
|
||||
+ if any(job is old for job in generator.active_jobs):
|
||||
+ generator.active_jobs = [] if mode == "solo" else [other]
|
||||
+ if mode == "active":
|
||||
+ generator.active_jobs.append(replacement)
|
||||
+ if mode == "pending":
|
||||
+ generator.pending_jobs.append(replacement)
|
||||
+ return [dict(serial=4, eos=mode != "ongoing", text="last piece")]
|
||||
+ release.wait(2)
|
||||
+ generator.active_jobs.clear()
|
||||
+ generator.pending_jobs.clear()
|
||||
+ return []
|
||||
+
|
||||
+ generator.iterate = iterate
|
||||
+ generator.num_remaining_jobs = lambda: len(generator.active_jobs) + len(generator.pending_jobs)
|
||||
+ generator.cancel = unittest.mock.Mock()
|
||||
+ engine.generator = generator
|
||||
+ engine._ensure_driver()
|
||||
+
|
||||
+ async def stop():
|
||||
+ release.set()
|
||||
+ engine._driver.cancel()
|
||||
+ with contextlib.suppress(asyncio.CancelledError):
|
||||
+ await engine._driver
|
||||
+
|
||||
+ self.addAsyncCleanup(stop)
|
||||
+ queue = asyncio.Queue()
|
||||
+ engine._routes[4] = (old, queue)
|
||||
+ events = await asyncio.wait_for(queue.get(), 1)
|
||||
+ self.assertEqual(events[-1]["text"], "last piece")
|
||||
+ return engine, old
|
||||
+
|
||||
+ async def test_completed_request_retires_before_another_chunk(self):
|
||||
+ engine, old = await self.start_driver("done")
|
||||
+ self.assertNotIn(4, engine._routes)
|
||||
+ self.assertTrue(engine._drop(old).done())
|
||||
+ self.assertTrue(engine._drop(old).done())
|
||||
+ engine.generator.cancel.assert_not_called()
|
||||
+
|
||||
+ async def test_keep_live_requeued_and_solo_routes(self):
|
||||
+ for mode in ("ongoing", "active", "pending", "solo"):
|
||||
+ with self.subTest(mode=mode):
|
||||
+ engine, old = await self.start_driver(mode)
|
||||
+ self.assertIs(engine._routes[4][0], old)
|
||||
+
|
||||
+
|
||||
class PrefixDiskConcurrencyTests(unittest.TestCase):
|
||||
"""The disk cache must work while other requests run (3 users): restore with a busy Generator, save of the request's own prompt."""
|
||||
@@ -1,125 +0,0 @@
|
||||
--- a/tools/qwen/serve.py
|
||||
+++ b/tools/qwen/serve.py
|
||||
@@ -663,7 +663,7 @@
|
||||
CUDA_SERVE_ENV = (("EXL3_NC2_ASYNC_STASH", "1"), ("EXL3_STASH_SIDE", "1"), ("EXL3_PF_EMB_UPLOAD", "1"), ("EXL3_CUDA_GRAPH", "1"), ("EXL3_DRAFT_VOCAB", "98304"), ("QWSPEC_THF", "0.3"), ("QWSPEC_THV", "0.1"), ("QWSPEC_THFD", "0.6"), ("QWSPEC_THVD", "0.4"))
|
||||
|
||||
HC_GS_SIDECAR = "hc_gs_sidecar.safetensors"
|
||||
-# The sidecar of the published pack. A file with another hash (wrong pack, damaged download) is not used: plain group rounding, one log line.
|
||||
+# Default checksum for packs without a local calibration.
|
||||
HC_GS_SIDECAR_SHA256 = "473e7547adaad190788634556ce6b32614bdb280ccedadbed8789d39b59dcc8f"
|
||||
|
||||
|
||||
@@ -676,22 +676,41 @@
|
||||
return h.hexdigest()
|
||||
|
||||
|
||||
-def configure_hc_sidecar(model_path: str) -> str:
|
||||
- """Point EXL3_GR_GS_SIDECAR at <model_path>/hc_gs_sidecar.safetensors when group scales are on, the variable is unset and
|
||||
- the file exists. Call before importing exllamav3 (the engine reads it at import). Returns the log line."""
|
||||
+def _configure_hc_sidecar(model_path: str) -> tuple[str, str | None]:
|
||||
+ """Select the mixer codes before engine import. Keep the digest for saved KV state."""
|
||||
+ plain = "hc mixer: group scales, plain rounding"
|
||||
if os.environ.get("EXL3_GR_GS", "0") == "0":
|
||||
- return "hc mixer: per-row int8 scales (EXL3_GR_GS=0)"
|
||||
+ return "hc mixer: per-row int8 scales (EXL3_GR_GS=0)", None
|
||||
env = os.environ.get("EXL3_GR_GS_SIDECAR")
|
||||
if env:
|
||||
- return f"hc mixer: group scales, codes from {env} (EXL3_GR_GS_SIDECAR)"
|
||||
+ try:
|
||||
+ digest = _sha256_file(env)
|
||||
+ except OSError:
|
||||
+ digest = None # The engine already falls back to plain codes for unreadable overrides.
|
||||
+ return f"hc mixer: group scales, codes from {env} (EXL3_GR_GS_SIDECAR)", digest
|
||||
+
|
||||
f = Path(model_path) / HC_GS_SIDECAR
|
||||
- if f.is_file():
|
||||
- got = _sha256_file(f)
|
||||
- if got != HC_GS_SIDECAR_SHA256:
|
||||
- return f"hc mixer: group scales, plain rounding ({f} has sha256 {got[:12]}, expected {HC_GS_SIDECAR_SHA256[:12]}: sidecar not used)"
|
||||
- os.environ["EXL3_GR_GS_SIDECAR"] = str(f)
|
||||
- return f"hc mixer: group scales, codes from {f}"
|
||||
- return f"hc mixer: group scales, plain rounding (no {HC_GS_SIDECAR} in the model directory)"
|
||||
+ if not f.is_file():
|
||||
+ return f"{plain} (no {HC_GS_SIDECAR} in the model directory)", None
|
||||
+ checksum = f.with_suffix(f.suffix + ".sha256")
|
||||
+ try:
|
||||
+ expected = checksum.read_text(encoding="ascii").strip().lower()
|
||||
+ except FileNotFoundError:
|
||||
+ expected = HC_GS_SIDECAR_SHA256
|
||||
+ except (OSError, UnicodeError):
|
||||
+ return f"{plain} (unreadable {checksum})", None
|
||||
+ if not re.fullmatch(r"[0-9a-f]{64}", expected):
|
||||
+ return f"{plain} (invalid SHA-256 in {checksum})", None
|
||||
+ got = _sha256_file(f)
|
||||
+ if got != expected:
|
||||
+ return f"{plain} ({f} has sha256 {got[:12]}, expected {expected[:12]}: sidecar not used)", None
|
||||
+ os.environ["EXL3_GR_GS_SIDECAR"] = str(f)
|
||||
+ return f"hc mixer: group scales, codes from {f}", got
|
||||
+
|
||||
+
|
||||
+def configure_hc_sidecar(model_path: str) -> str:
|
||||
+ """Select mixer codes and return the diagnostic used by the standalone tools."""
|
||||
+ return _configure_hc_sidecar(model_path)[0]
|
||||
|
||||
|
||||
DRAFT2S_IN_PACK = "draft2s.st" # safetensors layout, but not *.safetensors so the weight loader never indexes it
|
||||
@@ -774,7 +793,8 @@
|
||||
continue
|
||||
os.environ.setdefault(k, v)
|
||||
check_latched_env()
|
||||
- print("qserve:", configure_hc_sidecar(model_path), flush=True)
|
||||
+ hc_message, self.hc_sidecar_digest = _configure_hc_sidecar(model_path)
|
||||
+ print("qserve:", hc_message, flush=True)
|
||||
print("qserve:", configure_draft2s(model_path), flush=True)
|
||||
if on_cuda:
|
||||
for k, v in CUDA_SERVE_ENV:
|
||||
@@ -2373,12 +2393,13 @@
|
||||
env = {k: v for k, v in sorted(os.environ.items()) if k.startswith(("EXL3_", "MPW"))}
|
||||
print(f"qserve: effective env {env}", flush=True)
|
||||
from exllamav3.generator.slot_store import SlotStore
|
||||
+ cache_model_id = args.model_id if not engine.hc_sidecar_digest else f"{args.model_id}:hc:{engine.hc_sidecar_digest}"
|
||||
engine.slot_store = SlotStore(engine.generator, [c for c in (engine.cache, engine.draft_cache) if c is not None],
|
||||
- args.slot_save_path, args.model_id)
|
||||
+ args.slot_save_path, cache_model_id)
|
||||
from exllamav3.util.disk_store import env_dir
|
||||
if env_dir():
|
||||
from exllamav3.generator.prefix_disk import PagedPrefixDisk, weights_identity
|
||||
- engine.prefix_disk = PagedPrefixDisk(engine.slot_store, model_id=args.model_id, extra=weights_identity(args.model))
|
||||
+ engine.prefix_disk = PagedPrefixDisk(engine.slot_store, model_id=cache_model_id, extra=weights_identity(args.model))
|
||||
print(f"qserve: prefix disk {engine.prefix_disk.disk.dir} ({len(engine.prefix_disk.pages)} pages, "
|
||||
f"{len(engine.prefix_disk.stashes)} checkpoints, cap {engine.prefix_disk.disk.cap >> 30} GiB)", flush=True)
|
||||
startup_health.stage("warm-up")
|
||||
--- a/tools/qwen/test_serve.py
|
||||
+++ b/tools/qwen/test_serve.py
|
||||
@@ -930,6 +930,31 @@
|
||||
self.assertEqual(serve._partial_tag("abc", ["</think>"]), 0)
|
||||
|
||||
|
||||
+class HCSidecarTests(unittest.TestCase):
|
||||
+ def test_discovery_and_integrity(self):
|
||||
+ import hashlib
|
||||
+ import tempfile
|
||||
+ with tempfile.TemporaryDirectory() as folder, unittest.mock.patch.dict(os.environ, {"EXL3_GR_GS": "1"}, clear=True):
|
||||
+ file = Path(folder) / serve.HC_GS_SIDECAR
|
||||
+ file.write_bytes(b"calibrated codes")
|
||||
+ digest = hashlib.sha256(file.read_bytes()).hexdigest()
|
||||
+ checksum = file.with_suffix(".safetensors.sha256")
|
||||
+ for value in (None, "bad", "0" * 64):
|
||||
+ if value is not None:
|
||||
+ checksum.write_text(value)
|
||||
+ self.assertIsNone(serve._configure_hc_sidecar(folder)[1])
|
||||
+ self.assertNotIn("EXL3_GR_GS_SIDECAR", os.environ)
|
||||
+ checksum.write_text(digest + "\n")
|
||||
+ self.assertEqual(serve._configure_hc_sidecar(folder)[1], digest)
|
||||
+ self.assertEqual(os.environ.pop("EXL3_GR_GS_SIDECAR"), str(file))
|
||||
+ checksum.unlink()
|
||||
+ with unittest.mock.patch.object(serve, "HC_GS_SIDECAR_SHA256", digest):
|
||||
+ self.assertIn(str(file), serve.configure_hc_sidecar(folder))
|
||||
+ self.assertEqual(serve._configure_hc_sidecar(folder)[1], digest) # explicit path
|
||||
+ os.environ["EXL3_GR_GS"] = "0"
|
||||
+ self.assertIsNone(serve._configure_hc_sidecar(folder)[1])
|
||||
+
|
||||
+
|
||||
class ServeEnvDefaultsTest(unittest.TestCase):
|
||||
def test_prefill_set_is_default_and_overridable(self):
|
||||
d = dict(serve.SERVE_ENV)
|
||||
@@ -1,23 +0,0 @@
|
||||
--- a/tools/qwen/serve.py
|
||||
+++ b/tools/qwen/serve.py
|
||||
@@ -826,6 +826,20 @@
|
||||
# first token 81.3 / 84.1 s instead of 81.2 / 81.5 s
|
||||
os.environ.setdefault("EXL3_CIL_DPRIO_CHUNK_S", "0.4")
|
||||
from exllamav3 import Cache, Config, Generator, Job, Model, Tokenizer
|
||||
+ if torch.version.hip and os.environ.get("KYOJIN_HIP_BLOCKING_SYNC") == "1":
|
||||
+ import ctypes
|
||||
+ from exllamav3.util.hip_lib import load_hip_runtime
|
||||
+
|
||||
+ hip = load_hip_runtime()
|
||||
+ flags = ctypes.c_uint()
|
||||
+ status = hip.hipGetDeviceFlags(ctypes.byref(flags))
|
||||
+ if status:
|
||||
+ raise RuntimeError(f"hipGetDeviceFlags failed with status {status}")
|
||||
+ # Replace only hipDeviceScheduleMask (7) with hipDeviceScheduleBlockingSync (4).
|
||||
+ status = hip.hipSetDeviceFlags(ctypes.c_uint((flags.value & ~7) | 4))
|
||||
+ if status:
|
||||
+ raise RuntimeError(f"hipSetDeviceFlags failed with status {status}")
|
||||
+ print("qserve: HIP blocking host synchronization enabled", flush=True)
|
||||
torch.set_grad_enabled(False)
|
||||
self.torch, self.Generator, self.Job = torch, Generator, Job
|
||||
self.sessions = sessions
|
||||
@@ -1,67 +0,0 @@
|
||||
{
|
||||
pkgs,
|
||||
kyojin,
|
||||
exllamav3,
|
||||
jitCheck,
|
||||
cpuCheck,
|
||||
}:
|
||||
let
|
||||
enginePatches = [
|
||||
./prefix-disk-admission.patch
|
||||
./prefix-writer-release.patch
|
||||
./prefix-inflight-pages.patch
|
||||
./prefix-direct-write.patch
|
||||
./prefix-split-segments.patch
|
||||
./warm-reply-grace.patch
|
||||
./expert-direct-read-eof.patch
|
||||
];
|
||||
engine = exllamav3.overrideAttrs (old: {
|
||||
patches = (old.patches or [ ]) ++ enginePatches;
|
||||
});
|
||||
# Both the upstream serve wrappers and the CPU check prepend the wheel to PYTHONPATH.
|
||||
withEngine =
|
||||
script:
|
||||
let
|
||||
updated = builtins.replaceStrings [ "${exllamav3}/" ] [ "${engine}/" ] script;
|
||||
in
|
||||
assert updated != script;
|
||||
updated;
|
||||
in
|
||||
kyojin.overrideAttrs (old: {
|
||||
installPhase = withEngine old.installPhase;
|
||||
# Upstream installs tools directly from $src, bypassing the unpacked tree.
|
||||
src = pkgs.applyPatches {
|
||||
src = old.src;
|
||||
patches = [
|
||||
./short-reply-prefill-grace.patch
|
||||
./hip-blocking-sync.patch
|
||||
./finished-route.patch
|
||||
./hc-sidecar-discovery.patch
|
||||
];
|
||||
};
|
||||
nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ pkgs.makeWrapper ];
|
||||
meta = (old.meta or { }) // {
|
||||
homepage = "https://github.com/Yamz-Labs/kyojin";
|
||||
license = pkgs.lib.licenses.mit;
|
||||
};
|
||||
passthru = (old.passthru or { }) // {
|
||||
category = "AI Inference";
|
||||
tests = (old.passthru.tests or { }) // {
|
||||
jit = jitCheck;
|
||||
cpu = cpuCheck.overrideAttrs (check: {
|
||||
patches = (check.patches or [ ]) ++ enginePatches;
|
||||
checkPhase = withEngine check.checkPhase;
|
||||
});
|
||||
};
|
||||
};
|
||||
postFixup = ''
|
||||
# Fail the build, not the first request, if upstream renames the wrappers.
|
||||
ls "$out"/bin/kyojin-serve-* > /dev/null 2>&1 || {
|
||||
echo "kyojin-cc: no kyojin-serve-* in $out/bin; upstream moved them" >&2
|
||||
exit 1
|
||||
}
|
||||
for b in $out/bin/kyojin-serve-*; do
|
||||
wrapProgram "$b" --set CC ${pkgs.stdenv.cc}/bin/gcc
|
||||
done
|
||||
'';
|
||||
})
|
||||
@@ -1,171 +0,0 @@
|
||||
--- /dev/null
|
||||
+++ b/exllamav3/util/direct_save.py
|
||||
@@ -0,0 +1,76 @@
|
||||
+"""Serialize a large CPU checkpoint through an aligned, bounded O_DIRECT buffer."""
|
||||
+import errno
|
||||
+import mmap
|
||||
+import os
|
||||
+
|
||||
+import torch
|
||||
+
|
||||
+
|
||||
+class _DirectWriter:
|
||||
+ def __init__(self, fd, buffer):
|
||||
+ self.fd = fd
|
||||
+ self.buffer = buffer
|
||||
+ self.used = 0
|
||||
+ self.size = 0
|
||||
+ self.error = None
|
||||
+
|
||||
+ def _send(self, length):
|
||||
+ with memoryview(self.buffer) as block:
|
||||
+ offset = 0
|
||||
+ while offset < length:
|
||||
+ with block[offset:length] as chunk:
|
||||
+ written = os.write(self.fd, chunk)
|
||||
+ if written <= 0 or written % 4096:
|
||||
+ raise OSError(errno.EIO, "invalid short direct write")
|
||||
+ offset += written
|
||||
+
|
||||
+ def write(self, data):
|
||||
+ data = memoryview(data).cast("B")
|
||||
+ length = len(data)
|
||||
+ if self.error is None:
|
||||
+ try:
|
||||
+ while data:
|
||||
+ n = min(len(data), len(self.buffer) - self.used)
|
||||
+ self.buffer[self.used:self.used + n] = data[:n]
|
||||
+ self.used += n
|
||||
+ data = data[n:]
|
||||
+ if self.used == len(self.buffer):
|
||||
+ self._send(self.used)
|
||||
+ self.used = 0
|
||||
+ self.size += length
|
||||
+ except OSError as exc:
|
||||
+ # Let PyTorch finish its ZIP callback before propagating the original errno.
|
||||
+ self.error = OSError(exc.errno, exc.strerror)
|
||||
+ return length
|
||||
+
|
||||
+ def flush(self):
|
||||
+ # torch.save flushes after its ZIP footer. finish() writes the padded tail.
|
||||
+ pass
|
||||
+
|
||||
+ def finish(self):
|
||||
+ if self.error is not None:
|
||||
+ raise self.error
|
||||
+ if self.used:
|
||||
+ padded = (self.used + 4095) & ~4095
|
||||
+ self.buffer[self.used:padded] = bytes(padded - self.used)
|
||||
+ self._send(padded)
|
||||
+ os.ftruncate(self.fd, self.size)
|
||||
+
|
||||
+
|
||||
+def save_segment(payload, tmp):
|
||||
+ """Write torch's normal ZIP payload, falling back on filesystems without compatible direct I/O."""
|
||||
+ if hasattr(os, "O_DIRECT"):
|
||||
+ try:
|
||||
+ fd = os.open(tmp, os.O_WRONLY | os.O_CREAT | os.O_TRUNC | os.O_DIRECT, 0o666)
|
||||
+ try:
|
||||
+ with mmap.mmap(-1, 2 << 20) as buffer:
|
||||
+ writer = _DirectWriter(fd, buffer)
|
||||
+ torch.save(payload, writer)
|
||||
+ writer.finish()
|
||||
+ return
|
||||
+ finally:
|
||||
+ os.close(fd)
|
||||
+ except OSError as exc:
|
||||
+ if exc.errno not in (errno.EINVAL, errno.EOPNOTSUPP, errno.ENOSYS):
|
||||
+ raise
|
||||
+ torch.save(payload, tmp)
|
||||
--- a/exllamav3/util/disk_store.py
|
||||
+++ b/exllamav3/util/disk_store.py
|
||||
@@ -10,6 +10,7 @@
|
||||
EXL3_PREFIX_DISK_DIR root directory; empty = off
|
||||
EXL3_PREFIX_DISK_GB byte cap of the whole root, all models and builds together (default 30)
|
||||
EXL3_PREFIX_DISK_FLOOR_GB free space that must remain on the volume after a write (default 60)
|
||||
+ EXL3_PREFIX_DISK_DIRECT write KV segments of at least 64 MiB with Linux O_DIRECT (default off)
|
||||
EXL3_PREFIX_DISK_MB_MIN write budget per minute (default 8000: the QLC write cliff starts near 10 GB/min)
|
||||
"""
|
||||
from __future__ import annotations
|
||||
@@ -50,6 +51,7 @@
|
||||
e = os.environ.get
|
||||
self.cap = int(float(e("EXL3_PREFIX_DISK_GB", "30") if cap_gb is None else cap_gb) * GIB)
|
||||
self.floor = int(float(e("EXL3_PREFIX_DISK_FLOOR_GB", "60") if floor_gb is None else floor_gb) * GIB)
|
||||
+ self.direct_segments = e("EXL3_PREFIX_DISK_DIRECT", "0") == "1"
|
||||
self.rate = float(e("EXL3_PREFIX_DISK_MB_MIN", "8000") if mb_per_min is None else mb_per_min) * (1 << 20) / 60.0
|
||||
self.stats = {"written": 0, "bytes": 0, "skipped_floor": 0, "skipped_cap": 0, "evicted": 0, "errors": 0, "hits": 0}
|
||||
self._q: queue.Queue = queue.Queue()
|
||||
@@ -195,7 +197,11 @@
|
||||
try:
|
||||
if not self.can_stage(min_bytes):
|
||||
continue
|
||||
- torch.save(payload, tmp)
|
||||
+ if self.direct_segments and min_bytes >= 64 << 20:
|
||||
+ from .direct_save import save_segment
|
||||
+ save_segment(payload, tmp)
|
||||
+ else:
|
||||
+ torch.save(payload, tmp)
|
||||
n = os.path.getsize(tmp)
|
||||
free = shutil.disk_usage(self.dir).free
|
||||
if free - n < self.floor: # live check: other writers share the disk
|
||||
--- a/tests/test_disk_store_cpu.py
|
||||
+++ b/tests/test_disk_store_cpu.py
|
||||
@@ -243,3 +243,58 @@
|
||||
finally:
|
||||
resume.set()
|
||||
pd.disk.close()
|
||||
+
|
||||
+
|
||||
+@pytest.mark.parametrize("case", ["supported", "unsupported", "misaligned", "no_space"])
|
||||
+def test_direct_snapshot_round_trip_and_write_errors(tmp_path, monkeypatch, case):
|
||||
+ import errno
|
||||
+ from exllamav3.util import direct_save
|
||||
+
|
||||
+ if not hasattr(os, "O_DIRECT"):
|
||||
+ pytest.skip("Linux direct I/O")
|
||||
+ path = tmp_path / "segment.pt.tmp"
|
||||
+ open_file = os.open
|
||||
+ def open_direct(name, flags, mode=0o777):
|
||||
+ assert flags & os.O_DIRECT
|
||||
+ if case == "unsupported":
|
||||
+ raise OSError(errno.EOPNOTSUPP, "direct I/O unavailable")
|
||||
+ # Build machines may use a filesystem without direct I/O.
|
||||
+ return open_file(name, flags & ~os.O_DIRECT, mode)
|
||||
+ monkeypatch.setattr(os, "open", open_direct)
|
||||
+ original = os.write
|
||||
+ writes = []
|
||||
+ def check_write(fd, data):
|
||||
+ writes.append(len(data))
|
||||
+ if len(writes) == 2 and case != "supported":
|
||||
+ error = errno.EINVAL if case == "misaligned" else errno.ENOSPC
|
||||
+ raise OSError(error, os.strerror(error))
|
||||
+ return original(fd, data)
|
||||
+ monkeypatch.setattr(os, "write", check_write)
|
||||
+ tensor = torch.arange(700013, dtype=torch.int64)
|
||||
+ if case == "no_space":
|
||||
+ with pytest.raises(OSError) as exc:
|
||||
+ direct_save.save_segment({"x": tensor}, path)
|
||||
+ assert exc.value.errno == errno.ENOSPC
|
||||
+ else:
|
||||
+ direct_save.save_segment({"x": tensor}, path)
|
||||
+ restored = torch.load(path, mmap=True, weights_only=False)["x"]
|
||||
+ assert torch.equal(tensor, restored)
|
||||
+ assert not writes if case == "unsupported" else len(writes) >= 2
|
||||
+ assert all(n % 4096 == 0 for n in writes)
|
||||
+
|
||||
+
|
||||
+@pytest.mark.parametrize("enabled,estimate,expected", [(False, 64 << 20, 0), (True, 63 << 20, 0), (True, 64 << 20, 1)])
|
||||
+def test_direct_write_only_for_large_enabled_segments(tmp_path, monkeypatch, enabled, estimate, expected):
|
||||
+ from exllamav3.util import direct_save
|
||||
+
|
||||
+ monkeypatch.setenv("EXL3_PREFIX_DISK_DIRECT", str(int(enabled)))
|
||||
+ writer = Mock(side_effect=torch.save)
|
||||
+ monkeypatch.setattr(direct_save, "save_segment", writer)
|
||||
+ store = mk(tmp_path, cap_gb=1)
|
||||
+ try:
|
||||
+ store.put("seg", torch.arange(32), {}, min_bytes=estimate)
|
||||
+ store.flush()
|
||||
+ assert torch.equal(torch.arange(32), store.read("seg"))
|
||||
+ assert writer.call_count == expected
|
||||
+ finally:
|
||||
+ store.close()
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user