4 ms·
Does Guix let you write interactive programs in Scheme as part of the system configuration? For example, defining a systemd service that uses Guile libraries an
by mbrock 8y ago
Does Guix let you write interactive programs in Scheme as part of the system configuration? For example, defining a systemd service that uses Guile libraries and so on, as a subexpression of your OS configuration file? While also referring to shared variables like the system's hostname, etc?
I skimmed the paper on "Code Staging in Guix" and I think this should be very doable, but I haven't yet tried Guix for real.
This ability seems like it would have huge implications for system development... I've dabbled with such experiments using Nix, but the lack of hygienic code staging makes it a bit icky.
- rekado 8y agoI don't know about interactive programs; in Guix we like system configuration to be non-interactive. We don't use systemd but the Shepherd, which is written in Guile Scheme, so system services are indeed written in Scheme and can use Guile libraries. It is a common pattern to define services as the result of procedures taking variables as arguments. System services in Guix don't have to be limited to Shepherd services. The system service framework in Guix is very flexible and can be used for almost any system setup task, even for mere "activation services" that create directories or files. Services can extend other services: http://www.gnu.org/software/guix/manual/en/html_node/Service-Composition.html http://www.gnu.org/software/guix/manual/en/html_node/Service...