Skip to content
This repository has been archived by the owner on Nov 20, 2023. It is now read-only.

Commit

Permalink
feat: ublue-os/bling module
Browse files Browse the repository at this point in the history
this makes all bling components optional,
while making more of them accessible
  • Loading branch information
xynydev committed Aug 26, 2023
1 parent 81dca63 commit 7b036d3
Show file tree
Hide file tree
Showing 12 changed files with 100 additions and 17 deletions.
15 changes: 4 additions & 11 deletions Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,10 @@ COPY cosign.pub /usr/share/ublue-os/cosign.pub

COPY config /usr/share/ublue-os/startingpoint

# Copy the bling from ublue-os/bling into the image:
# * wallpapers
# * justfiles
# * nix installer
COPY --from=ghcr.io/ublue-os/bling:latest /rpms/ublue-os-wallpapers-0.1-1.fc38.noarch.rpm /tmp/ublue-os-wallpapers-0.1-1.fc38.noarch.rpm
COPY --from=ghcr.io/ublue-os/bling:latest /files/usr/share/ublue-os/just /usr/share/ublue-os/just
COPY --from=ghcr.io/ublue-os/bling:latest /files/usr/bin/ublue-nix* /usr/bin
# Copy the bling from ublue-os/bling into tmp, to be installed later by the bling module
# Feel free to remove these lines if you want to speed up image builds and don't want any bling
COPY --from=ghcr.io/ublue-os/bling:latest /rpms /tmp/bling/rpms
COPY --from=ghcr.io/ublue-os/bling:latest /files /tmp/bling/files

# "yq" used in build.sh and the "setup-flatpaks" just-action to read recipe.yml.
# Copied from the official container image since it's not available as an RPM.
Expand All @@ -55,7 +52,3 @@ COPY modules /tmp/modules/
# Run the build script, then clean up temp files and finalize container build.
RUN chmod +x /tmp/build.sh && /tmp/build.sh && \
rm -rf /tmp/* /var/* && ostree container commit

# Storage
# TODO turn this bling installation stuff into a module
# rpm-ostree install /tmp/ublue-os-wallpapers-0.1-1.fc38.noarch.rpm
2 changes: 1 addition & 1 deletion config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ At the top of the recipe, there are four mandatory configuration options.

The core of startingpoint's configuration is built around the idea of modules. Modules are scripts in the [`../modules`](../modules/) directory that you list out under `modules:` in the recipe. They are executed in order, and can run arbitrary shell commands and write any files.

This repository comes with three modules out of the box, [`rpm-ostree`](../modules/rpm-ostree) for pseudo-declarative package management, [`yafti`](../modules/yafti) for installing [yafti](https://github.com/ublue-os/yafti) and easing basic configuration, and [`script`](../modules/script) for running small custom scripts at the build stage, like pulling in configuration or setting up `rpm-ostree` support for proper signing (see [`signing.sh`](./scripts/signing.sh)).
This repository comes with three modules out of the box, [`rpm-ostree`](../modules/rpm-ostree) for pseudo-declarative package management, [`yafti`](../modules/yafti) for installing [yafti](https://github.com/ublue-os/yafti) and easing basic configuration, [`bling`](../modules/bling) for pulling extra components from [`ublue-os/bling`](https://github.com/ublue-os/bling), and [`script`](../modules/script) for running small custom scripts at the build stage, like pulling in configuration or setting up `rpm-ostree` support for proper signing (see [`signing.sh`](./scripts/signing.sh)).

For more in-depth documentation on each module, check out the README.md files in each module folder.

Expand Down
22 changes: 17 additions & 5 deletions config/recipe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,24 @@ modules:
- firefox
- firefox-langpacks

- type: script
scripts:
# this sets up the proper policy & signing files for signed images to work
- signing.sh
- type: bling # configure what to pull in from ublue-os/bling
install:
- fonts # selection of common good free fonts
- justfiles # add "!include /usr/share/ublue-os/just/bling.just"
# in your custom.just (added by default) or local justfile
- nix-installer # these are the silverblue nix installer scripts from dnkmmr69420
- ublue-os-wallpapers
# - ublue-update # https://github.com/ublue-os/ublue-update
# - dconf-update-service # a service unit that updates the dconf db on boot
# - devpod # https://devpod.sh/ as an rpm


- type: yafti # if included, https://github.com/ublue-os/yafti will be installed and set up
custom-flatpaks: # this section is optional
- Celluloid: io.github.celluloid_player.Celluloid
- Krita: org.kde.krita
- Krita: org.kde.krita

- type: script
scripts:
# this sets up the proper policy & signing files for signed images to work
- signing.sh
19 changes: 19 additions & 0 deletions modules/bling/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# [`bling`](https://github.com/ublue-os/bling) module for startingpoint

The `bling` module allows you to easily declare which general parts of `ublue-os/bling` to pull in to your custom image. It requires the `rpms` and `files` directories from the `bling` container to already exist inside `/tmp/bling/` (pulled inside the Containerfile by default).

The blingbling to pull in is declared under `install:`, and the code for installing them is all in simple named scripts under the `installers/` directory. The basic code for the `bling` module is very similar to the code of the `script` module.

Example configuration:
```yml
type: bling # configure what to pull in from ublue-os/bling
install:
- fonts # selection of common good free fonts
- justfiles # add "!include /usr/share/ublue-os/just/bling.just"
# in your custom.just (added by default) or local justfile
- nix-installer # these are the silverblue nix installer scripts from dnkmmr69420
- ublue-os-wallpapers
# - ublue-update # https://github.com/ublue-os/ublue-update
# - dconf-update-service # a service unit that updates the dconf db on boot
# - devpod # https://devpod.sh/ as an rpm
```
17 changes: 17 additions & 0 deletions modules/bling/bling.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash

# Tell build process to exit if there are any errors.
set -oue pipefail

get_yaml_array INSTALL '.install[]' "$1"

export BLING_DIRECTORY="/tmp/bling"

cd "/tmp/modules/bling/installers"

find "$PWD" -type f -exec chmod +x {} \;

for ITEM in "${INSTALL[@]}"; do
echo "Pulling from bling: $ITEM"
eval "$PWD/$ITEM.sh"
done
6 changes: 6 additions & 0 deletions modules/bling/installers/dconf-update-service
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash

# Tell build process to exit if there are any errors.
set -oue pipefail

cp -r "$BLING_DIRECTORY/files/usr/etc/systemd/system/dconf-update.service" "/usr/etc/systemd/system/dconf-update.service"
6 changes: 6 additions & 0 deletions modules/bling/installers/devpod.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash

# Tell build process to exit if there are any errors.
set -oue pipefail

rpm-ostree install "$BLING_DIRECTORY"/rpms/devpod*.rpm
6 changes: 6 additions & 0 deletions modules/bling/installers/fonts.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash

# Tell build process to exit if there are any errors.
set -oue pipefail

cp -r "$BLING_DIRECTORY/files/usr/share/fonts" "/usr/share/fonts"
6 changes: 6 additions & 0 deletions modules/bling/installers/justfiles.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash

# Tell build process to exit if there are any errors.
set -oue pipefail

cp -r "$BLING_DIRECTORY/files/usr/share/ublue-os/just" "/usr/share/ublue-os/just"
6 changes: 6 additions & 0 deletions modules/bling/installers/nix-installer.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash

# Tell build process to exit if there are any errors.
set -oue pipefail

cp -r "$BLING_DIRECTORY/files/usr/bin/ublue-nix-install" "/usr/bin/ublue-nix-uninstall"
6 changes: 6 additions & 0 deletions modules/bling/installers/ublue-os-wallpapers.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash

# Tell build process to exit if there are any errors.
set -oue pipefail

rpm-ostree install "$BLING_DIRECTORY"/rpms/ublue-os-wallpapers*.rpm
6 changes: 6 additions & 0 deletions modules/bling/installers/ublue-update.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash

# Tell build process to exit if there are any errors.
set -oue pipefail

rpm-ostree install "$BLING_DIRECTORY"/rpms/ublue-update*.rpm

0 comments on commit 7b036d3

Please sign in to comment.