-
Notifications
You must be signed in to change notification settings - Fork 0
/
.envrc
45 lines (37 loc) · 1.3 KB
/
.envrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# BEGIN DOTGIT-SYNC BLOCK MANAGED
#!/usr/bin/env bash
# Some function below are overloaded or defined in my own direnv stdlib.
# See: https://framagit.org/rdeville-public/dotfiles/direnv/-/blob/main/lib
# Ensure that PWD is absolute without symlink
PWD="$(pwd -P)"
# Allow users to setup their own envrc files
# NB: If my libs are loaded, this function is overloaded with my own which have
# sha computation security and custom logs
if ! source_env_if_exists ".envrc.local"
then
return 1
fi
# Load .env file if it exists
# NB: If my libs are loaded, this function is overloaded with my own which have
# some custom logs
dotenv_if_exists
# If my libs are loaded, i.e. use_nix_flake and use_devbox functions exists,
# try to use flake.nix devShells
if type use_nix_flake >/dev/null
then
use_nix_flake
fi
# If my libs are loaded, i.e. use_nix_flake and use_devbox functions exists,
# try to use devbox shell throug devbox.json
if type use_devbox >/dev/null
then
# Deactivate devbox warning due to this custom .envrc
DEVBOX_NO_ENVRC_UPDATE=1
use_devbox
fi
# If my direnv config is loaded, DIRENV_LOG_FORMAT is unset by default as I have
# my own bash logger. Export below reset direnv log to see exported environment
# variables
export DIRENV_LOG_FORMAT="[INFO] direnv: %s"
# vim: ft=bash
# END DOTGIT-SYNC BLOCK MANAGED