Jakub Sokołowski e375223500
fix: nix /tmp permission errors on MacOS
Because on MacOS Nix does not have proper filesystem namespacing like on
linux the /tmp filesystem is the real /tmp on the machine.

This can cause permission issues when different Nix build users creat it:

> cannot create directory: /tmp/nim/koch_d

Signed-off-by: Jakub Sokołowski <jakub@status.im>
2026-02-13 12:28:50 +01:00
..
2026-01-12 12:23:32 +00:00
2025-01-21 16:45:33 +01:00
2026-01-12 12:23:32 +00:00
2026-01-12 12:23:32 +00:00
2026-01-12 12:23:32 +00:00

Usage

Shell

A development shell can be started using:

nix develop '.?submodules=1#'

Building

To build a Logos Storage 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/logos-storage/logos-storage-nim?submodules=1#'

To build the C bindings you can use:

nix build ".?submodules=1#libstorage"

Running

nix run 'git+https://github.com/logos-storage/logos-storage-nim?submodules=1#''

Testing

nix flake check ".?submodules=1#"

Running Logos Storage as a service on NixOS

Include logos-storage-nim flake in your flake inputs:

inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11";
    logos-storage-nim-flake.url = "git+https://github.com/logos-storage/logos-storage-nim?submodules=1#";
};

To configure the service, you can use the following example:

services.logos-storage-nim = {
   enable = true;
   settings = {
       data-dir = "/var/lib/storage-test";
   };
};

The settings attribute set corresponds directly to the layout of the TOML configuration file used by logos-storage-nim. 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: logos-storage-nim configuration file.