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

View file

@ -8,8 +8,13 @@ lazygit
lua-language-server lua-language-server
neovim neovim
python python
python-pip
python-pipx
python-pynvim python-pynvim
rclone rclone
rsync rsync
tar tar
wget 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