Dev

Developing Wayland Compositors with Atomic Fedora Silverblue

Atomic distributions are often seen as unsuitable for system development, but their rollback functionality can be a powerful ally. Insights from the developer of niri.

5 min read Reviewed & edited by the SINGULISM Editorial Team

Developing Wayland Compositors with Atomic Fedora Silverblue
Photo by Jack Finnigan on Unsplash

The rise of immutable (atomic) distributions continues. With options like Fedora Silverblue, Bazzite, Vanilla OS, and SteamOS expanding year by year, the user base for these distributions is also growing. However, atomic distributions often carry a reputation for being “hard to customize” or “unsuitable for development environments.”

That said, there are engineers who have been using atomic distributions as their primary development environment for over five years. According to an article posted on Lobsters, the developer of niri, a scrollable, tiling Wayland compositor, uses Fedora Silverblue daily and even develops this core OS component in that environment.

From a conventional perspective, developing a Wayland compositor—given that it is a system component integrated directly into the host OS—might seem impossible to test properly using containers or virtual machines. For this reason, the developer addresses the question of “why choose an atomic distribution” by explaining specific practices and the benefits they offer.

The Design of Atomic Distributions

Fedora Silverblue is positioned as the “spiritual counterpart” to Fedora Workstation, designed as an immutable variant of the OS. Unlike traditional package management, system updates in Silverblue don’t replace files in place. Instead, a new system image is built in a separate folder and is switched to during the next reboot. The core mechanism enabling this is called OSTree, which is described as “git for operating system binaries.”

The greatest advantage of this approach lies in its reliability. Package conflicts or errors are detected during the assembly of the new version, preventing the running system from being disrupted. Additionally, if any issues arise after an update, users can simply select the previous version at reboot and revert to the original state as though nothing had happened. This “reboot and revert” function is especially powerful during major version upgrades. When the next Fedora beta is released, you can easily rebase and test it, and if there are any problems, reboot back into the stable version without any hassle.

Misconceptions and Reality for Developers

One common misconception about atomic distributions is that they are “unsuitable for developing system components.” The concern is that if the core parts of the OS are immutable, it would be impossible to test code changes.

However, the author of the article offers a completely different perspective. The “rollback after updates” characteristic of atomic distributions provides a significant advantage for system developers. For those who frequently make changes that could potentially break the system, the ability to experiment safely is indispensable.

The actual development process begins with a pre-installed tool called Toolbox. Toolbox provides a mutable Fedora environment within a container. You can freely install packages with sudo dnf install, and host resources like Wayland sockets are automatically mounted. In other words, the development environment itself is self-contained within the container, and minimal changes are made to the host OS. This allows developers to safely manage the libraries and tools required for compositor development.

Practical Workflow for System Changes

Even if you need to modify the host OS itself, the advantages of an atomic distribution come into play. For example, if you need to test a compositor system-wide, you can make the necessary changes, reboot to check its operation, and roll back to the previous state if issues arise. The author describes this process as liberating, likening it to the sense of freedom when you first learn version control for source code. The assurance of being able to revert changes at any time reduces the psychological barriers to experimentation.

By leveraging the capabilities of OSTree, you can integrate a compositor under development into the system, test it, and immediately roll back if it fails. This workflow proves invaluable for scenarios requiring host-level testing, such as controlling input devices or directly managing GPUs, tasks that are challenging to replicate in virtual machines or containers.

The Expanding Ecosystem of Atomic Distributions

Today, there are many options for atomic distributions. Fedora’s desktop variants, the gaming-focused Bazzite, GNOME OS Nightly, and SteamOS—the operating system powering the Steam Deck—are all atomic. Many of these distributions are based on OSTree, and they offer various flavors tailored to different user needs.

Screenshots from the release notes published by the niri developer frequently feature Fedora Silverblue’s UI. This is no coincidence; it is a testament to its practicality as a development environment.

Editorial Perspective

Short-term Impact Atomic distributions have traditionally been seen as stable choices for end-users. However, this case study could potentially change perspectives within the developer community. As the Wayland ecosystem matures and the demand for custom compositor development grows, the value proposition of “an OS that allows safe experimentation even when things break” may add a new dimension to the criteria for selecting development environments. Over the next 3–6 months, we expect an increase in developer-oriented tutorials and documentation for atomic distributions.

Long-term Outlook Over the next 1–3 years, the integration of atomic distributions with container technologies is likely to deepen. Tools like Toolbox and Distrobox, which provide development environment containers, enable flexible tool management while maintaining the immutability of the host OS. This approach is attractive to organizations seeking both security and development efficiency. If the advantages of atomic distributions for system component developers become widely recognized, it could lead to increased reliability across the Linux desktop ecosystem. At the practical level, the traditional risk of “development environments breaking due to OS updates” could dramatically decrease.

Editorial Question While the rollback functionality of atomic distributions is undeniably powerful, could it be that what developers truly seek is not “an unbreakable OS,” but “a system that can be easily restored if broken”? From this perspective, how significant is the practical difference between atomic update mechanisms like OSTree and simpler snapshot features like Btrfs or ZFS? Whether atomic distributions will become the de facto choice for system developers may depend on how clearly this distinction can be demonstrated.

References

Frequently Asked Questions

Is it really possible to develop Wayland compositors on an atomic distribution like Fedora Silverblue?
Yes, it is. The compositors themselves can be developed within a Toolbox container, and even if changes need to be made to the host OS for testing, you can safely roll back to a previous state, making it a secure environment for development. The author of the article (the developer of niri) has successfully used this environment for over five years.
Which is better for development: an atomic distribution or Fedora Workstation?
It depends on the use case. For system component development, the rollback feature of atomic distributions is a strong advantage. However, if you frequently create custom kernel modules or need to finely tune the entire system, Fedora Workstation offers greater flexibility.
What exactly is Toolbox?
Toolbox is a development tool pre-installed in Fedora Silverblue, utilizing podman containers. Within the container, you have a mutable Fedora environment where you can freely use `sudo dnf install`. Host resources, such as Wayland sockets, are automatically mounted, making it suitable for GUI application development.
Source: Lobsters

Comments

← Back to Home