From 8fd103c90b37ef913577c1696f1c2011b3bfa704 Mon Sep 17 00:00:00 2001 From: Santiago Fraire Date: Sat, 24 Jun 2023 08:22:56 +0200 Subject: [PATCH] docs: add troubleshooting to shell-environemnts --- examples/shell-environments/README.md | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/examples/shell-environments/README.md b/examples/shell-environments/README.md index 5921bab..271c908 100644 --- a/examples/shell-environments/README.md +++ b/examples/shell-environments/README.md @@ -6,7 +6,7 @@ This example shows how to create a shell environment which includes a diverse set of tools: -``` +```sh terraform wget bat @@ -28,4 +28,25 @@ You can have as many shells as you want, in this [flake.nix](./flake.nix), you a ```sh nix develop .#another_env -``` \ No newline at end of file +``` + +## Troubleshooting + +### My shell has changed + +There 2 possible solutions: + +First, using [direnv](https://direnv.net/) to manage your dev environments. See [direnv-guide](https://haskell.flake.page/direnv). This is the recommended approach. + +Second is a simple-unreliable hack, which is adding a `shellHook` to `devShells` + +```nix +devShells.default = pkgs.mkShell { + shellHook = '' + exec $SHELL + ''; +}; +``` + +You might get a lot different issues, use it at your own risk. +