diff options
author | tv <tv@krebsco.de> | 2019-01-16 11:20:14 +0100 |
---|---|---|
committer | tv <tv@krebsco.de> | 2019-01-16 11:20:14 +0100 |
commit | 6cef97deb3a96731a4737f05513e2e5855f60685 (patch) | |
tree | c21b0eef944b80adecb7d95aa79ba4a475ef6dd1 /makefu/2configs/home-manager/cli.nix | |
parent | 2d2ab95f0707209c4c248d43cb57877a50a37991 (diff) | |
parent | a1d9c22bbd8eff9198f378e9007ddf4cb9ee2e5c (diff) |
Merge remote-tracking branch 'prism/master'
Diffstat (limited to 'makefu/2configs/home-manager/cli.nix')
-rw-r--r-- | makefu/2configs/home-manager/cli.nix | 30 |
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 |