From d5edda25bbbdcc7542baff48ff6607cecffd4b89 Mon Sep 17 00:00:00 2001 From: James Kay Date: Thu, 25 Apr 2024 18:00:49 +0100 Subject: [PATCH] `INSTALL.md`: add instructions for using the Nix flake (#1962) --- INSTALL.md | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/INSTALL.md b/INSTALL.md index cdcf43ca7e5..087893befd9 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -52,3 +52,35 @@ Alternatively, we have added experimental Nix support (see `flake.nix`). * `cargo install cargo-sort` * `cargo install cargo-all-features` * `cargo install cargo-machete` + +# Installation using Nix + +Alternatively, this repository contains a Nix flake that can be used +to prepare a reproducible development environment on Nix-enabled +systems. + +Nix runs on Linux systems (including the Windows Subsystem for Linux) +and macOS. + +If you don't have Nix installed, we recommend using the [Determinate +Nix installer](https://github.com/DeterminateSystems/nix-installer) to +easily set up Nix with flakes support. + +Alternatively, you can use [the standard +installer](https://nixos.org/download/) and follow [the +documentation](https://nixos.wiki/wiki/Flakes) to enable flakes +manually. + +Once Nix is installed, from the repository root, simply run + +```shellsession +$ nix develop +``` + +to enter a development environment, and then run `cargo build` or +`cargo install` normally. + +If you have [direnv](https://direnv.net/) installed, there is no need +to manually run `nix develop`: instead, run `direnv allow` to +automatically drop into the build environment when you enter the +project directory.