mirror of
https://github.com/logos-messaging/nim-sds.git
synced 2026-02-17 12:33:06 +00:00
Nix Build System
The Nix configuration builds nim-sds by calling nimble tasks directly (no Makefile involved).
Architecture
flake.nix — Entry point, defines packages, dev shell, and utility apps
├── nix/default.nix — Build derivation: configures env, runs nim <task> sds.nims
├── nix/shell.nix — Dev shell: sets up NIMBLE_DIR, nimble-links, NIM_LIB_DIR
└── nix/tools.nix — Helper: extracts version from sds.nimble
The Nim compiler comes from nixpkgs (pinned to 24.11, Nim 2.2.4).
All build logic lives in sds.nimble (nimble tasks).
Shell
nix develop '.?submodules=1'
This automatically:
- Runs
scripts/generate_nimble_links.shto set up vendored dependencies - Exports
NIMBLE_DIRandNIM_LIB_DIR - Creates the
sds.nimssymlink
Building
nix build '.?submodules=1#libsds'
nix build '.?submodules=1#libsds-android-arm64'
The ?submodules=1 part is required because vendored dependencies are git submodules.
Utility apps
nix run '.#setup' # Initialize git submodules (run once after clone)
nix run '.#clean' # Garbage-collect the Nix store