summaryrefslogtreecommitdiffstats
path: root/makefu/2configs/home-manager/cli.nix
diff options
context:
space:
mode:
authorlassulus <lassulus@lassul.us>2019-01-03 23:15:19 +0100
committerlassulus <lassulus@lassul.us>2019-01-03 23:15:19 +0100
commit58886abed9f24c2447e41d37c27e7add023fa621 (patch)
tree4e29ee6fad1fc0450a040ce57d9841e78c666454 /makefu/2configs/home-manager/cli.nix
parent7176d12ff89a2637f8ca0f828c4f05a6543885d1 (diff)
parent6044ffe3a53ab7745f413847ffe87fbf7a4d11f8 (diff)
Merge remote-tracking branch 'gum/master'
Diffstat (limited to 'makefu/2configs/home-manager/cli.nix')
-rw-r--r--makefu/2configs/home-manager/cli.nix30
1 files changed, 29 insertions, 1 deletions
diff --git a/makefu/2configs/home-manager/cli.nix b/makefu/2configs/home-manager/cli.nix
index 64aa03bd7..6b5d26111 100644
--- a/makefu/2configs/home-manager/cli.nix
+++ b/makefu/2configs/home-manager/cli.nix
@@ -1,4 +1,5 @@
{pkgs, ... }: {
+ imports = [ ./zsh.nix ];
home-manager.users.makefu = {
services.gpg-agent = {
enable = true;
@@ -9,7 +10,34 @@
enableSshSupport = true;
enableScDaemon = true;
};
- programs.fzf.enable = true; # alt-c
+ 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;
+ };
};
services.udev.packages = [
pkgs.libu2f-host