mirror of
https://github.com/Xevion/dotfiles.git
synced 2025-12-15 12:11:40 -06:00
61 lines
1.8 KiB
Bash
61 lines
1.8 KiB
Bash
{{ if eq .chezmoi.os "linux" -}}
|
|
#!/bin/bash
|
|
set -eu
|
|
|
|
# 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.
|
|
|
|
{{ if .wsl }}
|
|
# WSL-specific commands
|
|
{{ else }}
|
|
# Non-WSL commands
|
|
sudo apt install -y xclip xsel
|
|
{{ end }}
|
|
|
|
# TODO: Add basic yes/no prompts before installing packages
|
|
if ! type -P zsh; then
|
|
echo "chezmoi: Installing zsh"
|
|
sudo apt install zsh
|
|
fi
|
|
|
|
# Install micro (+ register as text editor)
|
|
curl https://getmic.ro/r | sudo sh && sudo mv ./micro /usr/bin
|
|
sudo apt remove -y micro
|
|
|
|
# libpq-dev libssh-dev libsqlite3-dev
|
|
echo "chezmoi: Installing apt packages"
|
|
sudo apt install -y iperf3 ripgrep unzip p7zip-full zsh fish nmap curl git reptyr sqlite
|
|
|
|
# Install hishtory
|
|
if ! type -P hishtory; then
|
|
echo "chezmoi: Installing hishtory"
|
|
export HISHTORY_SERVER="https://hsh.{{ template "keys.tmpl" "privateDomain" }}"
|
|
export HISHTORY_SKIP_INIT_IMPORT='true'
|
|
curl https://hishtory.dev/install.py | python3 - --offline --skip-config-modification
|
|
fi
|
|
|
|
# Hishtory initialization
|
|
if type -P hishtory; then
|
|
if ! hishtory status | grep -q "$(rbw get 'hishtory-user_secret')"; then
|
|
echo "chezmoi: expected user secret not found, initializing hishtory"
|
|
|
|
hishtory init "$(rbw get 'hishtory-user_secret')" --force
|
|
hishtory syncing enable
|
|
fi
|
|
else
|
|
echo "chezmoi: hishtory not found, skipping initialization"
|
|
fi
|
|
|
|
# Install chatgpt
|
|
if ! type -P chatgpt; then
|
|
echo "chezmoi: Installing chatgpt"
|
|
curl -L -o chatgpt https://github.com/kardolus/chatgpt-cli/releases/latest/download/chatgpt-linux-amd64
|
|
chmod +x chatgpt
|
|
sudo mv chatgpt /usr/local/bin/
|
|
fi
|
|
|
|
{{- else if eq .chezmoi.os "darwin" -}}
|
|
#!/bin/sh
|
|
brew install ripgrep
|
|
{{ end -}}
|