mirror of
https://github.com/Matir/skel.git
synced 2026-05-25 21:19:09 -07:00
Updates
This commit is contained in:
@@ -8,6 +8,7 @@ uvx = true
|
||||
uv_venv_auto = true
|
||||
|
||||
[tools]
|
||||
age = "latest"
|
||||
uv = "latest"
|
||||
|
||||
[hooks]
|
||||
|
||||
@@ -27,3 +27,6 @@ id_ed25519
|
||||
|
||||
# These files should basically never be committed
|
||||
.env
|
||||
|
||||
# Mise local
|
||||
mise.local.toml
|
||||
|
||||
@@ -87,6 +87,34 @@ export LVM_SUPPRESS_FD_WARNINGS=1
|
||||
# Default disable SSH forwarding in EARTHLY
|
||||
export EARTHLY_SSH_AUTH_SOCK=""
|
||||
|
||||
# Handle SSH_AUTH_SOCK for tmux consistency
|
||||
_SSH_AUTH_LINK="${HOME}/.ssh/ssh_auth_sock"
|
||||
if [ -z "${SSH_AUTH_SOCK:-}" ] || [ ! -S "${SSH_AUTH_SOCK}" ] ; then
|
||||
# Try to find a working GPG agent SSH socket if no agent is set or current is broken
|
||||
if command -v gpgconf >/dev/null 2>&1; then
|
||||
_GPG_SSH_SOCK=$(gpgconf --list-dirs agent-ssh-socket 2>/dev/null)
|
||||
fi
|
||||
# Fallback to common paths if gpgconf fails or isn't present
|
||||
if [ -z "${_GPG_SSH_SOCK}" ] || [ ! -S "${_GPG_SSH_SOCK}" ]; then
|
||||
_GPG_SSH_SOCK="${GNUPGHOME:-$HOME/.gnupg}/S.gpg-agent.ssh"
|
||||
[ -S "$_GPG_SSH_SOCK" ] || _GPG_SSH_SOCK="/run/user/$(id -u)/gnupg/S.gpg-agent.ssh"
|
||||
fi
|
||||
|
||||
if [ -S "${_GPG_SSH_SOCK}" ] ; then
|
||||
export SSH_AUTH_SOCK="$_GPG_SSH_SOCK"
|
||||
fi
|
||||
unset _GPG_SSH_SOCK
|
||||
fi
|
||||
|
||||
# If we have a valid socket but it's not our stable link, sync the link and use it.
|
||||
# This ensures tmux (using the static path) always finds the most recent agent.
|
||||
if [ -S "${SSH_AUTH_SOCK:-}" ] && [ "${SSH_AUTH_SOCK}" != "${_SSH_AUTH_LINK}" ] ; then
|
||||
[ -d "$(dirname "${_SSH_AUTH_LINK}")" ] || mkdir -p "$(dirname "${_SSH_AUTH_LINK}")"
|
||||
ln -sf "${SSH_AUTH_SOCK}" "${_SSH_AUTH_LINK}"
|
||||
export SSH_AUTH_SOCK="${_SSH_AUTH_LINK}"
|
||||
fi
|
||||
unset _SSH_AUTH_LINK
|
||||
|
||||
# Setup XDG-like dirs on MacOS
|
||||
# Based on https://leebyron.com/til/mac-xdg/
|
||||
if [ "$(uname)" = "Darwin" ] ; then
|
||||
|
||||
@@ -8,11 +8,13 @@ REMOTE_LINK="${HOME}/.ssh/ssh_auth_sock"
|
||||
if [ -S "${SSH_AUTH_SOCK}" ] ; then
|
||||
SSH_REMOTE_AUTH_SOCK="${SSH_AUTH_SOCK}"
|
||||
export SSH_REMOTE_AUTH_SOCK
|
||||
if [ "${1:-}" = "force" ] || [ ! -S "${REMOTE_LINK}" ] ; then
|
||||
# Always update the symlink to the latest session's socket.
|
||||
# This ensures that tmux (which uses the static path) always points to a
|
||||
# current agent.
|
||||
mkdir -p "$(dirname "${REMOTE_LINK}")"
|
||||
ln -sf "${SSH_AUTH_SOCK}" "${REMOTE_LINK}"
|
||||
SSH_AUTH_SOCK="${REMOTE_LINK}"
|
||||
export SSH_AUTH_SOCK
|
||||
fi
|
||||
fi
|
||||
|
||||
# if stdin is a tty, don't do the cookie step
|
||||
|
||||
@@ -29,16 +29,7 @@ if grep -q '^enable-ssh-support' "$_gpg_agent_conf" &> /dev/null; then
|
||||
# Load required functions.
|
||||
autoload -Uz add-zsh-hook
|
||||
|
||||
if test -z "$SSH_AUTH_SOCK" ; then
|
||||
SSH_AUTH_SOCK="/run/user/$(id -u)/gnupg/S.gpg-agent.ssh"
|
||||
if test -S "$SSH_AUTH_SOCK" ; then
|
||||
export SSH_AUTH_SOCK
|
||||
else
|
||||
unset SSH_AUTH_SOCK
|
||||
fi
|
||||
fi
|
||||
|
||||
# Updates the GPG-Agent TTY before every command since SSH does not set it.
|
||||
# Updates the GPG-Agent TTY before every command since SSH does not set it.
|
||||
function _gpg-agent-update-tty {
|
||||
gpg-connect-agent UPDATESTARTUPTTY /bye >/dev/null
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user