Skip to content

Commit

Permalink
packaging-nix: add direnv support using the nix flake
Browse files Browse the repository at this point in the history
Add an `.envrc` file and add the `.direnv` directory to `.gitignore`.
`direnv` will check whether `nix` is available and `flakes` are enabled
before trying to load the environment from `packaging/nix`.

Using flakes from the `direnv` stdlib requires `direnv 2.30.0` or later.

Signed-off-by: Philipp Jungkamp <[email protected]>
  • Loading branch information
pjungkamp committed Jun 1, 2023
1 parent 6a07f6f commit 0c9f513
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
if direnv_version "2.30.0" \
&& has nix \
&& nix show-config experimental-features 2>/dev/null | grep -wqF flakes
then
watch_file ./packaging/nix/*.nix
use flake ./packaging/nix
fi
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
.cproject
.settings/
.vscode/
.direnv/

*.egg-info/

Expand Down

0 comments on commit 0c9f513

Please sign in to comment.