nix: allow dev setup via direnv

This commit is contained in:
Malte Poll 2024-01-05 13:21:33 +01:00
parent a23e838a01
commit 362d07fc52
4 changed files with 20 additions and 6 deletions

1
.envrc Normal file
View File

@ -0,0 +1 @@
use flake

3
.gitignore vendored
View File

@ -73,3 +73,6 @@ s3proxy-ca.crt
# Lychee link checker
.lycheecache
# direnv
.direnv

View File

@ -25,6 +25,7 @@ readarray -t <<< "${scriptsStr}"
scripts=("${MAPFILE[@]}")
excludeDirs=(
".direnv"
"internal/constellation/helm/charts/cilium"
"build"
"docs/node_modules"

View File

@ -15,13 +15,22 @@ Prerequisites:
### Linux
* If you don't want to perform any setup, you can get a shell with Bazel and all required dependencies by running:
If you don't want to perform any setup, you can get a shell with Bazel and all required dependencies by running:
```sh
# better would be: nix develop -i
# but this doesn't play nice with bashrc, colored output and non-hermetic tools
nix develop
```
```sh
# better would be: nix develop -i
# but this doesn't play nice with bashrc, colored output and non-hermetic tools
nix develop
```
Or activate [direnv](https://direnv.net/) to automatically enter the nix shell.
It is recommended to use [nix-direnv](https://github.com/nix-community/nix-direnv).
If your system ships outdated bash, [install direnv](https://direnv.net/docs/installation.html) via package manager.
Additionally, you may want to add the [vscode extension](https://github.com/direnv/direnv-vscode).
```sh
direnv allow
```
### Mac