Skip to content

Commit

Permalink
feat(bling): rpmfusion & negativo17 repo helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
xynydev committed Nov 23, 2024
1 parent a166afe commit 0108b3f
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 1 deletion.
2 changes: 1 addition & 1 deletion modules/bling/bling.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -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">;
}
29 changes: 29 additions & 0 deletions modules/bling/installers/negativo17.sh
Original file line number Diff line number Diff line change
@@ -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
24 changes: 24 additions & 0 deletions modules/bling/installers/rpmfusion.sh
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions modules/bling/module.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0108b3f

Please sign in to comment.