changeset 809:72744c944497

feat: install packages and rtx for management
author zegervdv <zegervdv@me.com>
date Tue, 05 Dec 2023 20:03:16 +0100
parents 459e70c99f4c
children 6499aba0eaf3
files .chezmoiexternal.toml .chezmoiremove .chezmoiscripts/run_once_after_15-install-ubuntu-packages.sh.tmpl .chezmoiscripts/run_once_after_16-configure-ubuntu-gnome.sh.tmpl .chezmoiscripts/run_once_after_20-install-asdf-plugins.sh.tmpl .chezmoiscripts/run_once_after_30-generate-completions.sh.tmpl .chezmoiscripts/run_once_after_99-build-zsh-histdb-skim.sh.tmpl .chezmoiscripts/run_onchange_after_10-install-brew-packages.sh.tmpl .chezmoiscripts/run_onchange_after_15-install-ubuntu-packages.sh.tmpl .chezmoiscripts/run_onchange_after_16-configure-ubuntu-gnome.sh.tmpl .chezmoiscripts/run_onchange_after_17-install-zsh.sh.tmpl .chezmoiscripts/run_onchange_after_18-install-tmux.sh.tmpl .chezmoiscripts/run_onchange_after_20-install-rtx-and-plugins.sh.tmpl dot_zshrc
diffstat 14 files changed, 140 insertions(+), 122 deletions(-) [+]
line wrap: on
line diff
--- a/.chezmoiexternal.toml	Sun Dec 03 22:24:26 2023 +0100
+++ b/.chezmoiexternal.toml	Tue Dec 05 20:03:16 2023 +0100
@@ -66,10 +66,6 @@
   url = "https://github.com/Homebrew/brew/raw/master/completions/zsh/_brew"
   refreshPeriod = "168h"
 
-[".zsh/completions/_chezmoi"]
-  type = "file"
-  url = "https://github.com/twpayne/chezmoi/raw/v2.15.1/completions/chezmoi.zsh"
-
 [".zsh/completions/_pass"]
   type = "file"
   url = "https://git.zx2c4.com/password-store/plain/src/completion/pass.zsh-completion"
--- a/.chezmoiremove	Sun Dec 03 22:24:26 2023 +0100
+++ b/.chezmoiremove	Tue Dec 05 20:03:16 2023 +0100
@@ -1,2 +1,3 @@
 ~/.config/nvim/plugin/config.vim
 ~/.zsh/fzf-tab/
+~/.asdf/
--- a/.chezmoiscripts/run_once_after_15-install-ubuntu-packages.sh.tmpl	Sun Dec 03 22:24:26 2023 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-{{ if eq .chezmoi.os "linux" -}}
-{{ if eq .chezmoi.osRelease.name "Ubuntu" -}}
-
-{{ $packages := list
-	"build-essential"
-	"libsqlite3-dev"
-	"libreadline-dev"
-    "libbz2-dev"
-    "libncurses-dev"
-    "zlib1g-dev"
-    "libffi-dev"
-    "libssl-dev"
-    "software-properties-common"
-	"fzf"
-    "fd-find"
-    "ripgrep"
-	"jq"
-	"pass"
-	"apt-file"
-	"fonts-firacode"
-	"kitty" -}}
-
-{{ $ppa := list
-	"ppa:maveonair/helix-editor"
-	"ppa:mozillateam/ppa" -}}
-
-{{ $extra_packages := list
-	"helix"
-	"firefox" -}}
-#!/usr/bin/env bash
-
-set -xe
-
-sudo apt install -y  {{ $packages | join " "}}
-
-{{ range $ppa }}
-sudo add-apt-repository -y --no-update --ppa {{ . }}
-{{ end}}
-
-sudo mkdir -p /etc/apt/preferences.d/
-sudo cp -v {{ .chezmoi.sourceDir }}/system/ubuntu/mozilla-firefox /etc/apt/preferences.d/mozilla-firefox
-
-sudo apt update
-sudo apt install -y  {{ $extra_packages | join " " }}
-
-sudo update-alternatives --set x-terminal-emulator /usr/bin/kitty
-
-{{- end }}
-{{- end }}
--- a/.chezmoiscripts/run_once_after_16-configure-ubuntu-gnome.sh.tmpl	Sun Dec 03 22:24:26 2023 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
-{{ if eq .chezmoi.os "linux" -}}
-{{ if eq .chezmoi.osRelease.name "Ubuntu" -}}
-#!/usr/bin/env bash
-
-if [ -x "$(command -v dconf)" ]; then
-
-	dconf write /org/gnome/desktop/input-sources/xkb-options "['ctrl:nocaps']"
-
-fi
-{{- end }}
-{{- end }}
--- a/.chezmoiscripts/run_once_after_20-install-asdf-plugins.sh.tmpl	Sun Dec 03 22:24:26 2023 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-{{ if (or (eq .chezmoi.os "darwin") (and (eq .chezmoi.os "linux") (ne .chezmoi.arch "arm64") (ne .chezmoi.osRelease.id "centos"))) -}}
-#!/usr/bin/env bash
-
-# asdf globals tools hash: {{ include "dot_tool-versions" | sha256sum }}
-
-ASDF_INSTALL="$HOME/.asdf"
-ASDF_VERSION="v0.10.2"
-
-if [[ -d "$ASDF_INSTALL" ]]
-then
-  cd "$ASDF_INSTALL"
-  git pull
-  git checkout "$ASDF_VERSION"
-else
-  git clone https://github.com/asdf-vm/asdf.git "$ASDF_INSTALL" --branch="$ASDF_VERSION"
-fi
-
-source ${ASDF_INSTALL}/asdf.sh
-
-asdf_plugin_add() {
-  if ! asdf plugin-list | grep -Fq "$1"
-  then
-    asdf plugin-add "$1"
-  else
-    echo "asdf plugin $1 already installed"
-  fi
-}
-
-asdf_plugin_add python
-asdf_plugin_add neovim
-asdf_plugin_add direnv
-asdf_plugin_add rust
-asdf_plugin_add sqlite
-
-asdf install
-asdf direnv setup --shell zsh --version latest
-
-asdf reshim
-
-{{ end -}}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/.chezmoiscripts/run_once_after_30-generate-completions.sh.tmpl	Tue Dec 05 20:03:16 2023 +0100
@@ -0,0 +1,8 @@
+{{ if (and (eq .chezmoi.os "linux") (eq .chezmoi.osRelease.name "Ubuntu")) -}}
+#!/usr/bin/env bash
+
+set -xe
+
+chezmoi completion zsh > $HOME/.zsh/completions/_chezmoi
+
+{{ end }}
--- a/.chezmoiscripts/run_once_after_99-build-zsh-histdb-skim.sh.tmpl	Sun Dec 03 22:24:26 2023 +0100
+++ b/.chezmoiscripts/run_once_after_99-build-zsh-histdb-skim.sh.tmpl	Tue Dec 05 20:03:16 2023 +0100
@@ -1,4 +1,4 @@
-{{ if (or (eq .chezmoi.os "darwin") (and (eq .chezmoi.os "linux") (ne .chezmoi.arch "arm64") (ne .chezmoi.osRelease.id "centos"))) -}}
+{{ if (or (eq .chezmoi.os "darwin") (and (eq .chezmoi.os "linux") (eq .chezmoi.osRelease.name "Ubuntu"))) -}}
 #!/usr/bin/env zsh
 
 source $HOME/.asdf/asdf.sh
--- a/.chezmoiscripts/run_onchange_after_10-install-brew-packages.sh.tmpl	Sun Dec 03 22:24:26 2023 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,10 +0,0 @@
-{{ if (eq .chezmoi.os "darwin") -}}
-#!/usr/bin/env bash
-
-# Brewfile hash: {{ include "dot_Brewfile" | sha256sum }}
-
-brew analytics off
-
-brew bundle --global
-
-{{ end -}}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/.chezmoiscripts/run_onchange_after_15-install-ubuntu-packages.sh.tmpl	Tue Dec 05 20:03:16 2023 +0100
@@ -0,0 +1,51 @@
+{{ if eq .chezmoi.os "linux" -}}
+{{ if eq .chezmoi.osRelease.name "Ubuntu" -}}
+
+{{ $packages := list
+	"build-essential"
+	"libsqlite3-dev"
+	"libreadline-dev"
+    "libbz2-dev"
+    "libncurses-dev"
+    "zlib1g-dev"
+    "libffi-dev"
+    "libssl-dev"
+    "software-properties-common"
+	"fzf"
+    "fd-find"
+    "ripgrep"
+	"jq"
+	"pass"
+	"apt-file"
+	"fonts-firacode"
+	"kitty"
+	"yodl"
+	"libevent-core-2.1-7" -}}
+
+{{ $ppa := list
+	"ppa:maveonair/helix-editor"
+	"ppa:mozillateam/ppa" -}}
+
+{{ $extra_packages := list
+	"helix"
+	"firefox" -}}
+#!/usr/bin/env bash
+
+set -xe
+
+sudo apt install -y  {{ $packages | join " "}}
+
+{{ range $ppa }}
+sudo add-apt-repository -y --no-update --ppa {{ . }}
+{{ end}}
+
+sudo mkdir -p /etc/apt/preferences.d/
+sudo cp -v {{ .chezmoi.sourceDir }}/system/ubuntu/mozilla-firefox /etc/apt/preferences.d/mozilla-firefox
+
+sudo apt update
+sudo apt install -y  {{ $extra_packages | join " " }}
+
+sudo update-alternatives --set x-terminal-emulator /usr/bin/kitty
+
+{{- end }}
+{{- end }}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/.chezmoiscripts/run_onchange_after_16-configure-ubuntu-gnome.sh.tmpl	Tue Dec 05 20:03:16 2023 +0100
@@ -0,0 +1,11 @@
+{{ if eq .chezmoi.os "linux" -}}
+{{ if eq .chezmoi.osRelease.name "Ubuntu" -}}
+#!/usr/bin/env bash
+
+if [ -x "$(command -v dconf)" ]; then
+
+	dconf write /org/gnome/desktop/input-sources/xkb-options "['ctrl:nocaps']"
+
+fi
+{{- end }}
+{{- end }}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/.chezmoiscripts/run_onchange_after_17-install-zsh.sh.tmpl	Tue Dec 05 20:03:16 2023 +0100
@@ -0,0 +1,26 @@
+{{ if (and (eq .chezmoi.os "linux") (eq .chezmoi.osRelease.name "Ubuntu")) -}}
+#!/usr/bin/env bash
+
+{{ $version := "5.9" -}}
+
+set -xe
+
+TMP_BUILD_DIR=/tmp/zsh-install-dir
+rm -rf "$TMP_BUILD_DIR" || true
+mkdir -p $TMP_BUILD_DIR
+pushd "$TMP_BUILD_DIR"
+
+curl -L https://github.com/zsh-users/zsh/archive/refs/tags/zsh-{{ $version }}.tar.gz | tar xz
+pushd zsh-zsh-{{ $version }}
+./Util/preconfig
+./configure --prefix /usr/local/
+make -j
+sudo make install
+
+sudo chsh -s /usr/local/bin/zsh $USER
+
+cd
+
+rm -rf "$TMP_BUILD_DIR"
+
+{{ end }}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/.chezmoiscripts/run_onchange_after_18-install-tmux.sh.tmpl	Tue Dec 05 20:03:16 2023 +0100
@@ -0,0 +1,22 @@
+{{ if (and (eq .chezmoi.os "linux") (eq .chezmoi.osRelease.name "Ubuntu")) -}}
+#!/usr/bin/env bash
+
+{{ $version := "3.3a" -}}
+
+set -xe
+
+TMP_BUILD_DIR=/tmp/tmux-install-dir
+mkdir -p "$TMP_BUILD_DIR"
+pushd "$TMP_BUILD_DIR"
+
+curl -L https://github.com/tmux/tmux/releases/download/{{ $version }}/tmux-{{ $version }}.tar.gz | tar xz
+pushd tmux-{{ $version }}
+./configure --prefix /usr/local/
+make -j
+sudo make install
+
+cd
+
+rm -rf "$TMP_BUILD_DIR"
+
+{{ end }}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/.chezmoiscripts/run_onchange_after_20-install-rtx-and-plugins.sh.tmpl	Tue Dec 05 20:03:16 2023 +0100
@@ -0,0 +1,18 @@
+{{ if (and (eq .chezmoi.os "linux") (eq .chezmoi.osRelease.name "Ubuntu" )) -}}
+#!/usr/bin/env bash
+
+set -xe
+
+# tool-versions hash: {{ include "dot_tool-versions" | sha256sum }}
+
+RTX_BIN=$HOME/bin/rxt
+curl https://github.com/jdx/rtx/releases/download/v2023.12.8/rtx-v2023.12.8-linux-x64 > $RTX_BIN
+chmod +x $RTX_BIN
+
+$RTX_BIN install --verbose --yes
+mkdir -p $XDG_CONFIG_HOME/direnv/lib
+$RTX_BIN direnv activate > $XDG_CONFIG_HOME/direnv/lib/use_rtx.sh
+$RTX_BIN completion zsh > ~/.zsh/completetions
+
+
+{{ end }}
--- a/dot_zshrc	Sun Dec 03 22:24:26 2023 +0100
+++ b/dot_zshrc	Tue Dec 05 20:03:16 2023 +0100
@@ -310,13 +310,8 @@
 
 [ -f ~/.zshrc.local ] && source ~/.zshrc.local
 
-source $HOME/.asdf/asdf.sh
-fpath=(${ASDF_DIR}/completions $fpath)
-
-if [ -f "${XDG_CONFIG_HOME:-$HOME/.config}/asdf-direnv/zshrc" ]
-then
-  source "${XDG_CONFIG_HOME:-$HOME/.config}/asdf-direnv/zshrc"
-fi
+eval "$($HOME/bin/rtx activate zsh)"
+eval "$($HOME/bin/rtx hook-env)"
 
 export SUDO_EDITOR=$(which nvim)
 eval "$(direnv hook zsh)"