diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 84c0f20..d00ef92 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,15 +6,15 @@ on: paths-ignore: # don't rebuild if only documentation has changed - "**.md" pull_request: - branches: ['main'] - merge_group: - branches: ['main'] + branches: ["main"] + merge_group: + branches: ["main"] schedule: - - cron: '0 5 * * *' # 5 am everyday - workflow_dispatch: + - cron: "0 5 * * *" # 5 am everyday + workflow_dispatch: env: - IMAGE_NAME: bling - IMAGE_REGISTRY: ghcr.io/${{ github.repository_owner }} + IMAGE_NAME: modules + IMAGE_REGISTRY: ghcr.io/${{ github.repository_owner }} jobs: push-ghcr: @@ -24,7 +24,7 @@ jobs: contents: read packages: write id-token: write - steps: + steps: # Checkout push-to-registry action GitHub repository - name: Checkout Push to Registry action uses: actions/checkout@v4 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2f01194 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +cosign.key diff --git a/README.md b/README.md index 0c54a51..788085d 100644 --- a/README.md +++ b/README.md @@ -1,40 +1,23 @@ -# bling +# BlueBuild Modules   [![build-ublue](https://github.com/blue-build/modules/actions/workflows/build.yml/badge.svg)](https://github.com/blue-build/modules/actions/workflows/build.yml) -[![build-ublue](https://github.com/ublue-os/bling/actions/workflows/build.yml/badge.svg)](https://github.com/ublue-os/bling/actions/workflows/build.yml) +This repository contains the default official module repository for [BlueBuild](https://blue-build.org/). See [./modules/](./modules/) for the module source code. See the [website](https://blue-build.org/reference/module/) for module documentation. See [How to make a custom module](https://blue-build.org/how-to/making-modules/) and [Contributing](https://blue-build.org/learn/contributing/) for help with making custom modules and contributing. -This repository containes modules to use in recipe.yml. See list of modules in [./modules](./modules/) +## Style guidelines for official modules -## Usage +These are general guidelines for writing official modules and their documentation to follow to keep a consistent style. Not all of these are to be mindlessly followed, especially the ones about grammar and writing style, but it's good to keep these in mind if you intend to contribute back upstream, so that your module doesn't feel out of place. -You can add this to your Containerfile to copy the modules from this image over: -```dockerfile -COPY --from=ghcr.io/ublue-os/bling:latest /modules /tmp/modules/ -``` +### Bash -## Verification +- Echo what you're doing on each step and on errors to help debugging. +- Don't echo blocks using "===", that is reserved for the code launching the modules. +- Use `snake_case` for functions and variables changed by the code. +- Use `SCREAMING_SNAKE_CASE` for variables that are set once and stay unchanged. -These images are signed with sisgstore's [cosign](https://docs.sigstore.dev/cosign/overview/). You can verify the signature by downloading the `cosign.pub` key from this repo and running the following command: -```sh -cosign verify --key cosign.pub ghcr.io/ublue-os/bling -``` +### `module.yml` (not implemented) (will replace READMEs) -## See what is in this image +Each public module should also include a `module.yml` with the following keys: (TODO, not planned yet). -### Raw commands +#### `description:` -NOTE: This makes it so you need to extract everything from the base image! - -```sh -podman save ghcr.io/ublue-os/bling:latest -o bling.tar -tar xf bling.tar && rm bling.tar -tar xf *.tar -``` - -This should extract the image in a way that you can see everything in it! - -### Using [Dive](https://github.com/wagoodman/dive) - -This method allows you to inspect the image through a TUI -```sh -dive ghcr.io/ublue-os/bling:latest -``` +- At the start of each paragraph, refer to the module using its name or with "the module", not "it" or "the script" +- Use passive grammar when talking about the user, ie. "should be used", "can be configured", preferring references to what the module does, ie. "This module downloads the answer to the question of life, the universe and everything..." diff --git a/cosign.pub b/cosign.pub index f9482c4..840ae54 100644 --- a/cosign.pub +++ b/cosign.pub @@ -1,4 +1,4 @@ -----BEGIN PUBLIC KEY----- -MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE7lh7fJMV4dBT2jT1XafixUJa7OVA -cT+QFVD8IfIJIS/KBAc8hx1aslzkH3tfeM0cwyCLB7kOStZ4sh6RyFQD9w== +MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEk/2hQrKLFNf66dOyCEoUCip38EZh +I4NQN1BiVQ+6IRXkHCJahZfPtC9RqJ3dpGm/2CSdjKyES+vDQrUFj8vsmg== -----END PUBLIC KEY----- diff --git a/modules.json b/modules.json index 5f78a3e..a71f63b 100644 --- a/modules.json +++ b/modules.json @@ -1,13 +1,12 @@ [ - "https://raw.githubusercontent.com/ublue-os/bling/main/modules/akmods/module.yml", - "https://raw.githubusercontent.com/ublue-os/bling/main/modules/bling/module.yml", - "https://raw.githubusercontent.com/ublue-os/bling/main/modules/default-flatpaks/module.yml", - "https://raw.githubusercontent.com/ublue-os/bling/main/modules/files/module.yml", - "https://raw.githubusercontent.com/ublue-os/bling/main/modules/fonts/module.yml", - "https://raw.githubusercontent.com/ublue-os/bling/main/modules/gschema-overrides/module.yml", - "https://raw.githubusercontent.com/ublue-os/bling/main/modules/rpm-ostree/module.yml", - "https://raw.githubusercontent.com/ublue-os/bling/main/modules/script/module.yml", - "https://raw.githubusercontent.com/ublue-os/bling/main/modules/signing/module.yml", - "https://raw.githubusercontent.com/ublue-os/bling/main/modules/systemd/module.yml", - "https://raw.githubusercontent.com/ublue-os/bling/main/modules/yafti/module.yml" + "https://raw.githubusercontent.com/blue-build/modules/main/modules/akmods/module.yml", + "https://raw.githubusercontent.com/blue-build/modules/main/modules/bling/module.yml", + "https://raw.githubusercontent.com/blue-build/modules/main/modules/default-flatpaks/module.yml", + "https://raw.githubusercontent.com/blue-build/modules/main/modules/fonts/module.yml", + "https://raw.githubusercontent.com/blue-build/modules/main/modules/gschema-overrides/module.yml", + "https://raw.githubusercontent.com/blue-build/modules/main/modules/rpm-ostree/module.yml", + "https://raw.githubusercontent.com/blue-build/modules/main/modules/script/module.yml", + "https://raw.githubusercontent.com/blue-build/modules/main/modules/signing/module.yml", + "https://raw.githubusercontent.com/blue-build/modules/main/modules/systemd/module.yml", + "https://raw.githubusercontent.com/blue-build/modules/main/modules/yafti/module.yml" ] diff --git a/modules/akmods/module.yml b/modules/akmods/module.yml index 2aadaa5..3a50ab1 100644 --- a/modules/akmods/module.yml +++ b/modules/akmods/module.yml @@ -1,10 +1,10 @@ name: akmods shortdesc: The akmods module is a tool used for managing and installing kernel modules built by Universal Blue. -readme: https://raw.githubusercontent.com/ublue-os/bling/main/modules/akmods/README.md +readme: https://raw.githubusercontent.com/blue-build/modules/main/modules/akmods/README.md example: | type: akmods install: - openrazer - openrgb - v4l2loopback - - winesync \ No newline at end of file + - winesync diff --git a/modules/bling/bling.sh b/modules/bling/bling.sh index 4b39779..17c438c 100644 --- a/modules/bling/bling.sh +++ b/modules/bling/bling.sh @@ -3,10 +3,6 @@ # Tell build process to exit if there are any errors. set -euo pipefail -# Fetch bling COPR -REPO="https://copr.fedorainfracloud.org/coprs/ublue-os/bling/repo/fedora-${OS_VERSION}/ublue-os-bling-fedora-${OS_VERSION}.repo" -wget "${REPO//[$'\t\r\n ']}" -P "/etc/yum.repos.d/" - get_yaml_array INSTALL '.install[]' "$1" cd "/tmp/modules/bling/installers" @@ -18,7 +14,4 @@ for ITEM in "${INSTALL[@]}"; do echo "Pulling from bling: $ITEM" # The trainling newline from $ITEM is removed eval "$PWD/${ITEM%$'\n'}.sh" -done - -# Remove bling COPR -rm /etc/yum.repos.d/ublue-os-bling-fedora-*.repo +done \ No newline at end of file diff --git a/modules/bling/installers/ublue-update.sh b/modules/bling/installers/ublue-update.sh index 6fdceef..ffa8a85 100644 --- a/modules/bling/installers/ublue-update.sh +++ b/modules/bling/installers/ublue-update.sh @@ -32,6 +32,13 @@ if ! rpm -q python3-pip > /dev/null; then rpm-ostree install python3-pip fi +# Fetch ublue COPR +REPO="https://copr.fedorainfracloud.org/coprs/ublue-os/staging/repo/fedora-${OS_VERSION}/ublue-os-staging-fedora-${OS_VERSION}.repo" +wget "${REPO//[$'\t\r\n ']}" -P "/etc/yum.repos.d/" + # topgrade is REQUIRED by ublue-update to install pip install --prefix=/usr topgrade rpm-ostree install ublue-update + +# Remove ublue COPR +rm /etc/yum.repos.d/ublue-os-staging-fedora-*.repo diff --git a/modules/bling/module.yml b/modules/bling/module.yml index 267058c..73c0eaf 100644 --- a/modules/bling/module.yml +++ b/modules/bling/module.yml @@ -1,6 +1,6 @@ name: bling shortdesc: The bling module can be used to pull in small "bling" into your image. -readme: https://raw.githubusercontent.com/ublue-os/bling/main/modules/bling/README.md +readme: https://raw.githubusercontent.com/blue-build/modules/main/modules/bling/README.md example: | type: bling install: @@ -9,4 +9,4 @@ example: | # - dconf-update-service # a service unit that updates the dconf db on boot # - gnome-vrr # enables gnome-vrr for your image # - laptop # installs TLP and configures your system for laptop usage - # - flatpaksync # allows synchronization of user-installed flatpaks, see separate documentation section \ No newline at end of file + # - flatpaksync # allows synchronization of user-installed flatpaks, see separate documentation section diff --git a/modules/default-flatpaks/module.yml b/modules/default-flatpaks/module.yml index de91979..5e2d9dc 100644 --- a/modules/default-flatpaks/module.yml +++ b/modules/default-flatpaks/module.yml @@ -1,6 +1,6 @@ name: default-flatpaks shortdesc: The default-flatpaks module can be used to install or uninstall flatpaks from a configurable remote on every boot. -readme: https://raw.githubusercontent.com/ublue-os/bling/main/modules/default-flatpaks/README.md +readme: https://raw.githubusercontent.com/blue-build/modules/main/modules/default-flatpaks/README.md example: | modules: # configured multiple times to highlight how options are overridden - type: default-flatpaks @@ -35,4 +35,4 @@ example: | user: # repo-name will overwrite the previously-configured repo-name for the user remote repo-name: flathub-user - repo-title: "Flathub (User) \ No newline at end of file + repo-title: "Flathub (User) diff --git a/modules/files/README.md b/modules/files/README.md index 57c0c67..ead8a0a 100644 --- a/modules/files/README.md +++ b/modules/files/README.md @@ -1,7 +1 @@ -# `files` - -The `files` module simplifies the process of copying files to the image during the build time. These files are sourced from the `config/files` directory, which is located at `/tmp/config/files` inside the image. - -:::note -If you want to place any files in `/etc/`, you should place them in `/usr/etc/` instead, which will be used to generate `/etc/` on a booted system. That is the proper directory for "system" configuration templates on atomic Fedora distros, whereas `/etc/` is meant for manual overrides and editing by the machine's admin AFTER installation! See issue https://github.com/ublue-os/startingpoint/issues/28. -::: \ No newline at end of file +### The documentation for the `files` module exists in the [blue-build/cli](https://github.com/blue-build/cli/blob/main/templates/modules/files/) repository. \ No newline at end of file diff --git a/modules/files/module.yml b/modules/files/module.yml deleted file mode 100644 index c482ff8..0000000 --- a/modules/files/module.yml +++ /dev/null @@ -1,9 +0,0 @@ -name: files -shortdesc: The files module simplifies the process of copying files to the image during the build time. -readme: https://raw.githubusercontent.com/ublue-os/bling/main/modules/files/README.md -example: | - type: files - files: - - usr: /usr - # usr: file/folder inside config/files/ to copy (config/files/usr/ in the repository) - # /usr: destination on the final system \ No newline at end of file diff --git a/modules/fonts/module.yml b/modules/fonts/module.yml index 75d146c..cf22c92 100644 --- a/modules/fonts/module.yml +++ b/modules/fonts/module.yml @@ -1,6 +1,6 @@ name: fonts shortdesc: The `fonts` module can be used to install fonts from Nerd Fonts or Google Fonts. -readme: https://raw.githubusercontent.com/ublue-os/bling/main/modules/fonts/README.md +readme: https://raw.githubusercontent.com/blue-build/modules/main/modules/fonts/README.md example: | type: fonts fonts: @@ -13,4 +13,4 @@ example: | - NerdFontsSymbolsOnly google-fonts: - Roboto - - Open Sans \ No newline at end of file + - Open Sans diff --git a/modules/gschema-overrides/module.yml b/modules/gschema-overrides/module.yml index ea513c5..c6a27b3 100644 --- a/modules/gschema-overrides/module.yml +++ b/modules/gschema-overrides/module.yml @@ -1,6 +1,6 @@ name: gschema-overrides shortdesc: The `gschema-overrides` module can be used for including system-setting overrides for GTK-based desktop environments. -readme: https://raw.githubusercontent.com/ublue-os/bling/main/modules/gschema-overrides/README.md +readme: https://raw.githubusercontent.com/blue-build/modules/main/modules/gschema-overrides/README.md example: | type: gschema-overrides include: diff --git a/modules/rpm-ostree/module.yml b/modules/rpm-ostree/module.yml index 7c37e08..ba8ca49 100644 --- a/modules/rpm-ostree/module.yml +++ b/modules/rpm-ostree/module.yml @@ -1,6 +1,6 @@ name: rpm-ostree shortdesc: The rpm-ostree module offers pseudo-declarative package and repository management using rpm-ostree. -readme: https://raw.githubusercontent.com/ublue-os/bling/main/modules/rpm-ostree/README.md +readme: https://raw.githubusercontent.com/blue-build/modules/main/modules/rpm-ostree/README.md example: | type: rpm-ostree repos: @@ -11,4 +11,4 @@ example: | - libadwaita remove: - firefox - - firefox-langpacks \ No newline at end of file + - firefox-langpacks diff --git a/modules/script/module.yml b/modules/script/module.yml index 26bba3a..13ba00e 100644 --- a/modules/script/module.yml +++ b/modules/script/module.yml @@ -1,7 +1,7 @@ name: script shortdesc: The script module can be used to run arbitrary scripts at image build time. -readme: https://raw.githubusercontent.com/ublue-os/bling/main/modules/script/README.md +readme: https://raw.githubusercontent.com/blue-build/modules/main/modules/script/README.md example: | type: script scripts: - - myscript.sh # will run config/scripts/myscript.sh \ No newline at end of file + - myscript.sh # will run config/scripts/myscript.sh diff --git a/modules/signing/module.yml b/modules/signing/module.yml index 3633c12..8626bdf 100644 --- a/modules/signing/module.yml +++ b/modules/signing/module.yml @@ -1,5 +1,5 @@ name: signing -shortdesc: The signing module is used to install the required signing policies for cosign image verification with rpm-ostree and bootc. -readme: https://raw.githubusercontent.com/ublue-os/bling/main/modules/signing/README.md +shortdesc: The signing module is used to install the required signing policies for cosign image verification with rpm-ostree and bootc. +readme: https://raw.githubusercontent.com/blue-build/modules/main/modules/signing/README.md example: | - type: signing # this sets up the proper policy & signing files for signed images to work fully \ No newline at end of file + type: signing # this sets up the proper policy & signing files for signed images to work fully diff --git a/modules/systemd/module.yml b/modules/systemd/module.yml index 9a0a16e..03b79e0 100644 --- a/modules/systemd/module.yml +++ b/modules/systemd/module.yml @@ -1,6 +1,6 @@ name: systemd shortdesc: The systemd module streamlines the management of systemd units during image building. -readme: https://raw.githubusercontent.com/ublue-os/bling/main/modules/systemd/README.md +readme: https://raw.githubusercontent.com/blue-build/modules/main/modules/systemd/README.md example: | type: systemd system: @@ -20,4 +20,4 @@ example: | masked: - example.service # Masked (does not run for the user, under any circumstances) unmasked: - - example.service # Unmasked (runs for the user, even if previously masked) \ No newline at end of file + - example.service # Unmasked (runs for the user, even if previously masked) diff --git a/modules/yafti/README.md b/modules/yafti/README.md index 4b9d3ed..9730c55 100644 --- a/modules/yafti/README.md +++ b/modules/yafti/README.md @@ -4,4 +4,4 @@ The [`yafti`](https://github.com/ublue-os/yafti) module can be used to install [ Optionally, a list of Flatpak names and IDs can be included under `custom-flatpaks:`. These will be enabled by default under their own section on the Flatpak installation screen of `yafti`. -A default version of the `yafti` configuration file, `yafti.yml`, is supplied by this module. To make your own, create the file at `/usr/share/ublue-os/firstboot/yafti.yml`. The default version of the file can be found [here](https://github.com/ublue-os/bling/blob/main/modules/yafti/yafti.yml). \ No newline at end of file +A default version of the `yafti` configuration file, `yafti.yml`, is supplied by this module. To make your own, create the file at `/usr/share/ublue-os/firstboot/yafti.yml`. The default version of the file can be found [here](https://github.com/blue-build/modules/blob/main/modules/yafti/yafti.yml). diff --git a/modules/yafti/module.yml b/modules/yafti/module.yml index 8c7ec36..74aa253 100644 --- a/modules/yafti/module.yml +++ b/modules/yafti/module.yml @@ -1,8 +1,8 @@ name: yafti shortdesc: The yafti module can be used to install yafti and set it up to run on first boot. -readme: https://raw.githubusercontent.com/ublue-os/bling/main/modules/yafti/README.md +readme: https://raw.githubusercontent.com/blue-build/modules/main/modules/yafti/README.md example: | type: yafti custom-flatpaks: - Celluloid: io.github.celluloid_player.Celluloid - - Krita: org.kde.krita \ No newline at end of file + - Krita: org.kde.krita