changeset 663:fdce323431f4

Add asdf and config for python, neovim and direnv
author zegervdv <zegervdv@me.com>
date Tue, 27 Sep 2022 05:55:05 +0000
parents b137de67217b
children a061086e1172
files .chezmoiscripts/run_onchange_after_10-install-brew-packages.sh.tmpl .chezmoiscripts/run_onchange_after_20-install-asdf-plugins.sh.tmpl dot_Brewfile dot_default-python-packages dot_tool-versions dot_zshrc
diffstat 6 files changed, 43 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/.chezmoiscripts/run_onchange_after_10-install-brew-packages.sh.tmpl	Tue Sep 27 05:55:05 2022 +0000
@@ -0,0 +1,8 @@
+{{ if (or (eq .chezmoi.os "linux") (eq .chezmoi.os "darwin")) -}}
+#!/usr/bin/env bash
+
+# Brewfile hash: {{ include "dot_Brewfile" | sha256sum }}
+
+brew bundle --global
+
+{{ end -}}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/.chezmoiscripts/run_onchange_after_20-install-asdf-plugins.sh.tmpl	Tue Sep 27 05:55:05 2022 +0000
@@ -0,0 +1,21 @@
+{{ if (or (eq .chezmoi.os "linux") (eq .chezmoi.os "darwin")) -}}
+#!/usr/bin/env bash
+
+# asdf globals tools hash: {{ include "dot_tool-versions" | sha256sum }}
+
+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 install
+
+{{ end -}}
--- a/dot_Brewfile	Mon Sep 26 14:26:48 2022 +0000
+++ b/dot_Brewfile	Tue Sep 27 05:55:05 2022 +0000
@@ -9,12 +9,10 @@
 brew "chezmoi"
 brew "mercurial"
 brew "mosh", args: ["HEAD"]
-brew "neovim", args: ["HEAD"]
 brew "ripgrep"
 brew "scc"
 brew "universal-ctags/universal-ctags/universal-ctags", args: ["HEAD"]
 brew "fzf"
-brew "direnv"
 brew "stylua"
 brew "shellcheck"
 brew "jq"
@@ -26,3 +24,4 @@
 brew "git"
 brew "zegervdv/tools/cbfmt"
 brew "pass"
+brew "asdf"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dot_default-python-packages	Tue Sep 27 05:55:05 2022 +0000
@@ -0,0 +1,1 @@
+poetry
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dot_tool-versions	Tue Sep 27 05:55:05 2022 +0000
@@ -0,0 +1,2 @@
+python 3.10.7
+neovim ref:master
--- a/dot_zshrc	Mon Sep 26 14:26:48 2022 +0000
+++ b/dot_zshrc	Tue Sep 27 05:55:05 2022 +0000
@@ -234,6 +234,16 @@
 
 export PS_FORMAT='pid,pgid,state,start_time,%cpu,command'
 
+if command -v brew &> /dev/null
+then
+  source $(brew --prefix asdf)/libexec/asdf.sh
+fi
+
+if [ -f "${XDG_CONFIG_HOME:-$HOME/.config}/asdf-direnv/zshrc" ]
+then
+  source "${XDG_CONFIG_HOME:-$HOME/.config}/asdf-direnv/zshrc"
+fi
+
 [ -f ~/.zshrc.local ] && source ~/.zshrc.local
 
 # Must run after brew is loaded