Improve autoinstall and yadm bootstrap

This commit is contained in:
Tobias Reisinger 2024-05-13 13:55:14 +02:00
parent 5cecab18eb
commit 4fa809a506
Signed by: serguzim
GPG key ID: 13AD60C237A28DFE
4 changed files with 141 additions and 159 deletions

View file

@ -4,7 +4,7 @@ declare -A mapper=(
[".e"]="$HOME/.bin/.e" [".e"]="$HOME/.bin/.e"
[".t"]="$HOME/.bin/.t" [".t"]="$HOME/.bin/.t"
["alacritty"]="$HOME/.config/alacritty/alacritty.toml" ["alacritty"]="$HOME/.config/alacritty/alacritty.toml"
["autoinstall.toml"]="$HOME/.config/autoinstall.toml" ["autoinstall.conf"]="$HOME/.config/autoinstall.conf"
["autostart.toml"]="$HOME/.config/autostart.toml" ["autostart.toml"]="$HOME/.config/autostart.toml"
["backup"]="$HOME/.bin/host-backup-$(cat /proc/sys/kernel/hostname)" ["backup"]="$HOME/.bin/host-backup-$(cat /proc/sys/kernel/hostname)"
["bash"]="$HOME/.bashrc" ["bash"]="$HOME/.bashrc"

128
.config/autoinstall.conf Normal file
View file

@ -0,0 +1,128 @@
AUTOINSTALL_ITEM_TYPE="file"
AUTOINSTALL_ITEM_SOURCE="https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim"
AUTOINSTALL_ITEM_TARGET="$HOME/.config/vim/autoload/plug.vim"
AUTOINSTALL_ITEM_HOOK='[ -x "$(command -v vim)" ] && yes | vim +"PlugInstall --sync" +qa --not-a-term'
AUTOINSTALL_ITEM_GROUPS="base"
AUTOINSTALL_ITEM_TYPE="git"
AUTOINSTALL_ITEM_SOURCE="https://github.com/AstroNvim/AstroNvim"
AUTOINSTALL_ITEM_TARGET="$HOME/.config/nvim"
AUTOINSTALL_ITEM_HOOK='[ -x "$(command -v nvim)" ] && nvim --headless +q'
AUTOINSTALL_ITEM_GROUPS="base"
AUTOINSTALL_ITEM_TYPE="exe"
AUTOINSTALL_ITEM_SOURCE="https://github.com/starship/starship/releases/download/v1.17.1/starship-x86_64-unknown-linux-gnu.tar.gz"
AUTOINSTALL_ITEM_TARGET="starship"
AUTOINSTALL_ITEM_PIPE="tar xzO"
AUTOINSTALL_ITEM_GROUPS="base"
AUTOINSTALL_ITEM_TYPE="exe"
AUTOINSTALL_ITEM_SOURCE="https://raw.githubusercontent.com/qw3rtman/git-fire/master/git-fire"
AUTOINSTALL_ITEM_TARGET="git-fire"
AUTOINSTALL_ITEM_GROUPS="base"
AUTOINSTALL_ITEM_TYPE="exe"
AUTOINSTALL_ITEM_SOURCE="https://github.com/TheLocehiliosan/yadm/raw/master/yadm"
AUTOINSTALL_ITEM_TARGET="yadm"
AUTOINSTALL_ITEM_GROUPS="base"
AUTOINSTALL_ITEM_TYPE="exe"
AUTOINSTALL_ITEM_SOURCE="https://github.com/eza-community/eza/releases/download/v0.17.0/eza_x86_64-unknown-linux-gnu.tar.gz"
AUTOINSTALL_ITEM_TARGET="eza"
AUTOINSTALL_ITEM_PIPE="tar xzO"
AUTOINSTALL_ITEM_GROUPS="base"
AUTOINSTALL_ITEM_TYPE="exe"
AUTOINSTALL_ITEM_SOURCE="https://github.com/apple/pkl/releases/download/0.25.2/pkl-linux-amd64"
AUTOINSTALL_ITEM_TARGET="pkl"
AUTOINSTALL_ITEM_GROUPS="base"
AUTOINSTALL_ITEM_TYPE="exe"
AUTOINSTALL_ITEM_SOURCE="https://git.serguzim.me/serguzim/tools/releases/download/latest/autostart-manage"
AUTOINSTALL_ITEM_TARGET="autostart-manage"
AUTOINSTALL_ITEM_GROUPS="base,personal"
AUTOINSTALL_ITEM_COMPLETIONS="completions"
AUTOINSTALL_ITEM_TYPE="exe"
AUTOINSTALL_ITEM_SOURCE="https://git.serguzim.me/serguzim/tools/releases/download/latest/autoinstall"
AUTOINSTALL_ITEM_TARGET="autoinstall"
AUTOINSTALL_ITEM_GROUPS="base,personal"
AUTOINSTALL_ITEM_COMPLETIONS="completions"
AUTOINSTALL_ITEM_TYPE="git"
AUTOINSTALL_ITEM_SOURCE="https://github.com/zsh-users/zsh-syntax-highlighting.git"
AUTOINSTALL_ITEM_TARGET="${plugin_path:?}/zsh-syntax-highlighting"
AUTOINSTALL_ITEM_GROUPS="oh-my-zsh"
AUTOINSTALL_ITEM_TYPE="git"
AUTOINSTALL_ITEM_SOURCE="https://github.com/spwhitt/nix-zsh-completions.git"
AUTOINSTALL_ITEM_TARGET="${plugin_path:?}/nix-zsh-completions"
AUTOINSTALL_ITEM_GROUPS="oh-my-zsh"
AUTOINSTALL_ITEM_TYPE="git"
AUTOINSTALL_ITEM_SOURCE="https://github.com/chisui/zsh-nix-shell.git"
AUTOINSTALL_ITEM_TARGET="${plugin_path:?}/nix-shell"
AUTOINSTALL_ITEM_GROUPS="oh-my-zsh"
AUTOINSTALL_ITEM_TYPE="file"
AUTOINSTALL_ITEM_SOURCE="https://gist.githubusercontent.com/oshybystyi/475ee7768efc03727f21/raw/4bfd57ef277f5166f3070f11800548b95a501a19/git-auto-status.plugin.zsh"
AUTOINSTALL_ITEM_TARGET="${plugin_path:?}/git-auto-status/git-auto-status.plugin.zsh"
AUTOINSTALL_ITEM_GROUPS="oh-my-zsh"
AUTOINSTALL_ITEM_TYPE="file"
AUTOINSTALL_ITEM_SOURCE="https://raw.githubusercontent.com/dracula/alacritty/master/dracula.toml"
AUTOINSTALL_ITEM_TARGET="$HOME/.config/alacritty/dracula.toml"
AUTOINSTALL_ITEM_GROUPS="graphical"
AUTOINSTALL_ITEM_TYPE="file"
AUTOINSTALL_ITEM_SOURCE="https://raw.githubusercontent.com/dracula/duckduckgo/master/monkeyscript.user.js"
AUTOINSTALL_ITEM_TARGET="$HOME/.local/share/qutebrowser/greasemonkey/ddg-dracula.user.js"
AUTOINSTALL_ITEM_GROUPS="graphical"
AUTOINSTALL_ITEM_TYPE="git"
AUTOINSTALL_ITEM_SOURCE="https://github.com/dracula/qutebrowser.git"
AUTOINSTALL_ITEM_TARGET="$HOME/.config/qutebrowser/dracula"
AUTOINSTALL_ITEM_GROUPS="graphical"
AUTOINSTALL_ITEM_TYPE="git"
AUTOINSTALL_ITEM_SOURCE="https://github.com/dracula/gtk.git"
AUTOINSTALL_ITEM_TARGET="$HOME/.themes/Dracula"
AUTOINSTALL_ITEM_GROUPS="graphical"
AUTOINSTALL_ITEM_TYPE="file"
AUTOINSTALL_ITEM_SOURCE="https://github.com/dracula/gtk/releases/download/v4.0.0/Dracula-cursors.tar.xz"
AUTOINSTALL_ITEM_TARGET="$HOME/.icons/Dracula-cursors"
AUTOINSTALL_ITEM_PIPE="tar xJ"
AUTOINSTALL_ITEM_GROUPS="graphical"
#AUTOINSTALL_ITEM_TYPE="file"
#AUTOINSTALL_ITEM_SOURCE="https://github.com/guillaumeboehm/hyprcursor_dracula_kde/raw/master/hyprcursor_Dracula.tar.gz"
#AUTOINSTALL_ITEM_TARGET="$HOME/.icons/hyprcursor_Dracula"
#AUTOINSTALL_ITEM_PIPE="tar xz"
#AUTOINSTALL_ITEM_GROUPS="graphical"
AUTOINSTALL_ITEM_TYPE="exe"
AUTOINSTALL_ITEM_SOURCE="$(curl -fsSL 'https://data.services.jetbrains.com/products?code=TBA&release.type=release&fields=releases' | jq -r '.[0].releases[0].downloads.linux.link')"
AUTOINSTALL_ITEM_TARGET="jetbrains-toolbox"
AUTOINSTALL_ITEM_PIPE="tar xzO"
AUTOINSTALL_ITEM_GROUPS="graphical"
AUTOINSTALL_ITEM_TYPE="exe"
AUTOINSTALL_ITEM_SOURCE="https://git.serguzim.me/serguzim/teamspeak-query-lib/releases/download/latest/ts-control"
AUTOINSTALL_ITEM_TARGET="ts-control"
AUTOINSTALL_ITEM_GROUPS="graphical,personal"
AUTOINSTALL_ITEM_TYPE="exe"
AUTOINSTALL_ITEM_SOURCE="https://git.serguzim.me/serguzim/teamspeak-query-lib/releases/download/latest/teamspeak-query-lib"
AUTOINSTALL_ITEM_TARGET="teamspeak-query-lib"
AUTOINSTALL_ITEM_GROUPS="graphical,personal"
AUTOINSTALL_ITEM_TYPE="text"
AUTOINSTALL_ITEM_SOURCE="ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCkmWZmum4cVeDy5+9N1HdUzfnjEHSJ900ucD8F0wAy4MV1cdPYnZ4u5PFv5XMfmvA9SJ+VFsr0lhYlr+GQBG9aCCAdMJVVmEz3SccT6dp6ZYywT158RNshzfCe9ylWKK80+W7XnDXhdkec7aK+BQn5wOER3A3mUqRR0JDXWga9jyakH1K6OwXmQOO419bJWs2uCT1ZEgndHxKJEt2pEvoSz7z8p1SS2zyro+R3YtvL9WiDo3+0yPFYficNDr7s39yF5IJE+KTqAlCn5R2+kJ54lRmzB8oNS2jGwK2Q6wtph4AmfnlJTMODG2U2RjUltH2MIDXIYe2epATWL8qhkI4LTr38C7QR3DeJQsel/yTWdYqGakvU6Ge/xkbsaWOrSDTV3bPgKHzlL+dIKaGpV+5usZN4fpOLOb/nmYy3ekLpobzxza7rBRT2CxXS72DoPFaRE1ye7SxhcsLBNwre9YQFE4VvUZwJYkWz2V7eqGrk8VYnmQmT/bnUnMnVwMpeDc7pFKAFndIUxifoOj77c98Tdy3ncdS7SOd7+zRbLG+7k0UU1k89o1+tfREAddUJYR4RvB6g0kCyjpwOf1Pt4zhJR3y/zpsCCc5UnzK9X2kEo/8TSyvTr+GBiFVp5yLYgwCPJSNna33YX7+c3oLRM1QGgtqZk9qnGX9hgP8qpF8Akw== openpgp:0xAB920993"
AUTOINSTALL_ITEM_TARGET="$HOME/.ssh/authorized_keys"
AUTOINSTALL_ITEM_GROUPS="ssh"

View file

@ -1,152 +0,0 @@
[[autoinstall]]
type = "file"
source = "https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim"
target = "$HOME/.config/vim/autoload/plug.vim"
hook = '[ -x "$(command -v vim)" ] && yes | vim +"PlugInstall --sync" +qa --not-a-term'
groups = ["base"]
[[autoinstall]]
type = "git"
source = "https://github.com/AstroNvim/AstroNvim"
target = "$HOME/.config/nvim"
hook = '[ -x "$(command -v nvim)" ] && nvim --headless +q'
groups = ["base"]
[[autoinstall]]
type = "exe"
source = "https://github.com/starship/starship/releases/download/v1.17.1/starship-x86_64-unknown-linux-gnu.tar.gz"
target = "starship"
pipe = "tar xzO"
groups = ["base"]
[[autoinstall]]
type = "exe"
source = "https://raw.githubusercontent.com/qw3rtman/git-fire/master/git-fire"
target = "git-fire"
groups = ["base"]
[[autoinstall]]
type = "exe"
source = "https://github.com/TheLocehiliosan/yadm/raw/master/yadm"
target = "yadm"
groups = ["base"]
[[autoinstall]]
type = "exe"
source = "https://github.com/eza-community/eza/releases/download/v0.17.0/eza_x86_64-unknown-linux-gnu.tar.gz"
target = "eza"
pipe = "tar xzO"
groups = ["base"]
[[ autoinstall ]]
type = "exe"
source = "https://github.com/apple/pkl/releases/download/0.25.2/pkl-linux-amd64"
target = "pkl"
groups = ["base"]
[[autoinstall]]
type = "exe"
source = "https://git.serguzim.me/serguzim/tools/releases/download/latest/autostart-manage"
target = "autostart-manage"
groups = ["base", "personal"]
completions = "completions"
[[autoinstall]]
type = "exe"
source = "https://git.serguzim.me/serguzim/tools/releases/download/latest/autoinstall"
target = "autoinstall"
groups = ["base", "personal"]
completions = "completions"
[[autoinstall]]
type = "git"
source = "https://github.com/zsh-users/zsh-syntax-highlighting.git"
target = "${plugin_path:?}/zsh-syntax-highlighting"
groups = ["oh-my-zsh"]
[[autoinstall]]
type = "git"
source = "https://github.com/spwhitt/nix-zsh-completions.git"
target = "${plugin_path:?}/nix-zsh-completions"
groups = ["oh-my-zsh"]
[[autoinstall]]
type = "git"
source = "https://github.com/chisui/zsh-nix-shell.git"
target = "${plugin_path:?}/nix-shell"
groups = ["oh-my-zsh"]
[[autoinstall]]
type = "file"
source = "https://gist.githubusercontent.com/oshybystyi/475ee7768efc03727f21/raw/4bfd57ef277f5166f3070f11800548b95a501a19/git-auto-status.plugin.zsh"
target = "${plugin_path:?}/git-auto-status/git-auto-status.plugin.zsh"
groups = ["oh-my-zsh"]
[[autoinstall]]
type = "file"
source = "https://raw.githubusercontent.com/dracula/alacritty/master/dracula.toml"
target = "$HOME/.config/alacritty/dracula.toml"
groups = ["graphical"]
[[autoinstall]]
type = "file"
source = "https://raw.githubusercontent.com/dracula/duckduckgo/master/monkeyscript.user.js"
target = "$HOME/.local/share/qutebrowser/greasemonkey/ddg-dracula.user.js"
groups = ["graphical"]
[[autoinstall]]
type = "git"
source = "https://github.com/dracula/qutebrowser.git"
target = "$HOME/.config/qutebrowser/dracula"
groups = ["graphical"]
[[autoinstall]]
type = "git"
source = "https://github.com/dracula/gtk.git"
target = "$HOME/.themes/Dracula"
groups = ["graphical"]
[[autoinstall]]
type = "file"
source = "https://github.com/dracula/gtk/releases/download/v3.0/Dracula-cursors.tar.xz"
target = "$HOME/.icons/Dracula-cursors"
pipe = "tar xJ"
groups = ["graphical"]
[[autoinstall]]
type = "file"
source = "https://github.com/guillaumeboehm/hyprcursor_dracula_kde/raw/master/hyprcursor_Dracula.tar.gz"
target = "$HOME/.icons/hyprcursor_Dracula"
pipe = "tar xz"
groups = ["graphical"]
[[autoinstall]]
type = "exe"
source = "$(curl -fsSL 'https://data.services.jetbrains.com/products?code=TBA&release.type=release&fields=releases' | jq -r '.[0].releases[0].downloads.linux.link')"
target = "jetbrains-toolbox"
pipe = "tar xzO"
groups = ["graphical"]
[[autoinstall]]
type = "exe"
source = "https://git.serguzim.me/serguzim/teamspeak-query-lib/releases/download/latest/ts-control"
target = "ts-control"
groups = ["graphical", "personal"]
[[autoinstall]]
type = "exe"
source = "https://git.serguzim.me/serguzim/teamspeak-query-lib/releases/download/latest/teamspeak-query-lib"
target = "teamspeak-query-lib"
groups = ["graphical", "personal"]
[[autoinstall]]
type = "text"
source = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCkmWZmum4cVeDy5+9N1HdUzfnjEHSJ900ucD8F0wAy4MV1cdPYnZ4u5PFv5XMfmvA9SJ+VFsr0lhYlr+GQBG9aCCAdMJVVmEz3SccT6dp6ZYywT158RNshzfCe9ylWKK80+W7XnDXhdkec7aK+BQn5wOER3A3mUqRR0JDXWga9jyakH1K6OwXmQOO419bJWs2uCT1ZEgndHxKJEt2pEvoSz7z8p1SS2zyro+R3YtvL9WiDo3+0yPFYficNDr7s39yF5IJE+KTqAlCn5R2+kJ54lRmzB8oNS2jGwK2Q6wtph4AmfnlJTMODG2U2RjUltH2MIDXIYe2epATWL8qhkI4LTr38C7QR3DeJQsel/yTWdYqGakvU6Ge/xkbsaWOrSDTV3bPgKHzlL+dIKaGpV+5usZN4fpOLOb/nmYy3ekLpobzxza7rBRT2CxXS72DoPFaRE1ye7SxhcsLBNwre9YQFE4VvUZwJYkWz2V7eqGrk8VYnmQmT/bnUnMnVwMpeDc7pFKAFndIUxifoOj77c98Tdy3ncdS7SOd7+zRbLG+7k0UU1k89o1+tfREAddUJYR4RvB6g0kCyjpwOf1Pt4zhJR3y/zpsCCc5UnzK9X2kEo/8TSyvTr+GBiFVp5yLYgwCPJSNna33YX7+c3oLRM1QGgtqZk9qnGX9hgP8qpF8Akw== openpgp:0xAB920993"
target = "$HOME/.ssh/authorized_keys"
groups = ["ssh"]

View file

@ -3,12 +3,6 @@
echo "Loading environment variables" echo "Loading environment variables"
. "$HOME/.config/environment" . "$HOME/.config/environment"
echo "Configuring yadm"
yadm gitconfig core.bare false
yadm gitconfig core.worktree "$HOME"
yadm gitconfig status.showUntrackedFiles no
yadm remote set-url --push origin "git@git.serguzim.me:serguzim/.dotfiles.git"
if [ ! -x "$(command -v autoinstall)" ]; if [ ! -x "$(command -v autoinstall)" ];
then then
echo "Installing autoinstall command" echo "Installing autoinstall command"
@ -17,6 +11,18 @@ then
chmod +x "$HOME/.local/bin/autoinstall" chmod +x "$HOME/.local/bin/autoinstall"
fi fi
if [ ! -x "$(command -v yadm)" ];
then
echo "Installing yadm command"
autoinstall exe "https://github.com/TheLocehiliosan/yadm/raw/master/yadm" "yadm"
fi
echo "Configuring yadm"
yadm gitconfig core.bare false
yadm gitconfig core.worktree "$HOME"
yadm gitconfig status.showUntrackedFiles no
yadm remote set-url --push origin "git@git.serguzim.me:serguzim/.dotfiles.git"
echo "Autoinstalling base" echo "Autoinstalling base"
autoinstall run base autoinstall run base