Skip to content

nix support for desktop and relay - #3734

Closed
DanConwayDev wants to merge 7 commits into
block:mainfrom
DanConwayDev:feat/nix-desktop-relay-support
Closed

DanConwayDev wants to merge 7 commits into
block:mainfrom
DanConwayDev:feat/nix-desktop-relay-support

Conversation

@DanConwayDev

Copy link
Copy Markdown

This was largely one-shotted from #3434, which required a few fixes, together with an updated adaptation of #2307. I’m posting it as a draft for anyone who might be interested.

I have used it to deploy Buzz to a NixOS server and run buzz-desktop locally against that relay, including running Codex through codex-acp. This provides some basic x86_64 Linux coverage, but it has not been robustly tested; other platforms and some desktop integrations remain untested.

Summary

Provide unified Nix support for the Buzz desktop app, relay server,
administration CLI, agent sidecars, development shell, and NixOS deployments.

This combines Daniel Toubul’s desktop work in #3434 with an updated adaptation
of thesimplekid’s relay module from #2307.

Problems addressed

  • Build the current checkout using the repository-pinned Rust toolchain.
  • Replace stale and placeholder dependency hashes with verified inputs.
  • Align pnpm fetching with the desktop workspace’s offline build.
  • Include the native Sherpa, GTK, WebKit, audio, OpenSSL, and C++ dependencies.
  • Repair Tauri binary RPATHs so the packaged desktop app starts on NixOS.
  • Package buzz-relay and buzz-admin from the root workspace.
  • Add runnable buzz-relay and buzz-admin flake apps.
  • Provide a hardened NixOS systemd module using the relay’s current settings.
  • Support environment files for credentials without copying secrets into the
    Nix store.
  • Model current S3 addressing, read-replica pool, and bounded-staleness routing
    controls.
  • Add deployment documentation covering PostgreSQL, Redis, S3, TLS,
    migrations, closed relays, health probes, and metrics.
  • Add path-scoped CI covering formatting, evaluation, module checks, and builds.

Flake outputs

  • packages.<system>.buzz-desktop
  • packages.<system>.buzz-sidecars
  • packages.<linux-system>.buzz-relay
  • apps.<linux-system>.buzz-relay
  • apps.<linux-system>.buzz-admin
  • nixosModules.buzz-relay
  • devShells.<system>.default

Validation

The branch has been rebased onto current main, including Buzz Desktop
v0.5.2.

  • nix fmt -- --check ...
  • nix flake show --all-systems
  • nix flake check --print-build-logs
  • Built buzz-desktop, buzz-sidecars, buzz-relay, and buzz-admin
  • Verified the packaged ELF binaries have complete runtime library closures
  • Launched the desktop package under an isolated Xvfb/D-Bus session
  • Started the packaged relay against disposable PostgreSQL, Redis, and MinIO
  • Verified migration 0026
  • Verified path-style S3 git-object conformance
  • Verified readiness, liveness, application health, and Prometheus metrics
  • Verified the packaged buzz-admin CLI
  • Validated the GitHub Actions workflow with actionlint

The full build and runtime tests were performed on x86_64 Linux. ARM64 Linux
and Apple Silicon macOS outputs were evaluated successfully but were not
physically built on this host.

Draft status

This is being opened as a draft to collect feedback from people interested in
using or maintaining Nix support.

In particular, physical build and runtime testing on ARM64 Linux and Apple
Silicon macOS would be useful before marking it ready for review.

Credits

Comment thread .github/workflows/nix.yml Fixed
@DanConwayDev
DanConwayDev force-pushed the feat/nix-desktop-relay-support branch from 9e693dc to bc5d973 Compare July 30, 2026 15:30
@mulatta

mulatta commented Aug 12, 2026

Copy link
Copy Markdown

FYI: i've packaged buzz with nix (nixosModule is planned)

https://github.com/mulatta/buzz.nix

Daniel Toubul and others added 6 commits August 13, 2026 09:29
Signed-off-by: Daniel Toubul <daniel@toubul.eu>
Complete the initial Nix scaffold by addressing the failures found during end-to-end desktop packaging:

- build the current checkout with the repository's pinned Rust toolchain
- replace stale and placeholder hashes with verified platform inputs
- align pnpm fetch and offline install scopes for the desktop workspace
- package Sherpa and sidecars with the required Linux native libraries
- repair Tauri bundle RPATHs so GTK, WebKit, audio, and C++ libraries resolve
- expose explicit desktop, sidecar, and development-shell outputs
- derive the release version from Cargo metadata instead of a tag-time bot

Signed-off-by: DanConwayDev <DanConwayDev@protonmail.com>
- build buzz-relay and buzz-admin from the pinned workspace toolchain
- expose runnable relay/admin apps alongside the desktop and sidecars
- provide a hardened, configurable NixOS systemd module
- track current S3 addressing, read-pool, and replica-routing controls
- check module environment coercion, IPv6 binding, secrets, and firewall wiring
- document NixOS deployment, migrations, storage, TLS, and closed relays
- add path-scoped CI for formatting, evaluation, checks, and package builds

Adapted from the relay module proposed in block#2307.

Co-authored-by: thesimplekid <tsk@thesimplekid.com>

Signed-off-by: DanConwayDev <DanConwayDev@protonmail.com>
Signed-off-by: DanConwayDev <DanConwayDev@protonmail.com>
Signed-off-by: DanConwayDev <DanConwayDev@protonmail.com>
Current main has advanced beyond the original package hashes, sidecar set, relay settings, and desktop version. The old default development shell also inherited the entire desktop closure, making a routine nix develop unexpectedly download roughly a gigabyte of GUI and audio dependencies on a cold Linux store.

Refresh the flake inputs and content-addressed Cargo/pnpm dependency hashes against the current 0.5.11 lockfiles. Package the Kubernetes backend sidecar, supply the current desktop build prerequisite and licensing metadata, remove the retired media-read-auth switch, and expose the bounded shutdown drain jitter. Keep the default shell to the pinned toolchain and just, with the full native desktop environment available explicitly as .#desktop.

The NixOS module remains object-store agnostic and does not install MinIO; migrating the disabled nixos-fi1 test service to a maintained S3 implementation is deliberately outside this repository change. Full local builds are also excluded because the dry run reported a 1.1 GiB cold desktop closure; hosted CI remains the full-build gate.

Validated with Nix formatting, nix flake check --no-build, all-system flake evaluation, package and shell dry runs under max-jobs=1/cores=1, and the root cargo-deny advisory policy.

Signed-off-by: DanConwayDev <DanConwayDev@protonmail.com>
@DanConwayDev
DanConwayDev force-pushed the feat/nix-desktop-relay-support branch from bc5d973 to 1801736 Compare August 13, 2026 08:40
@DanConwayDev

Copy link
Copy Markdown
Author

That looks good. It may be more mature than my version. I've just bumped mine to 0.5.11.

@mulatta

mulatta commented Aug 13, 2026

Copy link
Copy Markdown

Upstream still has #2516 open, it may be worth waiting for maintainer direction before settling on approach.

Feel free to review or borrow from my packaging code as well, so you can reference or use it if helpful. Also happy to help with contribution work if useful.

Buzz-hosted repositories require the Buzz CLI for announcements, the NIP-98 credential helper for authentication, and Git itself for transport. Export each client component plus a combined toolset, and put packaged Git on the Linux desktop runtime PATH.

The relay pre-receive hook is a Bash script that also invokes coreutils and sed. Add those tools to the NixOS module default service PATH and assert the complete hook runtime in the module check so authenticated pushes reach policy evaluation.

Reuse one locked workspace Cargo vendor derivation for the client and desktop sidecars. This assumes the documented Git 2.46-or-newer credential behavior. Deployment and direct nixos-fi1 configuration changes are deliberately excluded.

Validated with nix flake check --no-build; builds of buzz-cli, git-credential-nostr, buzz-git-tools, buzz-desktop, and the NixOS module check; wrapper inspection; and a disposable live announcement/authentication test that reproduced the missing-Bash hook failure.

Signed-off-by: DanConwayDev <DanConwayDev@protonmail.com>
levonk added a commit to levonk/buzz that referenced this pull request Aug 27, 2026
Make buzz-desktop (source build via cargo-tauri + pnpm) the default
desktop package, matching the approach used by other Nix PRs (block#3434,
block#3734). Add buzz-desktop-prebuilt as a faster alternative that wraps
the official release artifacts.

The source build works on all four standard platforms including
aarch64-linux (which has no prebuilt binary). It requires sherpa-onnx
static libraries, sidecar binaries, and the pnpm frontend build.

The prebuilt package remains available for users who want faster
installation and are on a platform with a release binary.

CI updated to build both variants on Linux and Darwin, with longer
timeouts for the source build (90 min vs 10 min for prebuilt).

Signed-off-by: levonk <277861+levonk@users.noreply.github.com>
@DanConwayDev

Copy link
Copy Markdown
Author

Closing this in favour of the community packaging in mulatta/buzz.nix and the Buzz desktop packaging work in nixpkgs.

I’ve switched ngit’s Buzz test fixture from my Nix PR branch to a pinned version of mulatta/buzz.nix, so I no longer need to maintain this separate packaging branch. Thanks for the work on making Buzz available through Nix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants