Next: , Previous: , Up: API  


1.10 (heks-linux image)

The desktop as a bootable image: an openSUSE Slowroll live ISO carrying this configuration, the editor’s and the shell’s.

The image is a KIWI description, and a KIWI description is four things: an XML file that names the distribution, its repositories and its packages; a config.sh that runs inside the chroot while the image is built; an images.sh that names the file the build produces; and a root/ directory whose contents are copied onto the image’s filesystem. Three of those four are data, so they are written here in Scheme, the way every other surface of this desktop is: the package list comes from (heks-linux packages zypper), the locale, timezone and hostname come from the same settings a session reads, and the shell scripts are format strings that a test can look inside.

The ISO is a *live* image: it boots the desktop from a squashfs with a writable overlay, so it asks nothing of the machine it starts on. It is hybrid-persistent, which means the same file can go on a USB stick and keep what a session did with it.

What the image does not carry is the Guix store the renderers run from - it is the size of a small distribution, and building it into the image on the day it is built is the next step rather than this one. The ISO therefore ships the three checkouts and the editor’s configuration already in place, and a first-boot unit that runs the three commands the README documents to render the rest. That unit needs the network, which is the one thing a live image cannot promise.

1.10.1 Parameters

Parameter: image-checkouts

Default value:

(("heks-linux" . "trunk") ("heks-emacs" . "trunk") ("heks-bash" . "trunk"))
Parameter: image-config-script-filename

Default value:

"config.sh"
Parameter: image-description-dir

Default value:

"dist/image"
Parameter: image-description-filename

Default value:

"config.xml"
Parameter: image-images-script-filename

Default value:

"images.sh"
Parameter: image-payload-dir

Default value:

"root/usr/local/lib/heks-linux"
Parameter: image-payload-script-filename

Default value:

"heks-render"
Parameter: image-payload-state-dir

Default value:

"/var/lib/heks-linux"
Parameter: image-payload-unit-filename

Default value:

"heks-render.service"
Parameter: image-render-at-build?

Default value:

#t
Parameter: image-upstream

Default value:

"https://codeberg.org/jjba23"
Parameter: image-user

Default value:

"heks"
Parameter: image-version

Default value:

"0.1.0"

1.10.2 Procedures

Procedure: image-config-script

Return config.sh: the whole build, in the order it happens.

Each phase is logged and each phase is checkable: the machine, the login, the services, the build users, the two daemons, the three checkouts, the editor, the desktop, the question of whether any of it worked, and the size of what is left. A build that skips the question is a build that has never been run.

Procedure: image-description

Return the KIWI description of the image, as SXML.

The element order is the schema’s, not a preference: a description is read by KIWI’s validator before it is read by anybody else.

Procedure: image-description-xml

Return the KIWI description as XML text, ready to be written to a file.

Procedure: image-images-script

Return images.sh: what the build does to the files it produced.

KIWI calls this last, once per artefact, with the name it gave the image in $1. Both kinds are named here - the ISO you boot and the raw image you install - because a file people copy to a stick should say what it is.

Procedure: image-payload-script

Return heks-render: the desktop’s files, rendered on demand.

The image is built with this already done - that is what the last phase of config.sh checks - so this is not the first boot: it is the way to do it again. A channel pin moves, a home is lost, a palette switch goes wrong, and the answer is one command rather than a reinstall.

It renders exactly what the build renders, in the same order, because two lists that are meant to be the same list are two lists that will disagree.

Procedure: image-payload-unit

Return the unit that renders the desktop on the first boot, if it was not.

It exists for the builds that skip the rendering on purpose, so it is only enabled by image-render-at-build? being #f. The condition is the marker both the build and heks-render write: an image that was rendered leaves it behind, and the unit then has nothing to do even where it is enabled.

Procedure: image-repositories

Return the KIWI <repository> elements for the image.

Procedure: image-session-packages

Return the packages the live session itself needs.

Procedure: image-user-home

Return the live user’s home directory inside the image.

It is spelled out rather than computed from (getenv "HOME") because it is a path *inside another filesystem*: the one the build is not running in.

Procedure: install-image-config KEY: #:dir

Write the KIWI description for dir and return the directory.

Four files, of which three are the description and one is the overlay that config.sh installs: a description is a directory, not a configuration file, and KIWI expects exactly this shape.

1.10.3 Variables

Variable: image-base-packages
(patterns-base-base patterns-base-enhanced_base patterns-gnome-gnome_basic curl git gpg2 guix nix dracut-kiwi-oem-repart)
Variable: image-bootstrap-packages
(ca-certificates cracklib-dict-full diffutils filesystem gawk glibc-locale grep gzip openSUSE-release procps shadow udev xz)
Variable: image-build-log
"/var/log/heks-image.log"
Variable: image-iso-packages
(dracut-kiwi-live)
Variable: image-name
"heks-linux"
Variable: image-required-commands
("guix" "nix" "maak" "heks-toon" "lambdock" "emacs" "niri" "waybar" "wezterm")
Variable: image-required-paths
((".config/niri/config.kdl" . "the compositor's configuration") (".config/waybar/config.jsonc" . "the bar's configuration") (".config/waybar/style.css" . "the bar's stylesheet") (".config/rofi/config.rasi" . "the launcher's configuration") (".config/mako/config" . "the notifications' configuration") (".config/btop/btop.conf" . "the monitor's configuration") (".bashrc" . "the shell") (".emacs.d/init.el" . "the editor") (".local/bin/heks-language-label" . "the bar's layout label") (".local/bin/heks-wallpaper" . "the wallpaper engine") (".local/share/icons" . "the icon themes") (".config/digital-art-dreams" . "the wallpaper collection"))

Next: (heks-linux lambdock), Previous: (heks-linux gtk), Up: API