From d753637e35238c658ba4f2a3da82e88872161091 Mon Sep 17 00:00:00 2001 From: sudoforge Date: Wed, 7 May 2025 17:18:27 -0700 Subject: [PATCH] doc: clarify testing activation of the dev shell (#1395) This change adds a missing step to the contributor onboarding documentation (//:CONTRIBUTING.md): testing that the user has successfully activated the development shell. This is a useful step for users who are new to nix, and was referenced in 4.1. Change-Id: Iea78c5a3a54e62bc8cca8803270db8d7b7f2c872 --- CONTRIBUTING.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 48125d442fe31cab1e3316f3511fffb3ca7854de..a52bb31b67174b6419e1b1db55990d07755bcdd9 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -13,6 +13,7 @@ getting started as a contributor to this project. - [3.0 | Install and configure `direnv`](#30--install-and-configure-direnv) - [4.0 | Post-installation tasks](#40--post-installation-tasks) - [4.1 | Open a new shell](#41--open-a-new-shell) + - [4.2 | Test the development shell](#42--test-the-development-shell) - [Useful development commands](#useful-development-commands) - [Submitting changes](#submitting-changes) @@ -148,7 +149,7 @@ nix run nixpkgs\#dasel -- -r toml -f ~/.config/direnv/direnv.toml \ put -t bool -v true ".global.hide_env_diff" -Automatically activate the development shell +Configure automatic activation of the development shell _This is optional, but strongly recommended._ @@ -213,6 +214,19 @@ It is recommended to do this and complete the test (described below) prior to closing the shell you ran the installation script in, just in case you run into issues and need to refer to any output it provided. +### 4.2 | Test the development shell + +To test that the development shell is active, you will need to move to the +repository's directory. If you installed and properly configured `direnv` for +automatic activation, the shell should activate upon changing directories. + +``` +{ test -n "$IN_NIX_SHELL" && echo "ACTIVE"; } || echo "INACTIVE" +``` + +If you have activated the development shell, you will see `ACTIVE` printed to +the console. If you have not, you will see `INACTIVE` printed to the console. + ______________________________________________________________________ ## Useful development commands