Add unit file for starting ssh-agent

This commit is contained in:
Evie Litherland-Smith 2023-01-12 14:25:46 +00:00
parent 75d47d950d
commit 3fcf63efdd
3 changed files with 29 additions and 5 deletions

View file

@ -2,7 +2,7 @@
# Install various dotfiles into their proper places
create_symlink () {
FILENAME="$(basename $FILE)"
FILENAME="$(basename $2)"
if [ ! -e "$1/$FILENAME" ]
then
ln -s $(readlink -f "$2") "$1/$FILENAME"
@ -23,14 +23,22 @@ git_clone_if_missing () {
# .config files
CONFIG_DIR="${XDG_CONFIG_HOME:-$HOME/.config}"
mkdir -p "$CONFIG_DIR"
for FILE in config/*; do
mkdir -p "$CONFIG_DIR"
for FILE in config/*
do
create_symlink $CONFIG_DIR $FILE
done
mkdir -p "$CONFIG_DIR/systemd/user"
for FILE in systemd/*
do
create_symlink $CONFIG_DIR/systemd/user $FILE
done
# Install arch packages
sudo pacman --needed -S $(awk '{print $1}' pacman.txt) || echo "Issue install pacman packages"
sudo pacman --needed -S $(awk '{print $1}' pacman.txt) || echo "Issue installing pacman packages"
# nvim setup - install Packer
PACKER_REPO="https://github.com/wbthomason/packer.nvim"
@ -45,7 +53,6 @@ then
POWERLEVEL_REPO="https://github.com/romkatv/powerlevel10k.git"
POWERLEVEL_DIR="$OHMYZSH_DIR/themes/powerlevel10k"
git_clone_if_missing $POWERLEVEL_REPO $POWERLEVEL_DIR
# git clone --depth=1 ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
# aliases
create_symlink $OHMYZSH_DIR "./aliases.zsh"
fi

View file

@ -8,8 +8,13 @@ lazygit
lua-language-server
neovim
python
python-pip
python-pipx
python-pynvim
rclone
rsync
tar
wget
python-black
python-isort
pyright

12
systemd/ssh-agent.service Normal file
View 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