ENH use config switches to control bootstrap scripts

This commit is contained in:
Nathan Dwarshuis 2022-07-20 23:11:57 -04:00
parent bb98297669
commit 1dd1ac18e5
6 changed files with 60 additions and 64 deletions

View File

@ -2,9 +2,15 @@ diff:
args: --color
pager: less -r
{{- $desktop := promptBool "desktop" false }}
{{- $laptop := and $desktop (promptBool "laptop" false) }}
{{- $emacs := and $desktop (promptBool "emacs" true) }}
{{ $desktop := promptBool "desktop" false -}}
{{- $laptop := and $desktop (promptBool "laptop" false) -}}
{{- $emacs := and $desktop (promptBool "emacs" true) -}}
{{- $xdg_config_home := .chezmoi.homeDir | printf "%s/.config" -}}
{{- $xdg_cache_home := .chezmoi.homeDir | printf "%s/.cache" -}}
{{- $xdg_data_home := .chezmoi.homeDir | printf "%s/.local/share" -}}
{{- $xdg_runtime_dir := output "id" "-u" | trim | printf "/run/user/%s" -}}
data:
desktop: {{ $desktop }}
laptop: {{ $laptop }}
@ -17,15 +23,23 @@ data:
f5vpn: {{ and $desktop (promptBool "f5vpn" false) }}
seafile: {{ and $desktop (promptBool "seafile" false) }}
development:
{{- /* emacs implies that most development options are true */}}
{{- /* emacs implies that most development options are true */}}
emacs: {{ $emacs }}
ruby: {{ or $emacs promptBool "ruby development" true }}
python: {{ or $emacs promptBool "python development" true }}
rust: {{ or $emacs promptBool "rust development" true }}
clojure: {{ or $emacs promptBool "clojure development" true }}
latex: {{ or $emacs promptBool "LaTeX development" true }}
r: {{ or $emacs promptBool "R development" true }}
ruby: {{ or $emacs promptBool "ruby" true }}
python: {{ or $emacs promptBool "python" true }}
rust: {{ or $emacs promptBool "rust" true }}
clojure: {{ or $emacs promptBool "clojure" true }}
latex: {{ or $emacs promptBool "LaTeX" true }}
r: {{ or $emacs promptBool "R" true }}
conda: {{ or $emacs promptBool "conda" true }}
{{- /* these aren't implied by emacs */}}
matlab: {{ or $emacs promptBool "MATLAB development" true }}
github: {{ promptBool "GitHub development" true }}
{{- /* these aren't implied by emacs */}}
matlab: {{ or $emacs promptBool "MATLAB" true }}
github: {{ promptBool "GitHub" true }}
paths:
config: {{ $xdg_config_home }}
cache: {{ $xdg_cache_home }}
data: {{ $xdg_data_home }}
runtime: {{ $xdg_runtime_dir }}
stack: {{ $xdg_data_home }}/stack

View File

@ -1,18 +1,22 @@
{{- if eq .chezmoi.hostname "petrucci4prez" }}
{{- if .development.emacs }}
.config/emacs:
type: git-repo
url: https://github.com/ndwarshuis/.emacs.d.git
{{- end }}
{{- if .desktop }}
.config/rofi-extras:
type: git-repo
url: https://github.com/ndwarshuis/rofi-extras.git
.config/xman:
type: git-repo
url: https://github.com/ndwarshuis/xman.git
.config/xmonad:
type: git-repo
url: https://github.com/ndwarshuis/xmonad-config.git
.config/conky:
type: git-repo
url: https://github.com/ndwarshuis/conky.git
url: https://github.com/ndwarshuis/universal-conky.git
clone-args: --recurse-submodules
{{- end }}
{{- if .features.virtualbox }}
.config/xman:
type: git-repo
url: https://github.com/ndwarshuis/xman.git
{{- end }}

View File

@ -14,8 +14,10 @@ run_stack_in_dir () {
cd "$cur" || return 1
}
export STACK_ROOT=~/.local/share/stack
export STACK_ROOT={{ .paths.stack }}
run_stack_in_dir ~/.config/rofi-extras
run_stack_in_dir ~/.config/xmonad
{{ if .features.virtualbox -}}
run_stack_in_dir ~/.config/xman
{{- end }}

View File

@ -46,33 +46,32 @@ run_install_scripts() {
}
run_yay() {
dunst_pkgs=(dunst)
gtk_pkgs=(zuki-themes)
redshift_pkgs=(redshift)
seafile_pkgs=(seafile-client)
urxvt_pkgs=(rxvt-unicode urxvt-perls)
zsh_pkgs=(zsh zsh-completions zsh-syntax-highlighting)
# notifications
pkgs=(dunst)
# gtk
pkgs+=(zuki-themes)
# sleep enhancement
pkgs+=(redshift)
{{ if .features.seafile -}}
# seafile
pkgs+=(seafile-client)
{{- end }}
# elegant terminal
pkgs+=(rxvt-unicode urxvt-perls)
# shell
pkgs+=(zsh zsh-completions zsh-syntax-highlighting)
## AUR pkgs needed for spotify
spotify_pkgs=(gconf)
yay --needed --noconfirm --norebuild --removemake -S \
"${dunst_pkgs[@]}" \
"${gtk_pkgs[@]}" \
"${redshift_pkgs[@]}" \
"${seafile_pkgs[@]}" \
"${urxvt_pkgs[@]}" \
"${zsh_pkgs[@]}" \
"${spotify_pkgs[@]}"
yay --needed --noconfirm --norebuild --removemake -S "${pkgs[@]}"
}
run_makepkg() {
## these are all packages that have some personal customizations and/or are
## not in the AUR
## TODO the clevo thingy requires a systemd file to turn on/off
{{ if .features.clevo -}}
call_makepkg "clevo-xsm-wmi-dkms"
{{- end }}
call_makepkg "conky-lua"
call_makepkg "spotify"
call_makepkg "xkb-hypermode"
}

View File

@ -1,23 +0,0 @@
#! /bin/bash
# This script pulls all my git repos that I use in my config and builds whatever
# is in them as necessary. It will only pull them if they don't exist. Rather
# than use the import approach suggested in the chezmoi howto, this doesn't
# require me to keep 'syncing' changes when I work in these repos directly. The
# tradeoff is that it will only pull the latest master, which is totally fine
# with me.
clone_maybe () {
if [ ! -d "$2" ]; then
echo cloning git repo: "$1"
git clone --recurse-submodules "$1" "$2"
else
echo git repo already exists: "$1"
fi
}
clone_maybe https://github.com/ndwarshuis/.emacs.d.git ~/.config/emacs
clone_maybe https://github.com/ndwarshuis/rofi-extras.git ~/.config/rofi-extras
clone_maybe https://github.com/ndwarshuis/xman.git ~/.config/xman
clone_maybe https://github.com/ndwarshuis/xmonad-config.git ~/.config/xmonad
clone_maybe https://github.com/ndwarshuis/conky.git ~/.config/conky

View File

@ -2,10 +2,10 @@
PATH OVERRIDE={{ .chezmoi.homeDir }}/.bin:{{ .chezmoi.homeDir }}/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/bin
# default directories
XDG_CONFIG_HOME DEFAULT={{ .chezmoi.homeDir }}/.config
XDG_CACHE_HOME DEFAULT={{ .chezmoi.homeDir }}/.cache
XDG_DATA_HOME DEFAULT={{ .chezmoi.homeDir }}/.local/share
XDG_RUNTIME_DIR DEFAULT=/run/user/{{ output "id" "-u" | trim }}
XDG_CONFIG_HOME DEFAULT={{ .paths.config }}
XDG_CACHE_HOME DEFAULT={{ .paths.cache }}
XDG_DATA_HOME DEFAULT={{ .paths.data }}
XDG_RUNTIME_DIR DEFAULT={{ .paths.runtime }}
# super common tools
PAGER DEFAULT=less