[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

A friendlier API for operating-system declarations

From: Edouard Klein
Subject: A friendlier API for operating-system declarations
Date: Thu, 23 Mar 2023 09:06:52 +0100
User-agent: mu4e 1.8.13; emacs 28.2

Dear Guixers,

For my clients and my own use, I use a layer on top of operating-system
declarations in which I create functions that take an os as a first
argument, and return an os.

With the help of the handy -> macro, I can chain them, thus allowing an
easy stacking of multiple "roles" or "functionalities" on the same
machine, and an easy transfer of said functionality to another machine:
just cut and paste one line from one declaration to the other.

I have written a tutorial for my clients here:

that gives an example of what an os configuration may look like:
#+begin_src scheme
 (minimal-ovh "ssh-rsa AAASomethingSomething== root@minimal-ovh")
 (http-static-content "" #:to-dir "/srv/sub2")
 (http-static-content "" #:to-dir "/srv/sub1/")
 (add-services my-db))

The code of the function is on my channel:

After a few months of experience, and positive feedback from my clients,
my question to you guys is: would you be interested in mainlining this,
or should I keep my development efforts separate in my channel ?

I do think this API is easier than manipulating services, and although
extendable services are awesome and a very nifty piece of engineering,
they require quite a good knowledge of scheme and take a while to be
used to, while this new API, while way less powerful, lowers the barrier
to entry for newcomers.

They are an easy way to maintain a declarative whole operating system
configuration, with a syntax similar enough to docker and ansible that
sysadmins familiar with it can quickly get up and running, thus exposing
more people to Guix.

What do you think ?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]