mirror of
https://github.com/Xevion/dotfiles.git
synced 2025-12-10 10:07:05 -06:00
Separate apt packages into install-only & always-updated targets, use proper chezmoi comments
This commit is contained in:
@@ -2,8 +2,8 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -xeu
|
set -xeu
|
||||||
|
|
||||||
# This script is intended to be idempotent and should be safe to run multiple times.
|
{{/* This script is intended to be idempotent and should be safe to run multiple times. */ -}}
|
||||||
# No custom packages should be expected to be installed by default.
|
{{/* No custom packages should be expected to be installed by default. */ -}}
|
||||||
|
|
||||||
{{ if .wsl }}
|
{{ if .wsl }}
|
||||||
# WSL-specific commands
|
# WSL-specific commands
|
||||||
@@ -12,7 +12,7 @@ set -xeu
|
|||||||
sudo apt install -y xclip xsel
|
sudo apt install -y xclip xsel
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
# TODO: Add basic yes/no prompts before installing packages
|
{{/* TODO: Add basic yes/no prompts before installing packages */ -}}
|
||||||
if ! type -P zsh; then
|
if ! type -P zsh; then
|
||||||
echo "chezmoi: Installing zsh"
|
echo "chezmoi: Installing zsh"
|
||||||
sudo apt install zsh
|
sudo apt install zsh
|
||||||
@@ -26,9 +26,23 @@ if ! type -P micro; then
|
|||||||
sudo mv ./micro /usr/bin/micro
|
sudo mv ./micro /usr/bin/micro
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# libpq-dev libssh-dev libsqlite3-dev
|
{{/* libpq-dev libssh-dev libsqlite3-dev */ -}}
|
||||||
echo "chezmoi: Installing apt packages"
|
echo "chezmoi: Installing apt packages"
|
||||||
sudo apt install -y iperf3 ripgrep unzip p7zip-full zsh fish nmap curl git reptyr sqlite
|
PACKAGES='git zsh fish sqlite curl ripgrep' # Install and/or update
|
||||||
|
sudo apt install -y $PACKAGES
|
||||||
|
|
||||||
|
INSTALL_ONLY_PACKAGES='iperf3 unzip p7zip-full nmap reptyr' # Install only if missing
|
||||||
|
MISSING_PACKAGES=""
|
||||||
|
for pkg in $INSTALL_ONLY_PACKAGES; do
|
||||||
|
if ! dpkg -l $pkg >/dev/null 2>&1; then
|
||||||
|
MISSING_PACKAGES="$MISSING_PACKAGES $pkg"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ -n "$MISSING_PACKAGES" ]; then
|
||||||
|
echo "chezmoi: The following packages are missing and will be installed: $MISSING_PACKAGES"
|
||||||
|
sudo apt install -y $MISSING_PACKAGES
|
||||||
|
fi
|
||||||
|
|
||||||
# Install hishtory
|
# Install hishtory
|
||||||
if ! type -P hishtory; then
|
if ! type -P hishtory; then
|
||||||
|
|||||||
Reference in New Issue
Block a user