Skip to content

Added Nix Support - #176

Open
nerd2ninja wants to merge 2 commits into
zig-nostr:mainfrom
nerd2ninja:main
Open

nerd2ninja wants to merge 2 commits into
zig-nostr:mainfrom
nerd2ninja:main

Conversation

@nerd2ninja

Copy link
Copy Markdown

The nix package manager is available for install on MacOS, Linux, and WSL (for windows users).

See: https://nixos.org/download/ for information on how to install the nix package manager

From within the project directory root, run:
nix profile add .

And then from your teminal/console/command line, simply run: plaza

The nix package manager is available for install on MacOS, Linux, and WSL (for windows users).

See: https://nixos.org/download/ for information on how to install the nix package manager

From within the project directory root, run:
nix profile add .

And then from your teminal/console/command line, simply run:
plaza
@sepehr-safari

Copy link
Copy Markdown
Contributor

Thank you for this, and sorry it sat so long. It is the first outside contribution the project has had, and it was clearly not a drive-by: the zon2nix wiring and the --system cache trick are exactly right.

A fair amount has moved since you opened it, so the pinned set no longer matches the tree. build.zig.zon is down to two dependencies:

  • nostr went from 0.3.8 to v0.12.0
  • native_sdk moved off my fork to vercel-labs/native at 8d0da34e
  • zg is gone entirely
  • lmdb and secp256k1 are no longer direct dependencies. They are vendored inside nostr and compiled from source by the Zig toolchain

So deps.nix wants regenerating with zon2nix against current main.

Two things I would change beyond the regenerate:

The derivation pins its own source. src = fetchFromGitHub { rev = "v0.2.7" } means nix profile add . from a checkout builds v0.2.7 rather than the checkout you are standing in. Current is v0.12.1. If the flow in your description is what you intended, src = self is closer to it.

buildInputs is short one library. Building on Linux needs webkitgtk 6.0 alongside gtk4. The README's apt line is libgtk-4-dev libwebkitgtk-6.0-dev, and the build wants both.

One thing worth saying plainly so it does not waste your evening: off macOS the toolkit renders through a software rasteriser with no platform text provider, so a Linux build runs but text is CPU-rendered and emoji come out as blank boxes. That is why there is no Linux release yet, and it is upstream work rather than something this flake can fix. The build itself is real and passes the full suite in CI on every change, so a flake is genuinely useful for people who want to build it. I just do not want you surprised by how it looks.

If you would rather not carry the rebase, say so and I will regenerate it against main with your commits kept. Either way I would like to get it covered in CI once it lands, so it stops rotting the next time the dependency set moves.

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.

2 participants