Bootc
Nix-caliga is gradually increasing the number of bootc specific options over time.
Mainly focused on Fedora, there will likely be a lot of breaking changes here as the Fedora-bootc image itself changes.
Ostree-prepare-root
config.bootc.ostree-prepare-root configures /usr/lib/ostree/prepare-root.conf.
This file is read during initramfs to configure how the root filesystem is set up at boot. See ostree-prepare-root.
Because this file is read from the initramfs, any changes require regenerating the initramfs to take effect.
Transient /etc
config.bootc.ostree-prepare-root.transientEtc mounts /etc as a transient overlay at boot. Changes to /etc are not persisted across reboots. This is encouraged by upstream bootc when possible.
Enabling config.bootc.ostree-prepare-root.transientEtc automatically:
- Enables
config.bootc.ostree-prepare-root.createConf - Enables
config.bootc.initramfs.regenerate.enable(so the initramfs picks up the new config)
When config.bootc.ostree-prepare-root.transientEtc is enabled, boot.automount is masked and replaced with mount units for /boot (ext4, by-label boot) and /boot/efi (vfat, by-label EFI-SYSTEM).
This works around issues seemingly with /etc/fstab handling under transient etc.
Requires config.caliga.core.systemd.enable = true.
Initramfs Regeneration
Because streamLayeredImage cannot run commands against the base image’s kernel or modules, initramfs regeneration must happen in a separate podman build step using a Containerfile.
Setting config.bootc.initramfs.regenerate.enable = true adds config.bootc.initramfs.regenerate.command to the end of the generated containerfile. The command defaults to running dracut.
Requires config.caliga.core.containerfile.enable = true.
If config.caliga.core.containerfile.file is set the built-in dracut command is ignored in favor of your containerfile.
Automatic Updates
The config.services.bootc-update module sets up a systemd timer that runs bootc upgrade on a schedule.
It masks the upstream bootc-fetch-apply-updates units to avoid conflicts.
Requires config.caliga.core.systemd.enable = true.
Registry Authentication
Two options are provided for authenticating with private registries:
config.services.bootc-update.auth- Builds
auth.jsoninto the image at/etc/ostree/auth.json. Credentials are baked in at image build time. Requiresconfig.caliga.core.etc-usr.enable(see etc-usr) = true.
- Builds
config.services.bootc-update.authFile- Symlinks an existing file on the host to
/etc/ostree/auth.jsonat runtime through tmpfiles. Requiresconfig.caliga.core.tmpfiles.enable = true. Takes priority overconfig.services.bootc-update.authif both are set.
- Symlinks an existing file on the host to
Auth values are base64-encoded user:pass strings, generate with echo -n 'user:pass' | base64.
Options
config.bootc.ostree-prepare-root
config.bootc.ostree-prepare-root.createConf- Write
/usr/lib/ostree/prepare-root.confinto the image. Defaults tofalse.
- Write
config.bootc.ostree-prepare-root.transientEtc- Mount
/etcas a transient overlay at boot. Defaults tofalse.
- Mount
config.bootc.ostree-prepare-root.additionalConf- Additional lines appended to
prepare-root.conf. Defaults to enabling composefs and readonly sysroot.
- Additional lines appended to
config.bootc.initramfs
config.bootc.initramfs.regenerate.enable- Add an initramfs regeneration step to
caliga.core.containerfile. Defaults tofalse.
- Add an initramfs regeneration step to
config.bootc.initramfs.regenerate.command- The command to run to regenerate the initramfs. Defaults to a
dracutcommand.
- The command to run to regenerate the initramfs. Defaults to a
config.services.bootc-update
config.services.bootc-update.enable- Enable the automatic update timer.
config.services.bootc-update.autoReboot- Reboot after applying an update (
bootc upgrade --apply). Defaults totrue.
- Reboot after applying an update (
config.services.bootc-update.schedule.onBootSec- Delay after boot before the first update check. Defaults to
30s.
- Delay after boot before the first update check. Defaults to
config.services.bootc-update.schedule.onUnitActiveSec- Interval between update checks. Defaults to
1h.
- Interval between update checks. Defaults to
config.services.bootc-update.schedule.onCalendar- If set, overrides
config.services.bootc-update.schedule.onBootSecandconfig.services.bootc-update.schedule.onUnitActiveSecwith a calendar expression (e.g. “daily”). Defaults tonull.
- If set, overrides
config.services.bootc-update.auth- Registry credentials baked into the image.
config.services.bootc-update.authFile- Path to a
containers-auth.jsonfile on the host, symlinked at runtime.
- Path to a