Improve SSH life on Linux with Keychain and Tmux agent forwarding, now

resembles Mac experience.
This commit is contained in:
Martin Larsson 2025-07-15 13:40:21 +02:00
parent ae37074ce4
commit 098fc2c41e
2 changed files with 15 additions and 3 deletions

View file

@ -34,6 +34,16 @@ in
./common/firefox.nix ./common/firefox.nix
]; ];
programs = {
zsh.initContent = ''
# Just ensure SSH agent is available, don't preload keys
if [ ! -S ~/.ssh/ssh_auth_sock ]; then
ln -sf "$SSH_AUTH_SOCK" ~/.ssh/ssh_auth_sock 2>/dev/null
fi
export SSH_AUTH_SOCK=~/.ssh/ssh_auth_sock
'';
};
home = { home = {
packages = with pkgs; [ packages = with pkgs; [
pythonEnv pythonEnv
@ -55,11 +65,13 @@ in
sway-audio-idle-inhibit sway-audio-idle-inhibit
ffmpeg ffmpeg
imv imv
keychain
]; ];
file = utils.mk_symlinks { inherit config dotfiles; }; file = utils.mk_symlinks { inherit config dotfiles; };
}; };
services = { services = {
mako.enable = true; mako.enable = true;
ssh-agent.enable = true;
}; };
} }

View file

@ -130,9 +130,9 @@ set -g status-right "#($HOME/.config/tmux/tmux-status-right.sh)"
set -g status-bg "#171B24" set -g status-bg "#171B24"
set -g status-style bold set -g status-style bold
# set -g @catppuccin_flavour "macchiato" # SSH agent forwarding
# set -g @catppuccin_status_background "#1e2030" set-option -g update-environment "SSH_AUTH_SOCK SSH_CONNECTION"
# set -g @plugin "catppuccin/tmux" setenv -g SSH_AUTH_SOCK $HOME/.ssh/ssh_auth_sock
set -g @plugin "tmux-plugins/tpm" set -g @plugin "tmux-plugins/tpm"
run "~/dev/git/tpm/tpm" run "~/dev/git/tpm/tpm"