From 0108b3f011cd705db83fb6c2a4a92ae7d4f82d1f Mon Sep 17 00:00:00 2001 From: xyny Date: Sat, 23 Nov 2024 19:48:12 +0200 Subject: [PATCH] feat(bling): rpmfusion & negativo17 repo helpers --- modules/bling/bling.tsp | 2 +- modules/bling/installers/negativo17.sh | 29 ++++++++++++++++++++++++++ modules/bling/installers/rpmfusion.sh | 24 +++++++++++++++++++++ modules/bling/module.yml | 2 ++ 4 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 modules/bling/installers/negativo17.sh create mode 100644 modules/bling/installers/rpmfusion.sh diff --git a/modules/bling/bling.tsp b/modules/bling/bling.tsp index 54f343f..601fcec 100644 --- a/modules/bling/bling.tsp +++ b/modules/bling/bling.tsp @@ -9,5 +9,5 @@ model BlingModule { type: "bling"; /** List of bling submodules to run / things to install onto your system. */ - install: Array<"ublue-update" | "1password" | "dconf-update-service" | "gnome-vrr">; + install: Array<"rpmfusion" | "negativo17" | "ublue-update" | "1password" | "dconf-update-service" | "gnome-vrr">; } diff --git a/modules/bling/installers/negativo17.sh b/modules/bling/installers/negativo17.sh new file mode 100644 index 0000000..3d09574 --- /dev/null +++ b/modules/bling/installers/negativo17.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env bash + +# Tell build process to exit if there are any errors. +set -euo pipefail + +# Check if rpmfusion is installed before running +if [[ "$(rpm -q rpmfusion-free-release)" == "rpmfusion-free-release"* && "$(rpm -q rpmfusion-nonfree-release)" == "rpmfusion-nonfree-release"* ]]; then + + echo "uninstalling rpmfusion..." + rpm-ostree uninstall rpmfusion-free-release rpmfusion-nonfree-release + +fi + +# check if negativo17 repo is installed +if [[ -f /etc/yum.repos.d/negativo17-fedora-multimedia.repo ]]; then + + echo "negativo17 repo is already installed" + echo "making sure negativo17 repo is enabled" + sed -i 's@enabled=0@enabled=1@g' /etc/yum.repos.d/negativo17-fedora-multimedia.repo + +else + + echo "installing negativo17 repo..." + curl -Lo /etc/yum.repos.d/negativo17-fedora-multimedia.repo https://negativo17.org/repos/fedora-multimedia.repo + + echo "setting negativo17 repo priority to 90..." + sed -i '0,/enabled=1/{s/enabled=1/enabled=1\npriority=90/}' /etc/yum.repos.d/negativo17-fedora-multimedia.repo + +fi \ No newline at end of file diff --git a/modules/bling/installers/rpmfusion.sh b/modules/bling/installers/rpmfusion.sh new file mode 100644 index 0000000..3115d23 --- /dev/null +++ b/modules/bling/installers/rpmfusion.sh @@ -0,0 +1,24 @@ +#!/usr/bin/env bash + +# Tell build process to exit if there are any errors. +set -euo pipefail + +# Check if rpmfusion is already installed before running +if [[ "$(rpm -q rpmfusion-free-release)" != "rpmfusion-free-release"* && "$(rpm -q rpmfusion-nonfree-release)" != "rpmfusion-nonfree-release"* ]]; then + + echo "running rpmfusion install..." + rpm-ostree install \ + "https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-${OS_VERSION}.noarch.rpm" \ + "https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-${OS_VERSION}.noarch.rpm" + + # check if negativo17 repo is installed + if [[ -f /etc/yum.repos.d/negativo17-fedora-multimedia.repo ]]; then + echo "making sure negativo17 repo is disabled" + sed -i 's@enabled=1@enabled=0@g' /etc/yum.repos.d/negativo17-fedora-multimedia.repo + fi + +else + + echo "rpmfusion is already installed" + +fi \ No newline at end of file diff --git a/modules/bling/module.yml b/modules/bling/module.yml index 32efdf1..5945f17 100644 --- a/modules/bling/module.yml +++ b/modules/bling/module.yml @@ -3,6 +3,8 @@ shortdesc: The bling module can be used to pull in small "bling" into your image example: | type: bling install: + - rpmfusion # install RPMFusion repos, disable negativo17 repos if installed + - negativo17 # install negativo17 repos and set priority to 90, uninstall RPMFusion repos if installed - ublue-update # https://github.com/ublue-os/ublue-update - 1password # install 1Password (stable) and `op` CLI tool - dconf-update-service # a service unit that updates the dconf db on boot