azure/build.sh

104 lines
3.6 KiB
Bash
Raw Normal View History

2024-05-03 07:56:30 +00:00
#!/bin/bash
set -ouex pipefail
RELEASE="$(rpm -E %fedora)"
2024-05-03 15:11:18 +00:00
### Add repos
2024-05-03 07:56:30 +00:00
2024-11-17 18:59:08 +00:00
# Add niri repo
curl -Lo /etc/yum.repos.d/yalter-niri-fedora-"${RELEASE}".repo https://copr.fedorainfracloud.org/coprs/yalter/niri/repo/fedora-"${RELEASE}"/yalter-niri-fedora-"${RELEASE}".repo
2024-05-03 15:11:18 +00:00
# Add Staging repo
2024-11-10 11:43:14 +00:00
curl -Lo /etc/yum.repos.d/ublue-os-staging-fedora-"${RELEASE}".repo https://copr.fedorainfracloud.org/coprs/ublue-os/staging/repo/fedora-"${RELEASE}"/ublue-os-staging-fedora-"${RELEASE}".repo
2024-05-03 15:11:18 +00:00
# Add Bling repo
2024-11-10 11:43:14 +00:00
curl -Lo /etc/yum.repos.d/ublue-os-bling-fedora-"${RELEASE}".repo https://copr.fedorainfracloud.org/coprs/ublue-os/bling/repo/fedora-"${RELEASE}"/ublue-os-bling-fedora-"${RELEASE}".repo
2024-05-03 15:11:18 +00:00
2024-11-10 11:43:14 +00:00
curl -Lo /etc/yum.repos.d/ganto-lxc4-fedora-"${RELEASE}".repo https://copr.fedorainfracloud.org/coprs/ganto/lxc4/repo/fedora-"${RELEASE}"/ganto-lxc4-fedora-"${RELEASE}".repo
2024-05-03 07:56:30 +00:00
2024-11-10 11:43:14 +00:00
curl -Lo /etc/yum.repos.d/_copr_che-nerd-fonts-"${RELEASE}".repo https://copr.fedorainfracloud.org/coprs/che/nerd-fonts/repo/fedora-"${RELEASE}"/che-nerd-fonts-fedora-"${RELEASE}".repo
2024-05-03 15:11:18 +00:00
2024-12-29 18:35:11 +00:00
curl -Lo /etc/yum.repos.d/_copr_pgdev-ghostty-"${RELEASE}".repo https://copr.fedorainfracloud.org/coprs/pgdev/ghostty/repo/fedora-"${RELEASE}"/pgdev-ghostty-fedora-"${RELEASE}".repo
2024-10-12 19:30:20 +00:00
curl https://downloads.1password.com/linux/keys/1password.asc | tee /etc/pki/rpm-gpg/1password.gpg
### Install 1password using blue-build script
curl -Lo 1password.sh https://raw.githubusercontent.com/blue-build/modules/22fe11d844763bf30bd83028970b975676fe7beb/modules/bling/installers/1password.sh
2024-10-12 19:30:20 +00:00
chmod +x 1password.sh
bash ./1password.sh
rm 1password.sh
2024-05-03 15:11:18 +00:00
### Install packages
2024-05-03 07:56:30 +00:00
2024-05-03 15:11:18 +00:00
grep -v '^#' /tmp/packages | xargs rpm-ostree install
2024-05-03 07:56:30 +00:00
2024-10-12 19:30:20 +00:00
rpm-ostree install 1password
2024-06-03 17:46:13 +00:00
# Install topgrade
pip install --prefix=/usr topgrade
2024-05-05 15:23:33 +00:00
# Installed via flatpak
rpm-ostree override remove firefox firefox-langpacks
2024-12-01 17:28:07 +00:00
#### os-release
sed -i '/fedoraproject.org/d' /usr/lib/os-release
sed -i 's/Fedora Linux/Azure/g' /usr/lib/os-release
sed -i 's/fedoraproject/babariviere/g' /usr/lib/os-release
sed -i 's/fedora/azure/g' /usr/lib/os-release
sed -i '/REDHAT/d' /usr/lib/os-release
2024-11-10 11:39:36 +00:00
#### Quadlets
mkdir -p /etc/containers/systemd/users
2024-11-10 11:39:36 +00:00
curl -Lo /etc/containers/systemd/users/azure-cli.container https://raw.githubusercontent.com/babariviere/toolboxes/main/quadlets/azure-cli/azure-cli.container
sed -i 's/ContainerName=azure/ContainerName=azure-cli/' /etc/containers/systemd/users/azure-cli.container
# Make systemd targets
mkdir -p /usr/lib/systemd/user
QUADLET_TARGETS=(
"azure-cli"
)
for i in "${QUADLET_TARGETS[@]}"; do
2024-12-01 17:01:06 +00:00
cat > "/usr/lib/systemd/user/${i}.target" <<EOF
2024-11-10 11:39:36 +00:00
[Unit]
2024-12-01 17:16:14 +00:00
Description="target for ${i} quadlet
2024-11-10 11:39:36 +00:00
[Install]
WantedBy=default.target
EOF
2024-12-01 17:16:14 +00:00
printf "\n\n[Install]\nWantedBy=%s.target" "$i" >> /etc/containers/systemd/users/"$i".container
done
2024-11-10 11:39:36 +00:00
2024-12-14 10:04:49 +00:00
#### Setup devpod
ln -s /usr/bin/devpod-cli /usr/bin/devpod
2024-11-17 18:59:08 +00:00
#### Setup niri deps
mkdir /usr/lib/systemd/user/niri.service.wants
ln -s /usr/lib/systemd/user/mako.service /usr/lib/systemd/user/niri.service.wants/
ln -s /usr/lib/systemd/user/waybar.service /usr/lib/systemd/user/niri.service.wants/
ln -s /usr/lib/systemd/user/swayidle.service /usr/lib/systemd/user/niri.service.wants/
ln -s /usr/lib/systemd/user/kanshi.service /usr/lib/systemd/user/niri.service.wants/
2024-05-03 15:11:18 +00:00
#### Services
2024-05-03 07:56:30 +00:00
systemctl enable podman.socket
2025-01-04 11:51:45 +00:00
systemctl enable -f --global podman.socket
2024-11-10 11:47:56 +00:00
systemctl enable podman-auto-update.timer
2024-12-01 17:01:06 +00:00
systemctl enable greetd.service
2024-11-17 18:59:08 +00:00
2024-12-09 22:04:13 +00:00
systemctl enable tlp.service
2024-05-05 10:27:56 +00:00
systemctl enable -f --global flatpak-setup.service
2024-06-03 17:46:13 +00:00
systemctl enable -f --global azure-topgrade.service
2024-05-14 09:49:15 +00:00
systemctl enable azure-system-setup.service
systemctl enable azure-groups.service