Skip to content

Commit d753637

Browse files
authored
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
1 parent 96c7a11 commit d753637

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

CONTRIBUTING.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ getting started as a contributor to this project.
1313
- [3.0 | Install and configure `direnv`](#30--install-and-configure-direnv)
1414
- [4.0 | Post-installation tasks](#40--post-installation-tasks)
1515
- [4.1 | Open a new shell](#41--open-a-new-shell)
16+
- [4.2 | Test the development shell](#42--test-the-development-shell)
1617
- [Useful development commands](#useful-development-commands)
1718
- [Submitting changes](#submitting-changes)
1819

@@ -148,7 +149,7 @@ nix run nixpkgs\#dasel -- -r toml -f ~/.config/direnv/direnv.toml \
148149
put -t bool -v true ".global.hide_env_diff"
149150
</pre>
150151

151-
<strong>Automatically activate the development shell</strong>
152+
<strong>Configure automatic activation of the development shell</strong>
152153

153154
_This is optional, but strongly recommended._
154155

@@ -213,6 +214,19 @@ It is recommended to do this and complete the test (described below) prior to
213214
closing the shell you ran the installation script in, just in case you run into
214215
issues and need to refer to any output it provided.
215216

217+
### 4.2 | Test the development shell<a name="42--test-the-development-shell"></a>
218+
219+
To test that the development shell is active, you will need to move to the
220+
repository's directory. If you installed and properly configured `direnv` for
221+
automatic activation, the shell should activate upon changing directories.
222+
223+
```
224+
{ test -n "$IN_NIX_SHELL" && echo "ACTIVE"; } || echo "INACTIVE"
225+
```
226+
227+
If you have activated the development shell, you will see `ACTIVE` printed to
228+
the console. If you have not, you will see `INACTIVE` printed to the console.
229+
216230
______________________________________________________________________
217231

218232
## Useful development commands<a name="useful-development-commands"></a>

0 commit comments

Comments
 (0)