Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix!: moving component files to the new, standardized location #70

Merged
merged 3 commits into from
May 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ RUN mkdir /tmp/scripts
COPY scripts /tmp/scripts
RUN find /tmp/scripts -type f -exec chmod +x {} \;

COPY ${RECIPE} /usr/etc/ublue-recipe.yml
COPY ${RECIPE} /usr/share/ublue-os/recipe.yml

# yq used in build.sh and the setup-flatpaks recipe to read the recipe.yml
# copied from the official container image as it's not avaible as an rpm
Expand Down
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ matrix:

`yafti` is the uBlue "first boot" installer. It shows up the first time a user logs into uBlue. By default, the menu also shows up again anytime the image's yafti configuration differs from the user's last encounter, so feel free to expand or modify your custom image's yafti configuration over time. Your users will then see the yafti menu again after the OS update, and will be given a chance to install any new additions.

Its configuration can be found in `/usr/etc/yafti.yml` of the installed OS. It includes an optional selection of Flatpaks to install, along with a new group that's automatically added for all Flatpaks declared in `recipe.yml`. You can look at what's done in the config and modify it to your liking.
Its configuration can be found in `/usr/share/ublue-os/firstboot/yafti.yml` of the installed OS. It includes an optional selection of Flatpaks to install, along with a new group that's automatically added for all Flatpaks declared in `recipe.yml`. You can look at what's done in the config and modify it to your liking (in the repository, before building the image, since the installed system file is immutable).

The files `/usr/etc/profile.d/ublue-firstboot.sh` and `/usr/etc/skel.d/.config/autostart/ublue-firstboot.desktop` set up `yafti` so that it starts on boot, which means that you shouldn't touch those files if you wish to retain that functionality.

Expand All @@ -97,9 +97,11 @@ The `latest` tag will automatically point to the latest build. That build will s

## Just

The `just` task runner is included in main for further customization after first boot.
You can copy the justfile from `/usr/etc/justfile` to `~/.justfile` to get started. Once `just` supports [include directives](https://just.systems/man/en/chapter_52.html), you can just include the file in `/etc` into your own justfile, where you have the option of adding new tasks.
After that run the following commands:
The `just` task runner is included in `main` for further customization after first boot.

You can copy the justfile from `/usr/share/ublue-os/just/justfile` to `~/.justfile` to get started. When `just` supports [include directives](https://just.systems/man/en/chapter_52.html), you will instead be able to simply include that path into your own justfile, without having to copy it manually.

After doing that, you'll be able to run the following commands:

- `just` - Show all tasks, more will be added in the future
- `just bios` - Reboot into the system bios (Useful for dualbooting)
Expand Down
9 changes: 5 additions & 4 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
set -oue pipefail

# Helper functions.
RECIPE_FILE="/usr/etc/ublue-recipe.yml"
RECIPE_FILE="/usr/share/ublue-os/recipe.yml"
YAFTI_FILE="/usr/share/ublue-os/firstboot/yafti.yml"
get_yaml_array() {
mapfile -t "$1" < <(yq -- "$2" "$RECIPE_FILE")
}
Expand Down Expand Up @@ -73,11 +74,11 @@ pip install --prefix=/usr yafti
get_yaml_array flatpaks '.flatpaks[]'
if [[ ${#flatpaks[@]} -gt 0 ]]; then
echo "-- yafti: Adding Flatpaks defined in recipe.yml --"
yq -i '.screens.applications.values.groups.Custom.description = "Flatpaks defined by the image maintainer"' /usr/etc/yafti.yml
yq -i '.screens.applications.values.groups.Custom.default = true' /usr/etc/yafti.yml
yq -i '.screens.applications.values.groups.Custom.description = "Flatpaks defined by the image maintainer"' "$YAFTI_FILE"
yq -i '.screens.applications.values.groups.Custom.default = true' "$YAFTI_FILE"
for pkg in "${flatpaks[@]}"; do
echo "Adding to yafti: ${pkg}"
yq -i ".screens.applications.values.groups.Custom.packages += [{\"$pkg\": \"$pkg\"}]" /usr/etc/yafti.yml
yq -i ".screens.applications.values.groups.Custom.packages += [{\"$pkg\": \"$pkg\"}]" "$YAFTI_FILE"
done
echo "---"
fi
Expand Down
4 changes: 2 additions & 2 deletions recipe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ rpm:
- firefox-langpacks

# These Flatpaks will be suggested for install after user login, via the yafti
# "first boot" GUI. Everything below will be merged into the "etc/yafti.yml" config
# "first boot" GUI. Everything below will be merged into the "yafti.yml" config
# on build, in a category named "Custom". If you prefer, you can instead remove
# everything below and directly edit "etc/yafti.yml" to have more control.
# everything below and directly edit "yafti.yml" to have more control.
# This is just an example selection.
flatpaks:
- org.mozilla.firefox
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion etc/justfile → usr/share/ublue-os/just/justfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ distrobox-ubuntu:
setup-flatpaks:
#!/usr/bin/env bash
echo 'Installing flatpaks from the ublue recipe ...'
flatpaks=$(yq '.flatpaks[]' < /usr/etc/ublue-recipe.yml)
flatpaks=$(yq '.flatpaks[]' < /usr/share/ublue-os/recipe.yml)
for pkg in $flatpaks; do \
echo "Installing: ${pkg}" && \
flatpak install --user --noninteractive flathub $pkg; \
Expand Down