❄️ Dotfiles for our NixOS system configuration.

chore: add direnv import

Chloe 62c686d6 65572055

Changed files
+24
home
chloe
programs
+1
home/chloe/programs/cli/default.nix
···
imports = [
./bat.nix
./btop.nix
./eza.nix
./gh.nix
./git.nix
···
imports = [
./bat.nix
./btop.nix
+
./direnv.nix
./eza.nix
./gh.nix
./git.nix
+23
home/chloe/programs/cli/direnv.nix
···
···
+
{
+
programs.direnv = {
+
enable = true;
+
silent = true;
+
+
# faster, persistent implementation of use_nix and use_flake
+
nix-direnv.enable = true;
+
+
# store direnv in cache and not per project
+
# <https://github.com/direnv/direnv/wiki/Customizing-cache-location#hashed-directories>
+
stdlib = ''
+
: ''${XDG_CACHE_HOME:=$HOME/.cache}
+
declare -A direnv_layout_dirs
+
+
direnv_layout_dir() {
+
echo "''${direnv_layout_dirs[$PWD]:=$(
+
echo -n "$XDG_CACHE_HOME"/direnv/layouts/
+
echo -n "$PWD" | sha1sum | cut -d ' ' -f 1
+
)}"
+
}
+
'';
+
};
+
}