From 579c84dd5d9f4df756719219e78057a73f7a9d1f Mon Sep 17 00:00:00 2001 From: Jeff LANCE Date: Wed, 28 Feb 2024 21:38:45 +0100 Subject: [PATCH] Up. --- home/.chezmoiscripts/backup/common.lib | 118 ++++++++++++++++++ ...onchange_after_10-install-packages.sh.tmpl | 33 ++--- .../run_onchange_after_20-config-zim.sh | 11 -- .../run_onchange_after_20-config-zim.sh.tmpl | 62 +++++++++ ...run_onchange_after_80-install-lvim.sh.tmpl | 34 ++--- home/.chezmoiscripts/common.lib | 118 ++++++++++++++++++ ...nchange_after_10-install-packages.sh.tmpl} | 83 +++++++----- .../run_onchange_after_20-config-zim.sh.tmpl | 62 +++++++++ ...un_onchange_after_20-install-shell.sh.tmpl | 35 ------ ...run_onchange_after_80-install-lvim.sh.tmpl | 75 ++++++++--- 10 files changed, 500 insertions(+), 131 deletions(-) create mode 100644 home/.chezmoiscripts/backup/common.lib delete mode 100644 home/.chezmoiscripts/backup/run_onchange_after_20-config-zim.sh create mode 100644 home/.chezmoiscripts/backup/run_onchange_after_20-config-zim.sh.tmpl create mode 100644 home/.chezmoiscripts/common.lib rename home/.chezmoiscripts/{run_onchange_after_10-install-packages-base.sh.tmpl => run_onchange_after_10-install-packages.sh.tmpl} (70%) create mode 100644 home/.chezmoiscripts/run_onchange_after_20-config-zim.sh.tmpl delete mode 100644 home/.chezmoiscripts/run_onchange_after_20-install-shell.sh.tmpl diff --git a/home/.chezmoiscripts/backup/common.lib b/home/.chezmoiscripts/backup/common.lib new file mode 100644 index 0000000..3c05504 --- /dev/null +++ b/home/.chezmoiscripts/backup/common.lib @@ -0,0 +1,118 @@ +# +# common.lib +# +# Common libray for local scripts +# + + + +# CONSTANT VARIABLES +RESET=$(tput sgr0) + +F_BOLD=$(tput bold) +F_UNDL=$(tput sgr 0 1) + +C_BLK=$(tput setaf 0) +C_RED=$(tput setaf 1) +C_GRE=$(tput setaf 2) +C_YEL=$(tput setaf 3) +C_BLU=$(tput setaf 4) +C_MAG=$(tput setaf 5) +C_CYA=$(tput setaf 6) +C_WHI=$(tput setaf 7) + +# common errors will cause the script to +# immediately fail, explicitly and loudly. +set -euxo pipefail + +# function used to display colored message +cecho () { + + declare -A colors; + declare -A formats; + + colors=(\ + ['black']=$(tput setaf 0)\ + ['red']=$(tput setaf 1)\ + ['green']=$(tput setaf 2)\ + ['yellow']=$(tput setaf 3)\ + ['blue']=$(tput setaf 4)\ + ['magenta']=$(tput setaf 5)\ + ['cyan']=$(tput setaf 6)\ + ['white']=$(tput setaf 7)\ + ); + + formats=(\ + ['default']=$(tput sgr0)\ + ['inverse']=$(tput smso)\ + ['bold']=$(tput bold)\ + ); + + local defaultMSG="No message passed."; + local defaultColor="white"; + local defaultFormat="default"; + local defaultNewLine=true; + + while [[ $# -gt 1 ]]; + do + key="$1"; + + case $key in + -c|--color) + color="$2"; + shift; + ;; + -f|--format) + format="$2"; + shift; + ;; + -n|--noline) + newLine=false; + ;; + *) + # unknown option + ;; + esac + shift; + done + + color=${color:-$defaultColor}; # Defaults to default color, if not specified. + format=${format:-$defaultFormat}; # Defaults to default color, if not specified. + newLine=${newLine:-$defaultNewLine}; + message=${1:-$defaultMSG}; # Defaults to default message. + + echo -en "${formats[$format]}${colors[$color]}"; + echo -en "$message"; + if [ "$newLine" = true ] ; then + echo; + fi + tput sgr0; # Reset text attributes to normal without clearing screen. + + return; +} + + + +info1() { + cecho -c 'blue' -f 'bold' "$@"; +} + +info2() { + cecho -c 'cyan' -f 'bold' "$@"; +} + +success() { + cecho -c 'green' "$@"; +} + +error() { + cecho -c 'red' -f 'bold' "$@"; +} + +warning() { + cecho -c 'yellow' "$@"; +} + + + +/* vim: set filetype=bash : */ diff --git a/home/.chezmoiscripts/backup/run_onchange_after_10-install-packages.sh.tmpl b/home/.chezmoiscripts/backup/run_onchange_after_10-install-packages.sh.tmpl index d16e84d..2218b88 100644 --- a/home/.chezmoiscripts/backup/run_onchange_after_10-install-packages.sh.tmpl +++ b/home/.chezmoiscripts/backup/run_onchange_after_10-install-packages.sh.tmpl @@ -1,24 +1,25 @@ #!/usr/bin/env bash -set -euxo pipefail +# Load local library +. ./common.lib + + packages=( curl direnv ranger - starship tmux trash-cli unzip wget zip zoxide - zsh ) {{ if (eq .chezmoi.osRelease.id "manjaro" "arch") -}} - echo -e "\033[0;32m>>>>> Begin Arch/Manjaro Linux packages installation <<<<<\033[0m" + info1 ">>>>> Begin Arch/Manjaro Linux packages installation <<<<<" ## Update system {{- if ne .chezmoi.username "root" }} @@ -29,7 +30,7 @@ packages=( ## Install yay if [ ! $(command -v yay) ]; then - echo "installing yay" + info2 "installing yay" {{- if ne .chezmoi.username "root" }} sudo pacman -S --needed --noconfirm git base-devel {{- else}} @@ -44,23 +45,18 @@ packages=( ## Install packages for package in ${packages[@]}; do if [ "$(yay -Qq $package 2> /dev/null)" != $package ]; then - echo "installing ${package}..." - - {{- if ne .chezmoi.username "root" }} - sudo yay -S --noconfirm $package - {{- else }} - yay -S --noconfirm $package - {{- end }} + info2 "installing ${package}..." + yay -S --noconfirm $package fi done - echo -e "\033[0;32m>>>>> Finish Arch/Manjaro Linux packages installation <<<<<\033[0m" + info1 ">>>>> Finish Arch/Manjaro Linux packages installation <<<<<" {{ else if (eq .chezmoi.osRelease.id "debian" "ubuntu") -}} - echo -e "\033[0;32m>>>>> Begin Debian/Ubuntu Linux packages installation <<<<<\033[0m" + info1 ">>>>> Begin Debian/Ubuntu Linux packages installation <<<<<" - export DEBIAN_FRONTEND=noninteractive + DEBIAN_FRONTEND=noninteractive ## Add repositories and update system {{- if ne .chezmoi.username "root" }} @@ -95,13 +91,12 @@ packages=( doxygen libtool libtool-bin - mist ninja-build pkg-config ) for package in ${packages[@]}; do - echo "installing ${package}..." + info2 "installing ${package}..." {{- if ne .chezmoi.username "root" }} sudo -E apt-get install --yes --no-install-recommends --ignore-missing $package @@ -110,9 +105,7 @@ packages=( {{- end }} done - mist install starship-bin - - echo -e "\033[0;32m>>>>> Finish Debian/Ubuntu Linux packages installation <<<<<\033[0m" + info1 ">>>>> Finish Debian/Ubuntu Linux packages installation <<<<<" {{- end }} diff --git a/home/.chezmoiscripts/backup/run_onchange_after_20-config-zim.sh b/home/.chezmoiscripts/backup/run_onchange_after_20-config-zim.sh deleted file mode 100644 index 9f84410..0000000 --- a/home/.chezmoiscripts/backup/run_onchange_after_20-config-zim.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env bash - -ZIMDIR=${HOME}/.zim - -echo -e "\033[0;32m>>>>> Installing Zim Framework <<<<<\033[0m" -$(which zsh) -c "source ${ZIMDIR}/zimfw.zsh init -q" - -echo -e "\033[0;32m>>>>> Finish zsh installation <<<<<\033[0m" - -exit 0 - diff --git a/home/.chezmoiscripts/backup/run_onchange_after_20-config-zim.sh.tmpl b/home/.chezmoiscripts/backup/run_onchange_after_20-config-zim.sh.tmpl new file mode 100644 index 0000000..dba3f54 --- /dev/null +++ b/home/.chezmoiscripts/backup/run_onchange_after_20-config-zim.sh.tmpl @@ -0,0 +1,62 @@ +#!/usr/bin/env bash + +# Load local library +. ./common.lib + + + +ZIMDIR=${HOME}/.zim + + + +packages=( + starship + zsh +) + + + +### Install Zsh ### +info1 ">>>>> Begin Zsh installation <<<<<" + +{{ if (eq .chezmoi.osRelease.id "manjaro" "arch") -}} + + ## install packages + for package in ${packages[@]}; do + if [ "$(yay -Qq $package 2> /dev/null)" != $package ]; then + info2 "installing ${package}..." + yay -S --noconfirm $package + fi + done + +{{ else if (eq .chezmoi.osRelease.id "debian" "ubuntu") -}} + DEBIAN_FRONTEND=noninteractive + + packages=(${packages[@]//starship/}) + + ## install packages + for package in ${packages[@]}; do + info2 "installing ${package}..." + + {{- if ne .chezmoi.username "root" }} + sudo -E apt-get install --yes --no-install-recommends --ignore-missing $package + {{- else }} + apt-get install --yes --no-install-recommends --ignore-missing $package + {{- end }} + done + + info2 "installing starship..." + mist install starship-bin + +{{- end }} + +info1 ">>>>> Finish Zsh installation <<<<<" + + +### Config Zsh ### +info1 ">>>>> Installing Zim Framework <<<<<" + +$(which zsh) -c "source ${ZIMDIR}/zimfw.zsh init -q" + +info1 ">>>>> Finish zsh installation <<<<<" + diff --git a/home/.chezmoiscripts/backup/run_onchange_after_80-install-lvim.sh.tmpl b/home/.chezmoiscripts/backup/run_onchange_after_80-install-lvim.sh.tmpl index c6be24a..f175bf0 100644 --- a/home/.chezmoiscripts/backup/run_onchange_after_80-install-lvim.sh.tmpl +++ b/home/.chezmoiscripts/backup/run_onchange_after_80-install-lvim.sh.tmpl @@ -1,6 +1,9 @@ #!/usr/bin/env bash -set -euxo pipefail +# Load local library +. ./common.lib + + packages=( cargo @@ -12,33 +15,26 @@ packages=( ripgrep ) -echo -e "\033[0;32m>>>>> Begin LVim installation <<<<<\033[0m" + + +info1 ">>>>> Begin LVim installation <<<<<" {{ if (eq .chezmoi.osRelease.id "manjaro" "arch") -}} ## Update system - {{- if ne .chezmoi.username "root" }} - sudo pacman -Syu --noconfirm - {{- else }} - pacman -Syu --noconfirm - {{- end}} + yay -Syu --noconfirm ## Install packages for package in ${packages[@]}; do if [ "$(yay -Qq $package 2> /dev/null)" != $package ]; then - echo "installing packages" - - {{- if ne .chezmoi.username "root" }} - sudo yay -S --noconfirm $package - {{- else }} - yay -S --noconfirm $package - {{- end }} + info2 "installing ${package}..." + yay -S --noconfirm $package fi done {{ else if (eq .chezmoi.osRelease.id "debian" "ubuntu") -}} - export DEBIAN_FRONTEND=noninteractive + DEBIAN_FRONTEND=noninteractive ## Update system {{- if ne .chezmoi.username "root" }} @@ -55,7 +51,7 @@ echo -e "\033[0;32m>>>>> Begin LVim installation <<<<<\033[0m" packages=(${packages[@]//neovim/}) for package in ${packages[@]}; do - echo "installing ${package}..." + info2 "installing ${package}..." {{- if ne .chezmoi.username "root" }} sudo -E apt-get install --yes --no-install-recommends --ignore-missing $package @@ -64,10 +60,14 @@ echo -e "\033[0;32m>>>>> Begin LVim installation <<<<<\033[0m" {{- end }} done + info2 "installing neovim..." mist install neovim {{- end }} +info2 "installing lvim..." LV_BRANCH='release-1.3/neovim-0.9' bash <(curl -s 'https://raw.githubusercontent.com/LunarVim/LunarVim/release-1.3/neovim-0.9/utils/installer/install.sh') -echo -e "\033[0;32m>>>>> Finish LVim installation <<<<<\033[0m" +info1 ">>>>> Finish LVim installation <<<<<" + + diff --git a/home/.chezmoiscripts/common.lib b/home/.chezmoiscripts/common.lib new file mode 100644 index 0000000..3c05504 --- /dev/null +++ b/home/.chezmoiscripts/common.lib @@ -0,0 +1,118 @@ +# +# common.lib +# +# Common libray for local scripts +# + + + +# CONSTANT VARIABLES +RESET=$(tput sgr0) + +F_BOLD=$(tput bold) +F_UNDL=$(tput sgr 0 1) + +C_BLK=$(tput setaf 0) +C_RED=$(tput setaf 1) +C_GRE=$(tput setaf 2) +C_YEL=$(tput setaf 3) +C_BLU=$(tput setaf 4) +C_MAG=$(tput setaf 5) +C_CYA=$(tput setaf 6) +C_WHI=$(tput setaf 7) + +# common errors will cause the script to +# immediately fail, explicitly and loudly. +set -euxo pipefail + +# function used to display colored message +cecho () { + + declare -A colors; + declare -A formats; + + colors=(\ + ['black']=$(tput setaf 0)\ + ['red']=$(tput setaf 1)\ + ['green']=$(tput setaf 2)\ + ['yellow']=$(tput setaf 3)\ + ['blue']=$(tput setaf 4)\ + ['magenta']=$(tput setaf 5)\ + ['cyan']=$(tput setaf 6)\ + ['white']=$(tput setaf 7)\ + ); + + formats=(\ + ['default']=$(tput sgr0)\ + ['inverse']=$(tput smso)\ + ['bold']=$(tput bold)\ + ); + + local defaultMSG="No message passed."; + local defaultColor="white"; + local defaultFormat="default"; + local defaultNewLine=true; + + while [[ $# -gt 1 ]]; + do + key="$1"; + + case $key in + -c|--color) + color="$2"; + shift; + ;; + -f|--format) + format="$2"; + shift; + ;; + -n|--noline) + newLine=false; + ;; + *) + # unknown option + ;; + esac + shift; + done + + color=${color:-$defaultColor}; # Defaults to default color, if not specified. + format=${format:-$defaultFormat}; # Defaults to default color, if not specified. + newLine=${newLine:-$defaultNewLine}; + message=${1:-$defaultMSG}; # Defaults to default message. + + echo -en "${formats[$format]}${colors[$color]}"; + echo -en "$message"; + if [ "$newLine" = true ] ; then + echo; + fi + tput sgr0; # Reset text attributes to normal without clearing screen. + + return; +} + + + +info1() { + cecho -c 'blue' -f 'bold' "$@"; +} + +info2() { + cecho -c 'cyan' -f 'bold' "$@"; +} + +success() { + cecho -c 'green' "$@"; +} + +error() { + cecho -c 'red' -f 'bold' "$@"; +} + +warning() { + cecho -c 'yellow' "$@"; +} + + + +/* vim: set filetype=bash : */ diff --git a/home/.chezmoiscripts/run_onchange_after_10-install-packages-base.sh.tmpl b/home/.chezmoiscripts/run_onchange_after_10-install-packages.sh.tmpl similarity index 70% rename from home/.chezmoiscripts/run_onchange_after_10-install-packages-base.sh.tmpl rename to home/.chezmoiscripts/run_onchange_after_10-install-packages.sh.tmpl index 0cdb37d..2218b88 100644 --- a/home/.chezmoiscripts/run_onchange_after_10-install-packages-base.sh.tmpl +++ b/home/.chezmoiscripts/run_onchange_after_10-install-packages.sh.tmpl @@ -1,10 +1,25 @@ #!/usr/bin/env bash -set -euxo pipefail +# Load local library +. ./common.lib + + + +packages=( + curl + direnv + ranger + tmux + trash-cli + unzip + wget + zip + zoxide +) {{ if (eq .chezmoi.osRelease.id "manjaro" "arch") -}} - echo -e "\033[0;32m>>>>> Begin Arch/Manjaro Linux packages installation <<<<<\033[0m" + info1 ">>>>> Begin Arch/Manjaro Linux packages installation <<<<<" ## Update system {{- if ne .chezmoi.username "root" }} @@ -15,16 +30,12 @@ set -euxo pipefail ## Install yay if [ ! $(command -v yay) ]; then - echo "installing yay" - - {{ range .packages_base.archlinux.pacman }} - {{- if ne .chezmoi.username "root" }} - sudo pacman -S --needed --noconfirm {{ . | quote }} - {{- else}} - pacman -S --needed --noconfirm {{ . | quote }} - {{- end }} - {{ end }} - + info2 "installing yay" + {{- if ne .chezmoi.username "root" }} + sudo pacman -S --needed --noconfirm git base-devel + {{- else}} + pacman -S --needed --noconfirm git base-devel + {{- end }} git clone https://aur.archlinux.org/yay.git /tmp/yay cd /tmp/yay makepkg -si --noconfirm @@ -32,18 +43,20 @@ set -euxo pipefail fi ## Install packages - {{ range .packages_base.archlinux.yay -}} - echo "installing {{ . | quote }}..." - yay -S --needed --noconfirm {{ . | quote }} - {{ end -}} + for package in ${packages[@]}; do + if [ "$(yay -Qq $package 2> /dev/null)" != $package ]; then + info2 "installing ${package}..." + yay -S --noconfirm $package + fi + done - echo -e "\033[0;32m>>>>> Finish Arch/Manjaro Linux packages installation <<<<<\033[0m" + info1 ">>>>> Finish Arch/Manjaro Linux packages installation <<<<<" {{ else if (eq .chezmoi.osRelease.id "debian" "ubuntu") -}} - echo -e "\033[0;32m>>>>> Begin Debian/Ubuntu Linux packages installation <<<<<\033[0m" + info1 ">>>>> Begin Debian/Ubuntu Linux packages installation <<<<<" - export DEBIAN_FRONTEND=noninteractive + DEBIAN_FRONTEND=noninteractive ## Add repositories and update system {{- if ne .chezmoi.username "root" }} @@ -69,16 +82,30 @@ set -euxo pipefail mist update ## Install packages - {{ range .packages_base.debian.apt -}} - echo "installing {{ . | quote }}..." - {{- if ne .chezmoi.username "root" }} - sudo -E apt-get install --yes --no-install-recommends --ignore-missing {{ . | quote }} - {{- else}} - apt-get install --yes --no-install-recommends --ignore-missing {{ . | quote }} - {{- end }} - {{ end -}} + packages=(${packages[@]//starship/makedeb}) + packages+=( + apt-utils + autoconf + automake + cmake + doxygen + libtool + libtool-bin + ninja-build + pkg-config + ) - echo -e "\033[0;32m>>>>> Finish Debian/Ubuntu Linux packages installation <<<<<\033[0m" + for package in ${packages[@]}; do + info2 "installing ${package}..." + + {{- if ne .chezmoi.username "root" }} + sudo -E apt-get install --yes --no-install-recommends --ignore-missing $package + {{- else }} + apt-get install --yes --no-install-recommends --ignore-missing $package + {{- end }} + done + + info1 ">>>>> Finish Debian/Ubuntu Linux packages installation <<<<<" {{- end }} diff --git a/home/.chezmoiscripts/run_onchange_after_20-config-zim.sh.tmpl b/home/.chezmoiscripts/run_onchange_after_20-config-zim.sh.tmpl new file mode 100644 index 0000000..dba3f54 --- /dev/null +++ b/home/.chezmoiscripts/run_onchange_after_20-config-zim.sh.tmpl @@ -0,0 +1,62 @@ +#!/usr/bin/env bash + +# Load local library +. ./common.lib + + + +ZIMDIR=${HOME}/.zim + + + +packages=( + starship + zsh +) + + + +### Install Zsh ### +info1 ">>>>> Begin Zsh installation <<<<<" + +{{ if (eq .chezmoi.osRelease.id "manjaro" "arch") -}} + + ## install packages + for package in ${packages[@]}; do + if [ "$(yay -Qq $package 2> /dev/null)" != $package ]; then + info2 "installing ${package}..." + yay -S --noconfirm $package + fi + done + +{{ else if (eq .chezmoi.osRelease.id "debian" "ubuntu") -}} + DEBIAN_FRONTEND=noninteractive + + packages=(${packages[@]//starship/}) + + ## install packages + for package in ${packages[@]}; do + info2 "installing ${package}..." + + {{- if ne .chezmoi.username "root" }} + sudo -E apt-get install --yes --no-install-recommends --ignore-missing $package + {{- else }} + apt-get install --yes --no-install-recommends --ignore-missing $package + {{- end }} + done + + info2 "installing starship..." + mist install starship-bin + +{{- end }} + +info1 ">>>>> Finish Zsh installation <<<<<" + + +### Config Zsh ### +info1 ">>>>> Installing Zim Framework <<<<<" + +$(which zsh) -c "source ${ZIMDIR}/zimfw.zsh init -q" + +info1 ">>>>> Finish zsh installation <<<<<" + diff --git a/home/.chezmoiscripts/run_onchange_after_20-install-shell.sh.tmpl b/home/.chezmoiscripts/run_onchange_after_20-install-shell.sh.tmpl deleted file mode 100644 index 6cf37a6..0000000 --- a/home/.chezmoiscripts/run_onchange_after_20-install-shell.sh.tmpl +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/env bash - -set -euxo pipefail - -ZIMDIR=${HOME}/.zim - -echo -e "\033[0;32m>>>>> Begin Zsh installation <<<<<\033[0m" - -{{ if (eq .chezmoi.osRelease.id "manjaro" "arch") -}} - - ## Install packages - {{ range .packages_shell.archlinux.yay -}} - echo "installing {{ . | quote }}..." - yay -S --needed --noconfirm {{ . | quote }} - {{ end -}} - -{{ else if (eq .chezmoi.osRelease.id "debian" "ubuntu") -}} - - ## Install packages - {{ range .packages_shell.debian.mist -}} - {{- if ne .chezmoi.username "root" }} - sudo -E apt-get install --yes --no-install-recommends --ignore-missing {{ . | quote }} - {{- else}} - apt-get install --yes --no-install-recommends --ignore-missing - {{- end }} - {{ end -}} - -{{- end }} - -echo -e "\033[0;32m>>>>> Installing Zim Framework <<<<<\033[0m" -$(which zsh) -c "source ${ZIMDIR}/zimfw.zsh init -q" -echo -e "\033[0;32m>>>>> Finish Zim Framework <<<<<\033[0m" - -echo -e "\033[0;32m>>>>> Finish zsh installation <<<<<\033[0m" - diff --git a/home/.chezmoiscripts/run_onchange_after_80-install-lvim.sh.tmpl b/home/.chezmoiscripts/run_onchange_after_80-install-lvim.sh.tmpl index 3ce8253..f175bf0 100644 --- a/home/.chezmoiscripts/run_onchange_after_80-install-lvim.sh.tmpl +++ b/home/.chezmoiscripts/run_onchange_after_80-install-lvim.sh.tmpl @@ -1,38 +1,73 @@ #!/usr/bin/env bash -set -euxo pipefail +# Load local library +. ./common.lib -echo -e "\033[0;32m>>>>> Begin LVim installation <<<<<\033[0m" + + +packages=( + cargo + go + neovim + npm + python-pip + python-pynvim + ripgrep +) + + + +info1 ">>>>> Begin LVim installation <<<<<" {{ if (eq .chezmoi.osRelease.id "manjaro" "arch") -}} + ## Update system + yay -Syu --noconfirm + ## Install packages - {{ range .packages_lvim.archlinux.yay -}} - echo "installing {{ . | quote }}..." - yay -S --needed --noconfirm {{ . | quote }} - {{ end -}} + for package in ${packages[@]}; do + if [ "$(yay -Qq $package 2> /dev/null)" != $package ]; then + info2 "installing ${package}..." + yay -S --noconfirm $package + fi + done {{ else if (eq .chezmoi.osRelease.id "debian" "ubuntu") -}} - export DEBIAN_FRONTEND=noninteractive + DEBIAN_FRONTEND=noninteractive + + ## Update system + {{- if ne .chezmoi.username "root" }} + sudo -E apt update + sudo -E apt upgrade --yes + {{- else }} + apt update + apt upgrade --yes + {{- end}} ## Install packages - {{ range .packages_base.debian.apt -}} - echo "installing {{ . | quote }}..." - {{- if ne .chezmoi.username "root" }} - sudo -E apt-get install --yes --no-install-recommends --ignore-missing {{ . | quote }} - {{- else}} - apt-get install --yes --no-install-recommends --ignore-missing {{ . | quote }} - {{- end }} - {{ end -}} + packages=(${packages[@]//go/golang}) + packages=(${packages[@]//python/python3}) + packages=(${packages[@]//neovim/}) - {{ range .packages_base.debian.mist -}} - echo "installing {{ . | quote }}..." - apt-get install --yes --no-install-recommends --ignore-missing {{ . | quote }} - {{ end -}} + for package in ${packages[@]}; do + info2 "installing ${package}..." + + {{- if ne .chezmoi.username "root" }} + sudo -E apt-get install --yes --no-install-recommends --ignore-missing $package + {{- else }} + apt-get install --yes --no-install-recommends --ignore-missing $package + {{- end }} + done + + info2 "installing neovim..." + mist install neovim {{- end }} +info2 "installing lvim..." LV_BRANCH='release-1.3/neovim-0.9' bash <(curl -s 'https://raw.githubusercontent.com/LunarVim/LunarVim/release-1.3/neovim-0.9/utils/installer/install.sh') -echo -e "\033[0;32m>>>>> Finish LVim installation <<<<<\033[0m" +info1 ">>>>> Finish LVim installation <<<<<" + +