Add service file for ssh-agent
This commit is contained in:
parent
f6caf75217
commit
6f2d780da1
3 changed files with 21 additions and 0 deletions
|
@ -53,6 +53,14 @@ sudoers:
|
|||
- run:
|
||||
- sudo chmod 600 /etc/sudoers.d/setup-cockpit
|
||||
|
||||
ssh-agent:
|
||||
- symlink:
|
||||
- dotfiles/systemd/ssh-agent.service
|
||||
- ~/.config/systemd/user/ssh-agent.service
|
||||
- run:
|
||||
- systemctl --user is-enabled ssh-agent >/dev/null || systemctl --user enable ssh-agent;
|
||||
systemctl --user start ssh-agent
|
||||
|
||||
pacman.conf:
|
||||
- run:
|
||||
command: sudo cp /etc/pacman.conf /etc/pacman.conf.backup
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
[[ -x /usr/bin/vim ]] && export EDITOR="/usr/bin/vim"
|
||||
|
||||
export TERMINAL="kitty"
|
||||
export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/ssh-agent.socket"
|
||||
|
||||
if systemctl -q is-active graphical.target && [[ ! $DISPLAY && $XDG_VTNR -eq 1 ]]; then
|
||||
exec startx
|
||||
|
|
12
dotfiles/systemd/ssh-agent.service
Normal file
12
dotfiles/systemd/ssh-agent.service
Normal file
|
@ -0,0 +1,12 @@
|
|||
[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
|
Loading…
Add table
Reference in a new issue