From 0c9f513e8b5ae330af281c34b67728c4711ec7c6 Mon Sep 17 00:00:00 2001 From: Philipp Jungkamp Date: Thu, 1 Jun 2023 13:36:11 +0200 Subject: [PATCH] packaging-nix: add direnv support using the nix flake 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 --- .envrc | 7 +++++++ .gitignore | 1 + 2 files changed, 8 insertions(+) create mode 100644 .envrc diff --git a/.envrc b/.envrc new file mode 100644 index 000000000..621e974a8 --- /dev/null +++ b/.envrc @@ -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 diff --git a/.gitignore b/.gitignore index 3f6211e50..38f0645ae 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ .cproject .settings/ .vscode/ +.direnv/ *.egg-info/