From 39e8e6e6fa35d8ea78ffcba3901a5e7ebd356a6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20Bur=C4=8Dul?= <39484255+markoburcul@users.noreply.github.com> Date: Tue, 14 Jan 2025 09:21:11 +0100 Subject: [PATCH] nix: update readme (#1064) Include the instructions for running nim-codex as a systemd service on NixOS. Signed-off-by: markoburcul --- nix/README.md | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/nix/README.md b/nix/README.md index 3b827e24e..d1886794e 100644 --- a/nix/README.md +++ b/nix/README.md @@ -32,4 +32,28 @@ nix run 'git+https://github.com/codex-storage/nim-codex?submodules=1#'' ```sh nix flake check ".?submodules=1#" -``` \ No newline at end of file +``` + +## Running Nim-Codex as a service on NixOS + +Include nim-codex flake in your flake inputs: +```nix +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: +```nix +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](https://docs.codex.storage/learn/run#configuration-file). \ No newline at end of file