ma home-manager/direnv: remove custom use_nix

This commit is contained in:
makefu 2020-09-16 22:28:58 +02:00
parent 3a93c400a3
commit 1af471af1e
No known key found for this signature in database
GPG Key ID: 36F7711F3FC0F225

View File

@ -2,31 +2,6 @@
imports = [ ./zsh.nix ];
home-manager.users.makefu = {
programs.direnv = {
stdlib = ''
use_nix() {
local cache=".direnv.$(nixos-version --hash)"
if [[ ! -e "$cache" ]] || \
[[ "$HOME/.direnvrc" -nt "$cache" ]] || \
[[ ".envrc" -nt "$cache" ]] || \
[[ "default.nix" -nt "$cache" ]] || \
[[ "shell.nix" -nt "$cache" ]];
then
local tmp="$(mktemp "$${cache}.tmp-XXXXXXXX")"
trap "rm -rf '$tmp' >/dev/null" EXIT
nix-shell --show-trace "$@" --run 'direnv dump' > "$tmp" && \
mv "$tmp" "$cache"
fi
direnv_load cat "$cache"
if [[ $# = 0 ]]; then
watch_file default.nix
watch_file shell.nix
rm direnv.* 2>/dev/null
fi
}
'';
enableZshIntegration = true;
};
};