| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
This repository contains the default official module repository for BlueBuild. See ./modules/ for the module source code. See the website for module documentation. See How to make a custom module and Contributing for help with making custom modules and contributing.
These are general guidelines for writing official bash modules and their documentation to follow in order 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.
Module-maintainer: Maintainer of a BlueBuild bash module. The intended audience of this section of the documentation.
Image-maintainer: Maintainer of a custom image that uses BlueBuild.
Local-user: User of a custom image using the BlueBuild bash module. The image-maintainer is usually a local-user too.
Build-time modules: Modules that perform its functionality when image is building.
Run-time modules: Modules that perform its functionality when system is booting or after system is booted.
Using Shellcheck in your editor is recommended.
Every public module should have a module.yml (see below) file for metadata and a README.md file for an in-depth description.
For the documentation of the module in README.md, the following guidelines apply:
For the short module description (shortdesc:), the following guidelines apply:
A module.yml is the metadata file for a public module, used on the website to generate module reference pages. May be used in future projects to showcase modules and supply some defaults for them.
The name of the module, same as the name of the directory and script.
A short description of the module, ideally not more than one sentence long. This is used in website metadata or anywhere a shorter module description is needed.
A YAML string of example configuration showcasing the configuration options available with inline documentation to describe them. Some of the configuration options may be commented out, with comments describing why one might enable them. The intention here is that the example would be a good place to copy-paste from to get started.
Every module folder should include a <modulename>.tsp file containing a model of the module's valid configuration options. This schema syntax should be familiar to programmers used to typed languages, especially TypeScript. The schemas will be compiled to the JSON Schema format and used for validation in editors and CLI.
import "@typespec/json-schema";
using TypeSpec.JsonSchema;
@jsonSchema("/modules/<module-name>.json")
model <ModuleName>Module {
/** <Short description of the module>
* https://blue-build.org/reference/modules/<module-name>/
*/
type: "<module-name>",
}Important
Build-time modules are preferred over run-time modules for better system reliability.
Only implement run-time modules when build-time modules are impossible to implement for achieving desired functionality.
Run-time modules: Modules that perform its functionality when system is booting or after system is booted.
Local module config is used to allow local-users to see & change the behavior of the run-time module, in order to improve local-user experience.
Example of the run-time module which satisfies the requirements & implements this functionality: default-flatpaks
Requirements for local module configs exist, as not all modules need this functionality.
Following conditions for approved local module config implementation are:
In order to keep config files easy to read & reliable to parse, standardized .yml markup format is used.
yq tool is used to process .yml configs in order to reach the desired goal.
System config:
/usr/share/bluebuild/module-name/configuration.yml
System config is a module config which is derived from recipe.yml module entry. It is placed in this read-only directory location in order to avoid local-users writing to it. So it is used to inform local-users about which modifications are done in recipe.yml, so they can potentially proceed with modifications on their own.
Local-user config:
/usr/etc/bluebuild/module-name/configuration.yml
Local-user config is a module config which is derived from local-user config template. It is placed in /usr/etc, which is then automatically copied to /etc, which is writable to local-users. /usr/etc local-user config can be used to reset module config that is done in /etc.
System & local-user config is not there just for users, it is also directly utilized by the module, which reads the configuration.yml file & further parses the data to allow the module to have local config functionality.
System config (/usr/share/bluebuild/default-flatpaks/configuration.yml):
# Information about the config file
#
# vendor: BlueBuild
# module: default-flatpaks
# description: System config file for `default-flatpaks` BlueBuild module, which is used to install + remove flatpak apps or modify flatpak repos.
# instructions: Read this system config in order to know what is currently configured by the system & what to potentially modify in local-user config (/etc/bluebuild/default-flatpaks/configuration.yml).
# Configuration section
notify: true
system:
install:
- org.gnome.Boxes
- org.gnome.Calculator
- org.gnome.Calendar
- org.gnome.Snapshot
- org.gnome.Contacts
user:
install:
- org.gnome.World.SecretsLocal-user config (/etc/bluebuild/default-flatpaks/configuration.yml):
# Information about the config file
#
# vendor: BlueBuild
# module: default-flatpaks
# description: Local-user config file for `default-flatpaks` BlueBuild module, which is used to install + remove flatpak apps or modify flatpak repos.
# instructions: Template of all supported options is in a example below. Modify the options you need & set "active" key to true.
# Configuration section
active: false
notify: true # possible options: true/false
system:
repo-url: https://dl.flathub.org/repo/flathub.flatpakrepo
repo-name: flathub-system
repo-title: "Flathub (System)" # Optional; this sets the remote's user-facing name in graphical frontends like GNOME Software
install:
- org.gnome.Boxes
- org.gnome.Calculator
- org.gnome.Calendar
- org.gnome.Snapshot
- org.gnome.Contacts
remove:
- org.gnome.TextEditor
user:
repo-url: https://dl.flathub.org/repo/flathub.flatpakrepo
repo-name: flathub-user
repo-title: "Flathub (User)" # Optional; this sets the remote's user-facing name in graphical frontends like GNOME Software
install:
- org.gnome.World.Secrets
remove:
- org.gnome.Contacts | Back | FazBrowse Home | New Git URL |