Skip to content

herdr-core, herdr-desktop: init - #581031

Merged
matteo-pacini merged 3 commits into
NixOS:masterfrom
tophcodes:init-herdr
Nov 2, 2026
Merged

matteo-pacini merged 3 commits into
NixOS:masterfrom
tophcodes:init-herdr

Conversation

@tophcodes

@tophcodes tophcodes commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

Adds herdr-core (hc), which runs terminals and coding agents headlessly and keeps them running after you leave, and herdr-desktop (herdr-app), the desktop app on top of it.

This combines my packaging with @Munksgaard's from #580925 and adds Darwin support from @iamppborah. Both are maintainers of the two packages and co-authors of both commits.

Notes for review:

  • No wrapper for herdr-desktop. herdr-core passes the app's environment on to every terminal it starts, so a wrapper's LD_LIBRARY_PATH would leak into every shell. The dlopened libraries go on the RUNPATH instead, like zed-editor.
  • hc machine add downloads instead of copying. Upstream copies its own binary to a machine with the same OS and CPU. A Nix-built hc does not run without its store path present, so every machine gets upstream's statically linked release build of the same version.
  • herdr-desktop patches one settings string, which tells Nix users to update with git. Reported upstream as Settings says a Nix-installed Herdr updates with git herdrdev/herdr-app#136.
  • Darwin: tests are off in both packages. The sandbox gives herdr-desktop's render tests no Metal, and blocks localhost networking and notifyd, which herdr-core's tests need. Ghostty's build calls xcrun, ln, cp and ranlib by absolute path, which the sandbox lacks, so those are substituted.
  • herdr-desktop does not build reproducibly yet. A proc macro in its quickjs-jit dependency emits code in HashMap order. herdr-core builds bit-identical on Linux.

The packages were written with Claude Code (Claude Opus 5.5). I reviewed every change, built both packages and used them on NixOS, including hc machine add against a second NixOS host. I also built both in the sandbox on an Intel Mac against nixos-26.05 and started the app there; @iamppborah built them on aarch64-darwin.

Things done

@nixpkgs-ci nixpkgs-ci Bot added 8.has: package (new) This PR adds a new package 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 9.needs: reviewer This PR currently has no reviewers requested and needs attention. llm-assisted Contributions that include code generation with LLMs 7.no default reviewers This PR targets a package or module with no existing maintainers; roving reviewers, take pity! labels Oct 30, 2026
@tophcodes tophcodes mentioned this pull request Oct 30, 2026
2 of 13 tasks
@tophcodes tophcodes changed the title herdr-core, herdr-app: init herdr-core, herdr-desktop: init Oct 30, 2026
@tophcodes

Copy link
Copy Markdown
Member Author

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 581031
Commit: bc319af85d83be6ed10f37797e2e5cec0863dc70


x86_64-linux

✅ 2 packages built:
  • herdr-core
  • herdr-desktop

@iamppborah

iamppborah commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Hi @tophcodes, the gpui touch bar patch isn't needed to build, and zed-industries/zed#65186 is still unmerged. Maybe drop it for now and add it back once Zed merges it, or report it to herdr-app ?

@iamppborah

Copy link
Copy Markdown
Contributor

@tophcodes I sent the Darwin changes as tophcodes#1, into init-herdr. It has your 4d7cc4a plus:

nixpkgs-review of that branch on aarch64-darwin: herdr-core and herdr-desktop both build.
Once it's in this PR, I'll post a proper nixpkgs-review pr 581031 result for aarch64-darwin here.

@nixpkgs-ci nixpkgs-ci Bot added 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 8.has: maintainer-list (update) This PR changes `maintainers/maintainer-list.nix` and removed 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 8.has: maintainer-list (update) This PR changes `maintainers/maintainer-list.nix` labels Nov 1, 2026
@tophcodes

Copy link
Copy Markdown
Member Author

I agree with the touch bar patch, I'll keep that around locally for my mac but will report it upstream. I pulled your changes into my commits and added you as co-author.

On top of yours I made a few more Darwin tweaks: it now builds in a strict sandbox, the Linux-only build inputs stay off Darwin, and the binary lives inside Herdr.app.

@nixpkgs-ci nixpkgs-ci Bot added the 8.has: maintainer-list (update) This PR changes `maintainers/maintainer-list.nix` label Nov 1, 2026
@iamppborah

Copy link
Copy Markdown
Contributor

Thank you @tophcodes!
I am running the nixpkgs review for aarch64-darwin now and will be posting it here in sometime :)

@iamppborah

Copy link
Copy Markdown
Contributor

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 581031
Commit: fa13b4a99adab23b92750c6e4fc89e86c7bbca22


aarch64-darwin

✅ 2 packages built:
  • herdr-core
  • herdr-desktop

Built with sandbox = true.

@iamppborah

Copy link
Copy Markdown
Contributor

@recutita, could you please review this ?

@matteo-pacini

Copy link
Copy Markdown
Contributor

❌ nixpkgs-review result

Generated using nixpkgs-review-gha (710407f)

Command: nixpkgs-review pr 581031
Commit: fa13b4a99adab23b92750c6e4fc89e86c7bbca22 (subsequent changes)
Merge: b231a4082e5c69dbd3dcbe186f482c138fd47913

Logs: https://github.com/matteo-pacini/nixpkgs-review-gha/actions/runs/41352108777/attempts/1


x86_64-linux

✅ 2 packages built:
  • herdr-core
  • herdr-desktop

aarch64-linux

✅ 2 packages built:
  • herdr-core
  • herdr-desktop

aarch64-darwin (sandbox = true)

❌ 2 packages failed to build:
  • herdr-core
  • herdr-desktop

@iamppborah

iamppborah commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Hi @matteo-pacini, @tophcodes,
I have mentioned all the details in the above PR why the failure occurred for aarch64-darwin here: #581031 (comment).

Could you please take a look at the paradigm that we should follow vs herdr ?
https://github.com/NixOS/nixpkgs/blob/master/pkgs/by-name/he/herdr
It doesn't contain any separate ghostty-deps.nix file.

@recutita

recutita commented Nov 2, 2026 •

Copy link
Copy Markdown
Member

nixpkgs-review result with sandbox

Generated using nixpkgs-review.

Command: nixpkgs-review pr 581031
Commit: fa13b4a99adab23b92750c6e4fc89e86c7bbca22


aarch64-darwin

❌ 1 package failed to build:
  • herdr-desktop
✅ 1 package built:
  • herdr-core

herdr-desktop
Finished cargoInstallPostBuildHook
Finished cargoBuildHook
buildPhase completed in 3 minutes 43 seconds
Running phase: installPhase
@nix { "action": "setPhase", "phase": "installPhase" }
Executing cargoInstallHook
Finished cargoInstallHook
Running phase: fixupPhase
@nix { "action": "setPhase", "phase": "fixupPhase" }
checking for references to /nix/var/nix/builds/nix-49658-276975997/ in /nix/store/p65531w39i28c47r6w3fy8c7cj5940as-herdr-desktop-0.1.10...
patching script interpreter paths in /nix/store/p65531w39i28c47r6w3fy8c7cj5940as-herdr-desktop-0.1.10
stripping (with command strip and flags -S) in /nix/store/p65531w39i28c47r6w3fy8c7cj5940as-herdr-desktop-0.1.10/bin /nix/store/p65531w39i28c47r6w3fy8c7cj5940as-herdr-desktop-0.1.10/Applications
making symlink relative: /nix/store/p65531w39i28c47r6w3fy8c7cj5940as-herdr-desktop-0.1.10/bin/herdr-app
Running phase: installCheckPhase
@nix { "action": "setPhase", "phase": "installCheckPhase" }
Executing versionCheckPhase
Successfully managed to find version 0.1.10 in the output of the command /nix/store/p65531w39i28c47r6w3fy8c7cj5940as-herdr-desktop-0.1.10/bin/herdr-app --version
herdr-app 0.1.10
Finished versionCheckPhase
no Makefile or custom installCheckPhase, doing nothing

@recutita

recutita commented Nov 2, 2026 •

Copy link
Copy Markdown
Member

nixpkgs-review result without sandbox

Generated using nixpkgs-review.

Command: nixpkgs-review pr 581031
Commit: fa13b4a99adab23b92750c6e4fc89e86c7bbca22


aarch64-darwin

✅ 2 packages built:
  • herdr-core
  • herdr-desktop

@recutita

recutita commented Nov 2, 2026

Copy link
Copy Markdown
Member

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 581031
Commit: fa13b4a99adab23b92750c6e4fc89e86c7bbca22


x86_64-linux

✅ 2 packages built:
  • herdr-core
  • herdr-desktop

@recutita recutita left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Works end-to-end on aarch64-darwin, including machine add in herdr-app. @iamppborah IMO keeping zigDeps is better. The sandbox is off by default on Darwin, and herdr already uses zig_0_16.fetchDeps the same way. If we go with tophcodes#2 instead, regenerating ghostty-deps.nix needs to be wired into the updateScript manually.

Comment thread pkgs/by-name/he/herdr-core/package.nix Outdated
Comment on lines +151 to +152
# Upstream CI also skips the timing-bound tests on macOS.
doCheck = !stdenv.hostPlatform.isDarwin;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: upstream CI on macOS runs every test except tests/stitch.rs. Do the others not work under Nix on Darwin? It doesn't affect how the package works, so LGTM either way.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ran them on my Intel Mac against nixos-26.05 with sandbox = true, without tests/stitch.rs and with two test threads, as upstream CI does. 12 of 294 tests failed.

Eight fail because the sandbox blocks TCP on localhost, notifyd and the login shell, or because its build directory makes a socket path too long for macOS. The other four failed on timing, which may be down to my slow machine. The comment above doCheck wrongly put this on upstream CI, it now names the sandbox.

@iamppborah, if you can run them on aarch64-darwin, I'd add __darwinAllowLocalNetworking and skip what still fails there. Otherwise I'd leave them off for this PR.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

checking…

@nixpkgs-ci nixpkgs-ci Bot added 12.approvals: 1 This PR was reviewed and approved by one person. and removed 9.needs: reviewer This PR currently has no reviewers requested and needs attention. labels Nov 2, 2026
@matteo-pacini

Copy link
Copy Markdown
Contributor

@iamppborah Agree with recutita, I'd keep zigDeps. Maybe add a comment above it saying sandboxed Darwin needs --option sandbox false for this one, so the CertificateBundleLoadFailure doesn't confuse anyone.

tophcodes and others added 2 commits November 2, 2026 12:52
Assisted-by: Claude Code (claude-opus-5-5)
Co-authored-by: Philip Munksgaard <[email protected]>
Co-authored-by: Prasurjya Pran Borah <[email protected]>
Assisted-by: Claude Code (claude-opus-5-5)
Co-authored-by: Philip Munksgaard <[email protected]>
Co-authored-by: Prasurjya Pran Borah <[email protected]>
drawbu added a commit to drawbu/dotfiles that referenced this pull request Nov 2, 2026
drawbu added a commit to drawbu/dotfiles that referenced this pull request Nov 2, 2026
drawbu added a commit to drawbu/dotfiles that referenced this pull request Nov 2, 2026

@matteo-pacini matteo-pacini left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, tested on NixOS

@matteo-pacini
matteo-pacini added this pull request to the merge queue Nov 2, 2026
@nixpkgs-ci nixpkgs-ci Bot added 12.approvals: 2 This PR was reviewed and approved by two persons. and removed 12.approvals: 1 This PR was reviewed and approved by one person. labels Nov 2, 2026
Merged via the queue into NixOS:master with commit 76a45d9 Nov 2, 2026
29 checks passed
matteo-pacini added a commit to matteo-pacini/nixos-configs that referenced this pull request Nov 2, 2026
…#437)

herdr-core and herdr-desktop come from nixpkgs-master (NixOS/nixpkgs#581031).
BrightFalls, NightSprings and WorkLaptop get both; headless Nexus gets
herdr-core only, which the app reaches over SSH.

The legacy herdr TUI is removed with everything built for it: its module and
sidebar rows, Nexus's herdr-server unit and the linger it needed, the Claude
statusline wrapper and SessionStart hook, the Codex report hook, the opencode
rows plugin, and the claude-code argv[0] fix that only its agent detection
needed. Activation now deletes the hook files herdr wrote at runtime for
Claude and Codex.

The nixpkgs-master bump moves opencode to 2.2.5, whose node_modules fails its
fixed-output hash (Hydra too), so opencode is held at 2.2.1 through a
rev-pinned nixpkgs-opencode input until the Hydra job is green again.

Co-authored-by: Claude Opus 5.5 <[email protected]>
matteo-pacini added a commit to matteo-pacini/nixos-configs that referenced this pull request Nov 4, 2026
* chore: bump nixpkgs, take herdr from nixos-unstable

herdr-core and herdr-desktop are in nixos-unstable now (`NixOS/nixpkgs#581031`),
so drop the nixpkgs-master override and build herdr-desktop from the same pin.
Both resolve to the same store paths as before.

Bump fallout:
- brightfalls: OVMFFull no longer takes `qemu`; it overrides OVMF, so it
  inherits the vanilla-QEMU override and still hits the cache.
- nexus: card-mod was removed upstream in favour of the UIX custom component.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* chore: drop the custom herdr-desktop patches

herdr-desktop now comes unpatched from nixos-unstable, so HERDR_APP_MODS_PATH
is gone. Nothing in the repo set it; home-manager still installs the mods
into ~/.config/herdr-app/mods.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
lanice added a commit to lanice/nixhome that referenced this pull request Nov 10, 2026
Pin nixpkgs-herdr to the merge commit of NixOS/nixpkgs#581031 until it
reaches nixos-unstable.

Taro's coding account gets herdr-core and linger for hc's user service.
Its bashrc now leaves $?=0 in non-interactive shells: hc logs in with
`ssh <target> exit`, which failed under HM's guard.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

7.no default reviewers This PR targets a package or module with no existing maintainers; roving reviewers, take pity! 8.has: maintainer-list (update) This PR changes `maintainers/maintainer-list.nix` 8.has: package (new) This PR adds a new package 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 12.approvals: 2 This PR was reviewed and approved by two persons. llm-assisted Contributions that include code generation with LLMs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants