Skip to content

Commit 254ff5f

Browse files
committed
install_linux: add mise to server preset, normalize formatting
1 parent ea11023 commit 254ff5f

1 file changed

Lines changed: 88 additions & 84 deletions

File tree

install_linux.sh

Lines changed: 88 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -67,32 +67,32 @@ EXTRAS_APT_PACKAGES=(
6767

6868
while [[ $# -gt 0 ]]; do
6969
case $1 in
70-
-y|--yes)
71-
AUTO_YES=true
72-
shift
73-
;;
74-
-p|--preset)
75-
PRESET="$2"
76-
shift 2
77-
;;
78-
-h|--help)
79-
echo "Usage: $0 [OPTIONS]"
80-
echo ""
81-
echo "Options:"
82-
echo " -y, --yes Non-interactive mode"
83-
echo " -p, --preset PRESET Installation preset (full, core, server, extras)"
84-
echo " -h, --help Show this help message"
85-
echo ""
86-
echo "Presets:"
87-
echo " full - Workstation: all tools + runtimes + k8s"
88-
echo " core - Dev server: shell, editor, k8s, cloud tools"
89-
echo " server - Homelab/Pi: shell, editor, stow only (default)"
90-
echo " extras - Extra apt packages only"
91-
exit 0
92-
;;
93-
*)
94-
shift
95-
;;
70+
-y | --yes)
71+
AUTO_YES=true
72+
shift
73+
;;
74+
-p | --preset)
75+
PRESET="$2"
76+
shift 2
77+
;;
78+
-h | --help)
79+
echo "Usage: $0 [OPTIONS]"
80+
echo ""
81+
echo "Options:"
82+
echo " -y, --yes Non-interactive mode"
83+
echo " -p, --preset PRESET Installation preset (full, core, server, extras)"
84+
echo " -h, --help Show this help message"
85+
echo ""
86+
echo "Presets:"
87+
echo " full - Workstation: all tools + runtimes + k8s"
88+
echo " core - Dev server: shell, editor, k8s, cloud tools"
89+
echo " server - Homelab/Pi: shell, editor, stow only (default)"
90+
echo " extras - Extra apt packages only"
91+
exit 0
92+
;;
93+
*)
94+
shift
95+
;;
9696
esac
9797
done
9898

@@ -110,15 +110,15 @@ print_status() {
110110
local status=$1
111111
local message=$2
112112
case $status in
113-
"ok") echo -e " ${GREEN}${NC} $message" ;;
114-
"skip") echo -e " ${YELLOW}${NC} $message ${YELLOW}(already installed)${NC}" ;;
115-
"install") echo -e " ${BLUE}${NC} $message" ;;
116-
"error") echo -e " ${RED}${NC} $message" ;;
113+
"ok") echo -e " ${GREEN}${NC} $message" ;;
114+
"skip") echo -e " ${YELLOW}${NC} $message ${YELLOW}(already installed)${NC}" ;;
115+
"install") echo -e " ${BLUE}${NC} $message" ;;
116+
"error") echo -e " ${RED}${NC} $message" ;;
117117
esac
118118
}
119119

120120
is_installed() {
121-
command -v "$1" &> /dev/null
121+
command -v "$1" &>/dev/null
122122
}
123123

124124
confirm() {
@@ -130,10 +130,10 @@ confirm() {
130130

131131
detect_arch() {
132132
case $(uname -m) in
133-
x86_64) echo "amd64" ;;
134-
aarch64) echo "arm64" ;;
135-
armv7l) echo "arm" ;;
136-
*) echo "unknown" ;;
133+
x86_64) echo "amd64" ;;
134+
aarch64) echo "arm64" ;;
135+
armv7l) echo "arm" ;;
136+
*) echo "unknown" ;;
137137
esac
138138
}
139139

@@ -216,7 +216,7 @@ install_eza() {
216216
print_status "install" "Adding eza repository..."
217217
sudo mkdir -p /etc/apt/keyrings
218218
wget -qO- https://raw.githubusercontent.com/eza-community/eza/main/deb.asc | sudo gpg --dearmor -o /etc/apt/keyrings/gierens.gpg 2>/dev/null || true
219-
echo "deb [signed-by=/etc/apt/keyrings/gierens.gpg] http://deb.gierens.de stable main" | sudo tee /etc/apt/sources.list.d/gierens.list > /dev/null
219+
echo "deb [signed-by=/etc/apt/keyrings/gierens.gpg] http://deb.gierens.de stable main" | sudo tee /etc/apt/sources.list.d/gierens.list >/dev/null
220220
sudo chmod 644 /etc/apt/keyrings/gierens.gpg /etc/apt/sources.list.d/gierens.list 2>/dev/null || true
221221
sudo apt-get update
222222
sudo apt-get install -y eza
@@ -233,9 +233,9 @@ install_gh_cli() {
233233

234234
print_status "install" "Adding GitHub CLI repository..."
235235
sudo mkdir -p /etc/apt/keyrings
236-
wget -qO- https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null
236+
wget -qO- https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo tee /etc/apt/keyrings/githubcli-archive-keyring.gpg >/dev/null
237237
sudo chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg
238-
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
238+
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list >/dev/null
239239
sudo apt-get update
240240
sudo apt-get install -y gh
241241
print_status "ok" "GitHub CLI installed"
@@ -315,9 +315,12 @@ install_delta() {
315315
arch=$(detect_arch)
316316
local deb_arch
317317
case $arch in
318-
amd64) deb_arch="amd64" ;;
319-
arm64) deb_arch="arm64" ;;
320-
*) print_status "error" "Unsupported architecture for delta"; return 1 ;;
318+
amd64) deb_arch="amd64" ;;
319+
arm64) deb_arch="arm64" ;;
320+
*)
321+
print_status "error" "Unsupported architecture for delta"
322+
return 1
323+
;;
321324
esac
322325

323326
print_status "install" "Downloading delta..."
@@ -342,7 +345,7 @@ install_kubectl() {
342345
print_status "install" "Adding Kubernetes repository..."
343346
sudo mkdir -p /etc/apt/keyrings
344347
curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.31/deb/Release.key | sudo gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg 2>/dev/null || true
345-
echo "deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.31/deb/ /" | sudo tee /etc/apt/sources.list.d/kubernetes.list > /dev/null
348+
echo "deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.31/deb/ /" | sudo tee /etc/apt/sources.list.d/kubernetes.list >/dev/null
346349
sudo apt-get update
347350
sudo apt-get install -y kubectl
348351
print_status "ok" "kubectl installed"
@@ -575,6 +578,7 @@ run_server() {
575578
install_eza
576579
install_oh_my_posh
577580
install_zoxide
581+
install_mise
578582
install_stow
579583
}
580584

@@ -583,29 +587,29 @@ run_extras() {
583587
}
584588

585589
run_custom() {
586-
IFS=' ' read -ra components <<< "$(run_custom_menu)"
590+
IFS=' ' read -ra components <<<"$(run_custom_menu)"
587591
ensure_dirs
588592
for comp in "${components[@]}"; do
589593
case $comp in
590-
server_apt) install_apt_packages "Server" "${SERVER_APT_PACKAGES[@]}" ;;
591-
core_apt) install_apt_packages "Core" "${CORE_APT_PACKAGES[@]}" ;;
592-
extras_apt) install_apt_packages "Extras" "${EXTRAS_APT_PACKAGES[@]}" ;;
593-
eza) install_eza ;;
594-
gh) install_gh_cli ;;
595-
oh_my_posh) install_oh_my_posh ;;
596-
zoxide) install_zoxide ;;
597-
mise) install_mise ;;
598-
yq) install_yq ;;
599-
delta) install_delta ;;
600-
stow) install_stow ;;
601-
runtimes) install_mise_runtimes ;;
602-
k8s)
603-
install_kubectl
604-
install_kubectx
605-
install_k9s
606-
install_helm
607-
;;
608-
krew) install_krew ;;
594+
server_apt) install_apt_packages "Server" "${SERVER_APT_PACKAGES[@]}" ;;
595+
core_apt) install_apt_packages "Core" "${CORE_APT_PACKAGES[@]}" ;;
596+
extras_apt) install_apt_packages "Extras" "${EXTRAS_APT_PACKAGES[@]}" ;;
597+
eza) install_eza ;;
598+
gh) install_gh_cli ;;
599+
oh_my_posh) install_oh_my_posh ;;
600+
zoxide) install_zoxide ;;
601+
mise) install_mise ;;
602+
yq) install_yq ;;
603+
delta) install_delta ;;
604+
stow) install_stow ;;
605+
runtimes) install_mise_runtimes ;;
606+
k8s)
607+
install_kubectl
608+
install_kubectx
609+
install_k9s
610+
install_helm
611+
;;
612+
krew) install_krew ;;
609613
esac
610614
done
611615
}
@@ -630,35 +634,35 @@ main() {
630634
if [[ -n "$PRESET" ]]; then
631635
# Preset mode
632636
case $PRESET in
633-
full) choice="1" ;;
634-
core) choice="2" ;;
635-
server) choice="3" ;;
636-
extras) choice="4" ;;
637-
*)
638-
echo -e "${RED}Error: Unknown preset '$PRESET'. Use: full, core, server, extras${NC}"
639-
exit 1
640-
;;
637+
full) choice="1" ;;
638+
core) choice="2" ;;
639+
server) choice="3" ;;
640+
extras) choice="4" ;;
641+
*)
642+
echo -e "${RED}Error: Unknown preset '$PRESET'. Use: full, core, server, extras${NC}"
643+
exit 1
644+
;;
641645
esac
642646
elif $AUTO_YES; then
643-
choice="3" # Default to server in non-interactive mode
647+
choice="3" # Default to server in non-interactive mode
644648
else
645649
choice=$(show_menu)
646650
fi
647651

648652
case $choice in
649-
1) run_full ;;
650-
2) run_core ;;
651-
3) run_server ;;
652-
4) run_extras ;;
653-
5) run_custom ;;
654-
6)
655-
echo "Exiting."
656-
exit 0
657-
;;
658-
*)
659-
echo "Invalid option"
660-
exit 1
661-
;;
653+
1) run_full ;;
654+
2) run_core ;;
655+
3) run_server ;;
656+
4) run_extras ;;
657+
5) run_custom ;;
658+
6)
659+
echo "Exiting."
660+
exit 0
661+
;;
662+
*)
663+
echo "Invalid option"
664+
exit 1
665+
;;
662666
esac
663667

664668
print_header "Done!"

0 commit comments

Comments
 (0)