- Zig 99.7%
- Nix 0.3%
| lib | ||
| .envrc | ||
| .gitignore | ||
| build.zig | ||
| build.zig.zon | ||
| flake.lock | ||
| flake.nix | ||
| LICENSE | ||
| README.md | ||
| treefmt.nix | ||
sigil-api
The protocol contract of Sigil.
Sigil deploys a static site from a Nix flake. It publishes the site as a Nostr nsite. The files are content addressed blobs on Blossom servers, and the manifest is a signed Nostr event. This package holds the code that reads and writes those formats.
zig build exposes two modules. They are named sigil and sigil-nix.
The sigil module
The protocol contract. Root lib/sigil.zig.
crypto, the Schnorr signatures, NIP-44, bech32, base36, and UUIDnostr, the events, the relay messages, and the relay clientnet, the WebSocket clientsigner, the memory signer and the NIP-46 remote signermanifest, the nsite manifestblossom, the Blossom client and the BUD-11 authorization eventconfig, the configuration documentforge, the forge listdiagnostic, the report that states what happened, why, and what to do next
The sigil-nix module
The nix command line path. Root lib/sigil-nix.zig.
The module turns a flake reference into a store path. It starts the nix
program as a child process, and it links nothing. Two packages use it. The
sigil command line program uses it for a local flake build, and the Sigil
service uses it for the fallback of SIGIL.md section 5.1. A shared package holds
what both sides share.
Zero dependencies
build.zig.zon names no dependency. Each module uses the Zig standard library
and nothing else. Neither one links a C library, so zig build alone builds
them for any target.
That rule is the reason that the sigil command line program stays statically
linked. Do not add a dependency here. Code that needs one belongs in the package
that needs it.
sigil-eval is one such case. It uses the fix evaluator, which links libcurl
and libgit2. That module stays in the Sigil service repository, and it must not
come here.
Use
Add this package to build.zig.zon, then read the modules in build.zig:
const sigil_api = b.dependency("sigil_api", .{ .target = target, .optimize = optimize });
const sigil_mod = sigil_api.module("sigil");
const nix_mod = sigil_api.module("sigil-nix");
License
Apache License 2.0. Read LICENSE.