A collection of Nostr tools to be used with the Nix package manager.
Be the easiest, fastest, and free-est way to use Nostr tools.
- Modules for relays: provide canonical module implementations so that users can just pull in a relay to their NixOS config, declare its settings, and throw it in the cloud.
- Play nice with nix-bitcoin: should just work by adding to, or combining with, a nix-bitcoin config. Think how alby-hub can use a LN node, or NWC.
- https://nostrpkgs.cachix.org . A Cache for binaries: provide a cache for users to leverage prebuilt binaries of theses tools, a la cache.nixos.org.
- An auto-update bot, like nixpkgs-update.
- A terminal UI for searching packages or configuring modules (module configs are forms, basically).
You can think of this repository as a collection which contains build recipes for packages. It aims to provide these recipes for all major architectures, irrespective of a project's programming language or build system.
For example, if you want to build nak on your local machine, you could do:
nix build github:jurraca/nostrpkgs#nak
Nix can resolve the GitHub URL, find this repo, and find the nak package within the flake.nix by addressing it with a #. This will create a build in your current directory under result/bin/nak.
You could also just run it without creating a userspace reference to the build with nix run:
nix run github:jurraca/nostrpkgs#nak --help
You can pass arguments to it like you usually would, in this case print the help text.
A binary cache is available serving these packages at https://nostrpkgs.cachix.org. See CACHE.md.
The modules dir contains module definitions you can pull in to your Nix config.
The flake also exposes an options output which will print the available options for a module. Run: nix eval --json .#options.{module_name} for a given module_name. Very handy for agents to implement a module.
Please contribute packages via PRs or request packages you would like to see included via Issues.
When contributing, please follow Nixpkgs commit conventions.
Some pointers/warnings:
- This is for tools, not libraries.
- It's intended primarily for CLI and desktop, not mobile, but that may change!
- Aim to package projects that are actively maintained.
- Some languages are far easier to package than others: Go, Rust, Elixir.
- Think about the future generations and avoid JavaScript if you can help it.
- Python remains the gnarliest language to package with Nix.