use gnu stow to manage dotfiles

This commit is contained in:
Mans Ziesel 2024-05-08 17:13:04 +02:00
parent 957d34926d
commit d3646ecace
42 changed files with 60 additions and 0 deletions

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule "nvim/dot-config/nvim"]
path = nvim/dot-config/nvim
url = git@git.mzsl.nl:mans/neovim-config

0
__setup/.gitkeep Normal file
View File

9
git/.gitconfig Normal file
View File

@ -0,0 +1,9 @@
[user]
email = mans@mziesel.com
name = Mans Ziesel
signingkey = /home/mans/.ssh/id_rsa.pub
[url "git@git.mzsl.nl:"]
insteadOf = https://git.mzsl.nl/
[gpg]
format = ssh

1
nvim/dot-config/nvim Submodule

@ -0,0 +1 @@
Subproject commit 08a1521eac9639ec9cde52b5aead2e49187f7d25

47
setup.sh Executable file
View File

@ -0,0 +1,47 @@
#!/usr/bin/env bash
# make sure we have pulled in and updated any submodules
git submodule init
git submodule update
# what directories should be installable by all users including the root user
base=(
)
# folders that should, or only need to be installed for a local user
useronly=(
bin
git
i3
kitty
nvim
fish
)
# run the stow command for the passed in directory ($2) in location $1
stowit() {
usr=$1
app=$2
# -v verbose
# -R recursive
# -t target
stow --dotfiles -v -R -t "${usr}" "${app}"
}
echo ""
echo "Stowing apps for user: $(whoami)"
# install apps available to local users and root
for app in "${base[@]}"; do
stowit "${HOME}" "$app"
done
# install only user space folders
for app in "${useronly[@]}"; do
if [[ ! "$(whoami)" = *"root"* ]]; then
stowit "${HOME}" "$app"
fi
done
echo ""
echo "##### ALL DONE"

View File

Before

Width:  |  Height:  |  Size: 937 KiB

After

Width:  |  Height:  |  Size: 937 KiB

View File

Before

Width:  |  Height:  |  Size: 820 KiB

After

Width:  |  Height:  |  Size: 820 KiB

View File

Before

Width:  |  Height:  |  Size: 343 KiB

After

Width:  |  Height:  |  Size: 343 KiB

View File

Before

Width:  |  Height:  |  Size: 298 KiB

After

Width:  |  Height:  |  Size: 298 KiB