From a39a71e852aaa8e619c3d71ad90d3d53bbaf835a Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 16 Dec 2015 11:40:48 +0100 Subject: [PATCH] m 2 zsh-user: load gpg-agent, obsoletes oh-my-zsh ssh plugin --- 2configs/zsh-user.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/2configs/zsh-user.nix b/2configs/zsh-user.nix index 266ce25..1b17624 100644 --- a/2configs/zsh-user.nix +++ b/2configs/zsh-user.nix @@ -22,6 +22,16 @@ in autoload -U compinit && compinit zstyle ':completion:*' menu select + + # load gpg-agent + envfile="$HOME/.gnupg/gpg-agent.env" + if [ -e "$envfile" ] && kill -0 $(grep GPG_AGENT_INFO "$envfile" | cut -d: -f 2) 2>/dev/null; then + eval "$(cat "$envfile")" + else + eval "$(${pkgs.gnupg}/bin/gpg-agent --daemon --enable-ssh-support --write-env-file "$envfile")" + fi + export GPG_AGENT_INFO + export SSH_AUTH_SOCK ''; promptInit = ''