diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2020-10-30 11:36:24 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-30 11:36:24 +0100 |
commit | a3a22bd80478dd2827e8617e682084523684200b (patch) | |
tree | 244c3e34b7a48ceaec78c9a70c95601494f96f18 /doc/manual/src/command-ref | |
parent | 7f56cf67bac3731ed8e217170eb548bf0fd2cfcb (diff) | |
parent | d4c5d8d32a4bc5b3eaa63add23dca9d755dc5a74 (diff) |
Merge pull request #4202 from hercules-ci/nix-shell-doc
Nix shell doc
Diffstat (limited to 'doc/manual/src/command-ref')
-rw-r--r-- | doc/manual/src/command-ref/nix-shell.md | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/doc/manual/src/command-ref/nix-shell.md b/doc/manual/src/command-ref/nix-shell.md index d1266930e..88b675e71 100644 --- a/doc/manual/src/command-ref/nix-shell.md +++ b/doc/manual/src/command-ref/nix-shell.md @@ -32,7 +32,7 @@ URL of a tarball that will be downloaded and unpacked to a temporary location. The tarball must include a single top-level directory containing at least a file named `default.nix`. -If the derivation defines the variable `shellHook`, it will be evaluated +If the derivation defines the variable `shellHook`, it will be run after `$stdenv/setup` has been sourced. Since this hook is not executed by regular Nix builds, it allows you to perform initialisation specific to `nix-shell`. For example, the derivation attribute @@ -41,10 +41,12 @@ to `nix-shell`. For example, the derivation attribute shellHook = '' echo "Hello shell" + export SOME_API_TOKEN="$(cat ~/.config/some-app/api-token)" ''; ``` -will cause `nix-shell` to print `Hello shell`. +will cause `nix-shell` to print `Hello shell` and set the `SOME_API_TOKEN` +environment variable to a user-configured value. # Options |