Compare commits

...

2 Commits

Author SHA1 Message Date
f1b55c6be9
Add ssh-agent service and ssh config
Add a systemd user service to start the ssh-agent and add an ssh
config to automatically add ssh identities to the agent when they
are used (otherwise we have to add them manually). I will see how
this works out.

See: https://wiki.archlinux.org/title/SSH_keys#SSH_agents
2022-08-12 16:23:06 -07:00
afa622369b
dotfiles/zshrc: update
Remove unused Kitty and ASDF variables, and export SSH_AUTH_SOCK.
2022-08-12 16:21:55 -07:00
4 changed files with 24 additions and 6 deletions

View File

@ -63,6 +63,12 @@ dotfiles:
d_local_bin:
src: local/bin
dst: ~/.local/bin
f_ssh_config:
src: ssh/config
dst: ~/.ssh/config
f_ssh-agent.service:
src: config/systemd/user/ssh-agent.service
dst: ~/.config/systemd/user/ssh-agent.service
profiles:
everywhere:
dotfiles:
@ -90,6 +96,7 @@ profiles:
- f_pam_environment
- f_xdg_desktop_portal_wlr_config
- d_local_bin
- f_ssh-agent.service
knafeh:
dotfiles:
- d_vim
@ -111,3 +118,4 @@ profiles:
- f_xdg_desktop_portal_wlr_config
- f_geoclue-agent.service
- d_local_bin
- f_ssh-agent.service

View File

@ -0,0 +1,13 @@
# From: https://wiki.archlinux.org/title/SSH_keys#SSH_agents
[Unit]
Description=SSH key agent
[Service]
Type=simple
Environment=SSH_AUTH_SOCK=%t/ssh-agent.socket
# DISPLAY required for ssh-askpass to work
Environment=DISPLAY=:0
ExecStart=/usr/bin/ssh-agent -D -a $SSH_AUTH_SOCK
[Install]
WantedBy=default.target

1
dotfiles/ssh/config Normal file
View File

@ -0,0 +1 @@
AddKeysToAgent yes

View File

@ -37,7 +37,6 @@ if [[ "$OSTYPE" =~ ^linux.*$ ]]; then
# 2021-06-22: fix "Firefox is already running" message
# See: https://mastransky.wordpress.com/2020/03/16/wayland-x11-how-to-run-firefox-in-mixed-environment/
export MOZ_DBUS_REMOTE=1
export KITTY_ENABLE_WAYLAND=1
export QT_QPA_PLATFORM=wayland-egl
export CLUTTER_BACKEND=wayland
# 2020-02-10: https://github.com/swaywm/sway/wiki#issues-with-java-applications
@ -49,10 +48,6 @@ fi
{%@@ if profile == "balozi" @@%}
# Enable asdf version manager zsh completions
. /opt/asdf-vm/asdf.sh
# Enable setting JAVA_HOME, requires the asdf-java plugin installed for this
# user. Currently disabled because it adds a noticeable lag to the shell
# See: https://github.com/halcyon/asdf-java
#. ~/.asdf/plugins/java/set-java-home.zsh
{%@@ endif @@%}
alias ls='ls -F --color=auto'
@ -62,7 +57,6 @@ alias less='less -R' # preserves colors in GNU coreutils' `less`
# see: https://github.com/jan-warchol/selenized/tree/master/other-apps/dircolors
export LS_COLORS="$LS_COLORS:ow=1;7;34:st=30;44:su=30;41"
# Environment
export PS1='[%n@%m: %~]$ '
export EDITOR=vim
@ -103,6 +97,8 @@ export GPG_TTY=$(tty)
# Refresh gpg-agent tty in case user switches into an X Session
gpg-connect-agent updatestartuptty /bye >/dev/null
export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/ssh-agent.socket"
# Speed up JVM start for short-lived Java programs
# See: https://zeroturnaround.com/rebellabs/your-maven-build-is-slow-speed-it-up/
export MAVEN_OPTS="-XX:+TieredCompilation -XX:TieredStopAtLevel=1"