dotfiles/run_once_before_install_main_deps.sh.tmpl
2023-05-28 15:12:43 +03:00

101 lines
3.5 KiB
Bash

#!/usr/bin/env bash
BASE_PACKAGES="kitty-terminfo gpg git curl wget ripgrep fd-find unzip python3-pip htop fzf bat"
USER=$(whoami)
################################################################################################################################
##
## Install base packages
##
################################################################################################################################
{{ if eq .chezmoi.os "linux" -}}
{{ if eq .chezmoi.osRelease.id "fedora" -}}
sudo dnf install $BASE_PACKAGES util-linux-user -y
{{ else if eq .chezmoi.osRelease.id "debian" "ubuntu" -}}
sudo apt update
sudo apt install $BASE_PACKAGES -y
{{ end -}}
{{ end -}}
################################################################################################################################
##
## Install fish and set it as the default shell
##
################################################################################################################################
{{ if eq .chezmoi.os "linux" -}}
{{ if eq .chezmoi.osRelease.id "fedora" -}}
sudo dnf install fish -y
{{ else if eq .chezmoi.osRelease.id "debian" "ubuntu" -}}
{{ if eq .chezmoi.osRelease.id "debian" -}}
## Setup fish repo in debian
VERS={{ .chezmoi.osRelease.versionID }}
echo "deb http://download.opensuse.org/repositories/shells:/fish:/release:/3/Debian_$VERS/ /" | sudo tee /etc/apt/sources.list.d/shells:fish:release:3.list
curl -fsSL "https://download.opensuse.org/repositories/shells:fish:release:3/Debian_$VERS/Release.key" | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/shells_fish_release_3.gpg > /dev/null
{{ else -}}
## Setup fish repo in ubuntu
sudo apt-add-repository ppa:fish-shell/release-3
{{ end -}}
## Update repos with fish repo included and install fish
sudo apt update
sudo apt install fish -y
{{ end -}}
{{ end -}}
## Install fisher plugin manager for fish, so that we may update in after plugin list sync by chezmoi
fish -c "curl -sL https://raw.githubusercontent.com/jorgebucaran/fisher/main/functions/fisher.fish | source && fisher install jorgebucaran/fisher"
## Change default shell to fish
echo
echo
echo "Changing shell to fish for user $USER"
sudo chsh -s $(which fish) $USER
################################################################################################################################
##
## Install nix packet manager (single user)
##
################################################################################################################################
bash <(curl -L https://nixos.org/nix/install) --no-daemon
################################################################################################################################
##
## Install neovim
##
################################################################################################################################
{{ if eq .chezmoi.os "linux" -}}
{{ if eq .chezmoi.osRelease.id "fedora" -}}
sudo dnf install neovim -y
{{ else if eq .chezmoi.osRelease.id "debian" "ubuntu" -}}
nix-env -iA nixpkgs.neovim
{{ end -}}
{{ end -}}
################################################################################################################################
##
## Install atuin and jump
##
################################################################################################################################
{{ if eq .chezmoi.os "linux" -}}
## install atuin
nix-env -iA nixpkgs.neovim
nix-env -iA nixpkgs.jump
{{ end -}}