mirror of
https://github.com/codex-storage/nim-codex.git
synced 2025-01-27 05:05:29 +00:00
d114e6e942
Using nimbus build system since the codex now uses version of Nim >2. Tested with nim versions(>2) in nixpkgs but none of them work thus the removal of USE_SYSTEM_NIM and its logic. Signed-off-by: markoburcul <marko@status.im>
Usage
Shell
A development shell can be started using:
nix develop '.?submodules=1#'
Building
To build a Codex you can use:
nix build '.?submodules=1#default'
The ?submodules=1
part should eventually not be necessary.
For more details see:
https://github.com/NixOS/nix/issues/4423
It can be also done without even cloning the repo:
nix build 'git+https://github.com/codex-storage/nim-codex?submodules=1#'
Running
nix run 'git+https://github.com/codex-storage/nim-codex?submodules=1#''
Testing
nix flake check ".?submodules=1#"
Running Nim-Codex as a service on NixOS
Include nim-codex flake in your flake inputs:
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11";
nim-codex-flake.url = "git+https://github.com/codex-storage/nim-codex?submodules=1#";
};
To configure the service, you can use the following example:
services.nim-codex = {
enable = true;
settings = {
data-dir = "/var/lib/codex-test";
};
};
The settings attribute set corresponds directly to the layout of the TOML configuration file used by nim-codex. Each option follows the same naming convention as the CLI flags, but with the -- prefix removed. For more details on the TOML file structure and options, refer to the official documentation: nim-codex configuration file.