minor updates

This commit is contained in:
Alexander Navarro 2024-11-20 19:04:08 -03:00
parent a4e06120d2
commit 9d3fa8e910
6 changed files with 46 additions and 13 deletions

View file

@ -2,6 +2,7 @@
# shellcheck disable=all
# This is a handlerbars template, so ignore issues
set -euo pipefail
checksum_file=".dotter/cache/pre_deploy.checksum"
@ -16,12 +17,23 @@ fi
{{ header "Running pre deploy script for distro" (to_title_case distro) }}
{{ #if (and dotter.packages.cli (is_executable "sudo")) }}
{{ #if (is_executable "sudo") }}
{{ header "Configuring sudo" }}
echo "Defaults pwfeedback" | sudo -B tee /etc/sudoers.d/01-user
echo "Defaults timestamp_timeout=10" | sudo -B tee -a /etc/sudoers.d/01-user
echo "Defaults timestamp_type=global" | sudo -B tee -a /etc/sudoers.d/01-user
SUDOERS_FILE="/etc/sudoers.d/01-user"
if [[ -e "${SUDOERS_FILE}" ]]; then
echo "Sudo configuration already exists, to override it remove the file: ${SUDOERS_FILE}"
exit 0
else
sudo -B tee "${SUDOERS_FILE}" <<EOF
Defaults pwfeedback
Defaults timestamp_timeout=10
Defaults timestamp_type=global
EOF
sudo chmod 0440 "${SUDOERS_FILE}"
fi
{{ /if }}
@ -44,6 +56,12 @@ sudo -B dnf install -y {{~# each (flatten_table packages) }} '{{ this }}' {{~ /e
{{~ /if }}
{{ #if dotter.packages.zsh }}
[ "$SHELL" != "$(which zsh)" ] && chsh -s "$(which zsh)"
{{ /if }}
{{#if (and dotter.packages.rust (not (is_executable "cargo"))) }}
{{ header "Installing rust" }}
@ -69,6 +87,12 @@ tmp_dir=$(mktemp -d)
curl -L https://github.com/ryanoasis/nerd-fonts/releases/latest/download/{{ nerd_font }}.zip -o "$tmp_dir/{{ nerd_font}}.zip"
unzip -o "$tmp_dir/{{nerd_font}}.zip" -d ${FONT_DIR}/{{ nerd_font }}
curl -L https://github.com/joshmedeski/sesh/releases/latest/download/sesh_Linux_x86_64.tar.gz -o "$tmp_dir/sesh.tar.gz"
mkdir -p "$HOME/.local/bin"
tar xvf "$tmp_dir/sesh.tar.gz" --directory="$HOME/.local/bin" sesh
rm -rf "$tmp_dir"
{{ /if }}