From c0099e3fc6bb87028ffb6bcf5760df3df81a8181 Mon Sep 17 00:00:00 2001 From: lostbean Date: Thu, 9 Nov 2023 15:15:11 -0300 Subject: [PATCH] And more instructions to setup Nix --- README.md | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index cc1bc27522..842c8e7f1f 100644 --- a/README.md +++ b/README.md @@ -129,20 +129,37 @@ Install the [Nix package manager](https://nixos.org/download). sh <(curl -L https://nixos.org/nix/install) ``` -And to bring the environment up use: +And enable some Nix flags (alternatively you can add `--extra-experimental-features 'nix-command flakes'` every time calling the `nix` command): ```bash -nix --extra-experimental-features 'nix-command flakes' develop +mkdir -p ~/.config/nix +echo "experimental-features = nix-command flakes" >> ~/.config/nix/nix.conf ``` -The `extra-experimental-features` can set globally by adding the following to `~/.config/nix/nix.conf` or `/etc/nix/nix.conf`: -``` -experimental-features = nix-command flakes +And to bring the environment up, just open a new shell terminal, go to the root folder of the repo and run: +```bash +nix develop ``` -One can also use the [`direnv`](https://direnv.net/) (installation via Nix can be found [here](https://github.com/nix-community/nix-direnv#installation)) to automatically load the environment when entering the main folder or using a plugin in your preferred IDE: +This will download all dev deps and setup the environment accordingly. + +You can also use the [`direnv`](https://direnv.net/) to automatically load the environment when entering the main folder or using a plugin in your preferred IDE: - `vscode`: [mkhl.direnv](https://github.com/direnv/direnv-vscode) - `jet brains`: [Direnv integration](https://plugins.jetbrains.com/plugin/15285-direnv-integration) +Direnv can also be easily installed with Nix (or [HomeBrew](https://formulae.brew.sh/formula/direnv) if you prefer): +```bash +nix-env -f '' -iA direnv +``` + +Now you just to add the direnv hook to your shell: +```bash +echo 'eval "$(direnv hook bash)"' >> ~/.bashrc +# or for ZSH +echo 'eval "$(direnv hook zsh)"' >> ~/.zshrc +``` + +Now next time you open a new shell terminal and go to repo's folder you environment will update and load automatically. + Dev Dependencies (Manual install) ----------------