|
| 1 | +{{ if (eq .chezmoi.os "linux") -}} |
| 2 | +#!/bin/bash |
| 3 | +set -eu |
| 4 | + |
| 5 | +install_flatpaks() { |
| 6 | + flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo |
| 7 | + |
| 8 | + local flatpaks=( |
| 9 | +{{ joinPath .chezmoi.sourceDir "Pakfile" | include }} |
| 10 | +{{ joinPath .chezmoi.sourceDir "Pakfile.pers.asc" | include | decrypt }} |
| 11 | + ) |
| 12 | + |
| 13 | + flatpak install -y flathub "${flatpaks[@]}" |
| 14 | +} |
| 15 | + |
| 16 | +install_ostree() { |
| 17 | + # setting up non-rh repos |
| 18 | + # https://code.visualstudio.com/docs/setup/linux#_rhel-fedora-and-centos-based-distributions |
| 19 | + if [ ! -f /etc/pki/rpm-gpg/microsoft.asc ]; then |
| 20 | + curl -o /etc/pki/rpm-gpg/microsoft.asc https://packages.microsoft.com/keys/microsoft.asc |
| 21 | + fi |
| 22 | + if [ ! -f /etc/yum.repos.d/vscode.repo ]; then |
| 23 | + echo -e "[code]\nname=Visual Studio Code\nbaseurl=https://packages.microsoft.com/yumrepos/vscode\nenabled=1\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" | sudo tee /etc/yum.repos.d/vscode.repo > /dev/null |
| 24 | + fi |
| 25 | + |
| 26 | + rpm-ostree install --idempotent -y \ |
| 27 | + binutils \ |
| 28 | + podman-docker \ |
| 29 | + zsh \ |
| 30 | + ddccontrol ddccontrol-gtk \ |
| 31 | + vim \ |
| 32 | + wl-clipboard \ |
| 33 | + code |
| 34 | + sudo rpm-ostree apply-live |
| 35 | +} |
| 36 | + |
| 37 | +setup_toolbx() { |
| 38 | + if ! toolbox list -c | grep -q "ubuntu-toolbox-23.10"; then |
| 39 | + toolbox create --distro ubuntu --release 23.10 |
| 40 | + fi |
| 41 | +} |
| 42 | + |
| 43 | +{{ if (eq .chezmoi.osRelease.variantID "kinoite") -}} |
| 44 | +install_ostree |
| 45 | +install_flatpaks |
| 46 | +setup_toolbx |
| 47 | + |
| 48 | +if [ ! -f ~/bin/git-credential-github ]; then |
| 49 | + # Download and extract git-credential-github |
| 50 | + mkdir -p /tmp/git-credential-github |
| 51 | + 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 |
| 52 | + ar x /tmp/git-credential-github/git-credential-github-2.2.0.deb --output /tmp/git-credential-github |
| 53 | + tar -xf /tmp/git-credential-github/data.tar.xz -C /tmp/git-credential-github |
| 54 | + cp /tmp/git-credential-github/usr/bin/git-credential-github ~/bin/ |
| 55 | +fi |
| 56 | + |
| 57 | +{{ end -}} |
| 58 | + |
| 59 | +{{ end -}} |
0 commit comments