Skip to content

Commit

Permalink
chore(linux): pythong and topgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
senz committed May 3, 2024
1 parent 733d81d commit 970eb4d
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 4 deletions.
6 changes: 4 additions & 2 deletions dot_zshrc.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,11 @@ autoload -U +X bashcompinit && bashcompinit
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8

export PATH="$HOME/.bin:$HOME/bin:$PATH:$HOME/go/bin"

export PATH="$HOME/.bin:$PATH:$HOME/go/bin"
export TERM=alacritty
if command -v alacritty &>/dev/null; then
export TERM=alacritty
fi

eval "$(register-python-argcomplete pipx)"

Expand Down
2 changes: 2 additions & 0 deletions run_once_after_apps-configuration-linux.sh.tmpl
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{{ if (eq .chezmoi.os "linux") -}}
#!/bin/bash

pip install argcomplete

# Check if Oh My Zsh is installed
if [ ! -d "$HOME/.oh-my-zsh" ]; then
# Install Oh My Zsh
Expand Down
20 changes: 18 additions & 2 deletions run_once_before_install-packages-linux.sh.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
set -eu

install_flatpaks() {
echo "Installing flatpaks"
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo

local flatpaks=(
Expand All @@ -14,6 +15,7 @@ install_flatpaks() {
}

install_ostree() {
echo "Installing ostree packages"
# setting up non-rh repos
# https://code.visualstudio.com/docs/setup/linux#_rhel-fedora-and-centos-based-distributions
if [ ! -f /etc/pki/rpm-gpg/microsoft.asc ]; then
Expand All @@ -24,28 +26,34 @@ install_ostree() {
fi

rpm-ostree install --idempotent -y \
python3-pip \
pipx \
binutils \
podman-docker \
zsh \
ddccontrol ddccontrol-gtk \
vim \
wl-clipboard \
code
sudo rpm-ostree apply-live
code
echo "Applying ostree changes (best effort)"
sudo rpm-ostree apply-live || true
}

setup_toolbx() {
echo "Setting up toolbox"
if ! toolbox list -c | grep -q "ubuntu-toolbox-23.10"; then
toolbox create --distro ubuntu --release 23.10
fi
}

{{ if (eq .chezmoi.osRelease.variantID "kinoite") -}}
echo "Installing Kinoite environment"
install_ostree
install_flatpaks
setup_toolbx

if [ ! -f ~/bin/git-credential-github ]; then
echo "Downloading git-credential-github"
# Download and extract git-credential-github
mkdir -p /tmp/git-credential-github
curl -L https://github.com/Xgames123/git-credential-github/releases/download/2.2.0/git-credential-github-2.2.0.deb -o /tmp/git-credential-github/git-credential-github-2.2.0.deb
Expand All @@ -54,6 +62,14 @@ if [ ! -f ~/bin/git-credential-github ]; then
cp /tmp/git-credential-github/usr/bin/git-credential-github ~/bin/
fi

if ! command -v topgrade &> /dev/null; then
echo "Downloading topgrade"
mkdir -p /tmp/topgrade
curl -L https://github.com/topgrade-rs/topgrade/releases/download/v14.0.1/topgrade-v14.0.1-x86_64-unknown-linux-musl.tar.gz -o /tmp/topgrade/topgrade.tar.gz
tar -xf /tmp/topgrade/topgrade.tar.gz -C /tmp/topgrade
cp /tmp/topgrade/topgrade ~/bin/
fi

{{ end -}}

{{ end -}}

0 comments on commit 970eb4d

Please sign in to comment.