-
Notifications
You must be signed in to change notification settings - Fork 5
/
.envrc
23 lines (20 loc) · 897 Bytes
/
.envrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash
# Add possibility to run a custom envrc that completely overrides the behavior of this envrc.
CUSTOM_ENVRC=.customenvrc
if [ -f "$CUSTOM_ENVRC" ]; then
echo "Using .customenvrc file"
source_env $CUSTOM_ENVRC
else
# Decrease logging output
# shellcheck disable=SC2034 # unused variable is still read by direnv.
DIRENV_LOG_FORMAT=
# Install nix-direnv, which has an improved implementation of `use nix` that
# caches the Nix environment. Note that this URL is cached locally, so it
# doesn't fetch the script every time.
if ! has nix_direnv_version || ! nix_direnv_version 2.2.1; then
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/2.2.1/direnvrc" "sha256-zelF0vLbEl5uaqrfIzbgNzJWGmLzCmYAkInj/LNxvKs="
fi
nix_direnv_watch_file nix/sources.json nix/haskell-dependencies.nix
dotenv
use nix default.nix --argstr environment shell
fi