Skip to content

Commit d2131ce

Browse files
committed
devshell: support direnv
1 parent d999b23 commit d2131ce

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

.envrc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# shellcheck shell=bash
2+
if has nix; then
3+
# Are flake supported and enabled?
4+
if nix show-config | grep experimental-features | grep -q flakes; then
5+
# Do we have nix-direnv?
6+
if ! has nix_direnv_version || ! nix_direnv_version 3.0.4; then
7+
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/3.0.4/direnvrc" "sha256-gMHkKyEOq/T0XmHKgz+pN+fUQC/1EKPAuOtYM95lLnU="
8+
fi
9+
10+
use flake
11+
else
12+
use nix
13+
fi
14+
fi

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@ __pycache__
55
.pytest_cache
66
.mypy_cache
77
.ruff_cache
8+
9+
.direnv

treefmt.nix

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
global.excludes = [
6969
"*.patch"
7070
"*.json"
71+
".direnv/**"
7172
"modules/apps/updater-sepolicy/**"
7273
"docs/**"
7374
"LICENSES/**"
@@ -89,6 +90,7 @@
8990

9091
formatter = {
9192
shellcheck.includes = lib.mkForce [
93+
".envrc"
9294
"flavors/**/*.sh"
9395
"modules/pixel/update.sh"
9496
"scripts/patchelf-prefix.sh"

0 commit comments

Comments
 (0)