install: make ~/.config a symlink into dotfiles

This commit is contained in:
Fernando Schauenburg 2022-02-07 19:26:29 +01:00
parent 326ba2d607
commit 61f0b64b84
67 changed files with 43 additions and 25 deletions

2
.gitattributes vendored
View file

@ -1,2 +1,2 @@
ssh/.ssh/config filter=git-crypt diff=git-crypt home/.ssh/config filter=git-crypt diff=git-crypt

View file

@ -1 +0,0 @@
directory for extra git configurations

View file

@ -18,7 +18,9 @@ main() {
esac done esac done
greeting greeting
stow_packages make_dirs
stow_home
link_config
git_user_config git_user_config
nvim_plugins nvim_plugins
} }
@ -41,24 +43,45 @@ greeting() {
} }
} }
stow_packages() { make_dirs() {
heading 'stow packages' heading 'create auxiliary directories'
stow -v${IS_DRY_RUN:+n} --no-folding -d "$DOTFILES" -t "$TARGET" \ while read item; do
alacritty \ dir="$TARGET/$item"
bin \ if [ ! -d "$dir" ]; then
git \ echo "${yellow}MKDIR:$rst $dir"
jupyter \ dry_run || mkdir -p "$dir"
mintty \ fi
misc \ done <<EOF
nvim \ .local/share/less/
python \ .local/share/python/
readline \ .local/share/nvim/shada/
shell \ .local/share/zsh/
ssh \ .local/etc/git/
tmux \ EOF
x11 \ }
zsh \
2>&1 | sed -E -e "s/^([^:]+:)/$yellow\1$rst/" -e "s/=>/$blue=>$rst/" link_config() {
heading 'link .config directory'
link="$TARGET/.config"
dotfiles_config="$DOTFILES/config"
backup="$TARGET/old_dot_config"
if [ "$(readlink "$link")" != "$dotfiles_config" ]; then
if [ -d "$link" ]; then
echo "${red}WARNING:$rst moving existing '$link' to '$backup'"
dry_run || mv "$link" "$backup"
fi
echo "${yellow}LINK:$rst $link $blue=>$rst $dotfiles_config"
dry_run || ln -s "$dotfiles_config" "$link"
fi
}
stow_home() {
heading 'stow home directory'
stow -v${IS_DRY_RUN:+n} --no-folding -d "$DOTFILES" -t "$TARGET" home 2>&1 \
| sed -E -e "s/^([^:]+:)/$yellow\1$rst/" -e "s/=>/$blue=>$rst/"
} }
git_user_config() { git_user_config() {

View file

@ -1 +0,0 @@
directory for less(1) history

View file

@ -1 +0,0 @@
nvim SHAred DAta directory

View file

@ -1 +0,0 @@
directory for python REPL history

View file

@ -1 +0,0 @@
directory for zsh history