Writing a basic service for GNU Guix

submited by
Style Pass
2025-08-03 04:00:04

Note: before we proceed, we could make a kmonad "daemon" without going to the trouble of writing a Guix-specific service: we could start kmonad in a shell profile, write a cron job, or something else. The user experience of these methods might be the same, but writing a service keeps things organized and seems like the "right" way. If nothing else, it's a great learning opportunity.

First let's read the documentation of GNU Guix. We see that Guix offers "services" which extend the functionality of the operating system. The manual says:

Guix system services are connected by extensions. For instance, the secure shell service extends the Shepherd—the initialization system, running as PID 1—by giving it the command lines to start and stop the secure shell daemon (see openssh-service-type); the UPower service extends the D-Bus service by passing it its .service specification, and extends the udev service by passing it device management rules (see upower-service); the Guix daemon service extends the Shepherd by passing it the command lines to start and stop the daemon, and extends the account service by passing it a list of required build user accounts (see Base Services).

The Guix daemon sounds very similar to what we're looking to construct. Nearby, we see that the Guix daemon defines its own "service type":

Leave a Comment
Related Posts