diff --git a/gpg-agent.conf b/gpg-agent-linux.conf similarity index 100% rename from gpg-agent.conf rename to gpg-agent-linux.conf diff --git a/gpg-agent-macos.conf b/gpg-agent-macos.conf new file mode 100644 index 0000000..3925b8f --- /dev/null +++ b/gpg-agent-macos.conf @@ -0,0 +1,8 @@ +pinentry-program /opt/homebrew/bin/pinentry-mac +enable-ssh-support +default-cache-ttl-ssh 28800 +max-cache-ttl-ssh 43200 +debug-level advanced +log-file /var/log/gpg-agent.log +default-cache-ttl 600 +max-cache-ttl 7200 diff --git a/install.conf.yaml b/install.conf.yaml index 9c80699..5a8798d 100644 --- a/install.conf.yaml +++ b/install.conf.yaml @@ -6,10 +6,6 @@ path: gitconfig ~/.vimrc: vimrc ~/.zshrc: zshrc - ~/.gnupg/gpg-agent.conf: - force: true - create: true - path: gpg-agent.conf ~/.config/sway/config: force: true create: true @@ -17,3 +13,21 @@ +# gpg-agent.conf has no `include` directive, and pinentry-program requires a +# literal absolute path (no ~ or $HOME expansion), so a single shared file +# cannot work across platforms. Two variants, selected by uname. +# These are separate `link:` blocks on purpose: both map the same destination, +# which would collide as a duplicate key inside one block. +- link: + ~/.gnupg/gpg-agent.conf: + if: '[ "$(uname -s)" = "Darwin" ]' + force: true + create: true + path: gpg-agent-macos.conf + +- link: + ~/.gnupg/gpg-agent.conf: + if: '[ "$(uname -s)" != "Darwin" ]' + force: true + create: true + path: gpg-agent-linux.conf