mirror of
https://github.com/logos-messaging/nim-sds.git
synced 2026-02-16 20:13:23 +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 and dev shell
├── 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 nimbusBuildSystem flake input is used only for its pinned Nim compiler.
All build logic lives in sds.nimble (nimble tasks).
Shell
A development shell can be started using:
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.
For more details see: https://github.com/NixOS/nix/issues/4423
Testing
nix flake check '.?submodules=1'
Or inside the dev shell:
nimble test