From d8754f6e52add553f3d0e847f092fc0243b1cafc Mon Sep 17 00:00:00 2001 From: metame Date: Wed, 24 Apr 2024 18:32:13 -0400 Subject: [PATCH] docs(nix): Add nix section to contrib guide (#77) --- CONTRIBUTING.md | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6ec29a2..f1e45b6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -13,6 +13,8 @@ welcomed! This includes: ### Installing from Sources +#### Opam + To install Riot from sources, make sure to include all its dependencies: ```sh @@ -30,12 +32,36 @@ You can run builds with: ; dune build ``` -You can run all tests with +You can run all tests with: ```sh ; dune test ``` +#### Nix + +The only requirement is that you have nix installed with flakes enabled. + +To build the project you can run: + +```sh +; nix build +``` + +To enter a dev shell with all deps, utop, lsp, and dune installed, simply run: + +```sh +; nix develop +``` + +Or if you're using direnv: + +```sh +; echo 'use flake' >> .envrc && direnv allow +``` + +An example repo for creating new projects using riot and nix intended for those new to nix can be found [here](https://github.com/metame/nix_riot_example). + ### Adding tests If you want to add a test, you can do so by creating a new OCaml file in the