<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom"><title>there was a fish in the calculator</title><id>https://fishinthecalculator.me/feeds/tags/guix.xml</id><subtitle>Tag: guix</subtitle><updated>2026-06-20T23:08:59Z</updated><link href="https://fishinthecalculator.me/feeds/tags/guix.xml" rel="self" /><link href="https://fishinthecalculator.me" /><entry><title>Arguments parsing in Guile</title><id>https://fishinthecalculator.me/blog/arguments-parsing-in-guile.html</id><author><name>Giacomo Leidi</name><email>therewasa@fishinthecalculator.me</email></author><updated>2026-05-05T23:50:00Z</updated><link href="https://fishinthecalculator.me/blog/arguments-parsing-in-guile.html" rel="alternate" /><content type="html">&lt;p&gt;While Guile Scheme has a lot of hidden gems, like &lt;code&gt;(ice-9 peg)&lt;/code&gt;, parsing command line arguments is not one of its strengths in my opinion. Even if there are many powerful approaches to structured argument parsing, there is no API simple enough for me to know it by heart (as opposed for example to Python &lt;code&gt;ArgumentParser&lt;/code&gt;).&lt;/p&gt;&lt;p&gt;In this post, I will analyze some of what I believe to be shortcomings of existing command line arguments parsing libraries and present my proposal for a new iteration with a new, small, API for parsing arguments in Guile. It is small enough to fit in my brain, so I think we may be onto something here.&lt;/p&gt;&lt;h3 id=&quot;on_llms&quot;&gt;On LLMs&lt;/h3&gt;&lt;p&gt;The first commit of my library has been partially created with the help of a large language model.  The commit message contains the attribution information and the prompt I used.  I am aware that currently LLM provider companies are actively harming people and the environment, enabling racial profiling and supporting governments in making wars against international laws.  Nevertheless, I tried one of the commercial LLMs to test its capabilities from a technological standpoint.  In general, I believe that there is an ethical way of training and operating LLMs, one that respects content creators, users, workers and the environment. This post is not about LLMs, but if you have any comment or feedback for me, feel free to reach out either on the Fediverse or via email.&lt;/p&gt;&lt;h2 id=&quot;(ice-9_getopt-long)&quot;&gt;(ice-9 getopt-long)&lt;/h2&gt;&lt;p&gt;The &lt;code&gt;(ice-9 getopt-long)&lt;/code&gt; module is the first API we'll take into consideration, it is modelled after the C library of the same name. According to &lt;code&gt;git log&lt;/code&gt;, it is the oldest command line parsing API around, it was added to Guile in 1999!&lt;/p&gt;&lt;pre&gt;&lt;code&gt;commit 4925695e21f9150632c4173a7814ce78aacd80bc
Author: Jim Blandy &amp;lt;jimb@red-bean.com&amp;gt;
Date:   Fri Feb 12 10:09:29 1999 +0000

* getopt-long.scm: Remove debugging calls to `pk'.
A new argument-processing package from Russ McManus.
* getopt-long.scm: New file.
* Makefile.am (ice9_sources): Added getopt-long.scm.
* Makefile.in: Regenerated.&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Its designed around the idea that it should only take care of short (&lt;code&gt;-s&lt;/code&gt;) and long (&lt;code&gt;--long&lt;/code&gt;) options, leaving the parsing of positional arguments (optionally delimited by &lt;code&gt;--&lt;/code&gt;) to the caller. One would define an option specification:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;define&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;option-spec&lt;/span&gt;
  &lt;span class=&quot;syntax-symbol&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;help&lt;/span&gt;
     &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;single-char&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;#\h&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
     &lt;span class=&quot;syntax-comment&quot;&gt;;; --help does not accept a value
&lt;/span&gt;     &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;value&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;#f&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;shout&lt;/span&gt;
     &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;single-char&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;#\s&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
     &lt;span class=&quot;syntax-comment&quot;&gt;;; --shout does not accept a value
&lt;/span&gt;     &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;value&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;#f&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;language&lt;/span&gt;
     &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;single-char&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;#\l&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
     &lt;span class=&quot;syntax-comment&quot;&gt;;; --shout accepts a value
&lt;/span&gt;     &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;value&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;#t&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This code defines three options:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;code&gt;-h&lt;/code&gt;/&lt;code&gt;--help&lt;/code&gt; which is intended to print an help message&lt;/li&gt;&lt;li&gt;&lt;code&gt;-s&lt;/code&gt;/&lt;code&gt;--shout&lt;/code&gt; and &lt;code&gt;-l&lt;/code&gt;/&lt;code&gt;--language&lt;/code&gt; which are business logic related flags&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;code&gt;getopt-long&lt;/code&gt; accepts short and long forms interchangeably, without making distinction. An example is that &lt;code&gt;greet.scm --language it --shout hajar&lt;/code&gt;, &lt;code&gt;greet.scm --language en -s hajar&lt;/code&gt; and &lt;code&gt;greet.scm -sl it hajar&lt;/code&gt; have all the same meaning.&lt;/p&gt;&lt;p&gt;Notice that this specification contains a &lt;code&gt;-h&lt;/code&gt; flag, but &lt;code&gt;getopt-long&lt;/code&gt; does not handle that by default as some similar APIs do. You are the one that should detect that the &lt;code&gt;'help&lt;/code&gt; option has been passed and emit the help message yourself:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;&lt;span class=&quot;syntax-comment&quot;&gt;;; Help message
&lt;/span&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;define&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;show-help&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;display&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;Usage: greet.scm [OPTIONS] NAME

Say hello to someone\n&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;newline&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;display&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;Positional arguments:&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;newline&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;display&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;  NAME&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;newline&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;newline&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;display&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;Options:&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;display&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;
  -h, --help             Show this help message and exit&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;display&lt;/span&gt;  &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;
  -s, --shout&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;newline&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;display&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;
  -l, --language LEVEL    (default: en)&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;newline&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;syntax-comment&quot;&gt;;; Parse command line into a structured object
&lt;/span&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;define&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;options&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;getopt-long&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;command-line&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;option-spec&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;syntax-comment&quot;&gt;;; Use the parsed arguments
&lt;/span&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;let*&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;language&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;option-ref&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;options&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;'language&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;en&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
       &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;shout?&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;option-ref&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;options&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;'shout&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;#f&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
       &lt;span class=&quot;syntax-comment&quot;&gt;;; Handle user passing --help
&lt;/span&gt;       &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;help&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;when&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;option-ref&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;options&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;'help&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;#f&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
               &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;show-help&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
               &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;exit&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
       &lt;span class=&quot;syntax-comment&quot;&gt;;; Obtain positional arguments list
&lt;/span&gt;       &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;positional-args&lt;/span&gt;
        &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;cdr&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;first&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;options&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
       &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;or&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;not&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;positional-args&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                     &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;null?&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;positional-args&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                 &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;error&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;NAME argument is required but none was passed&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                 &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;first&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;positional-args&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
       &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;msg&lt;/span&gt;
        &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;string-append&lt;/span&gt;
         &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;and&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;string?&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;language&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;string=?&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;language&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;it&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
             &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;ciao, &amp;quot;&lt;/span&gt;
             &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;hello, &amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
         &lt;span class=&quot;syntax-symbol&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;display&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;shout?&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;string-upcase&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;msg&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;msg&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;newline&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;h4 id=&quot;a_note_on_argument_parsing&quot;&gt;A note on argument parsing&lt;/h4&gt;&lt;blockquote&gt;&lt;p&gt;As you will notice later, all the examined libraries and the one I wrote follow the same general algorithm:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Declare some kind of structured specification&lt;/li&gt;&lt;li&gt;Derive some parsing rules from the specification&lt;/li&gt;&lt;li&gt;Apply the parsing to a list of command line arguments&lt;/li&gt;&lt;li&gt;Provide the user with some key of key-value data structure&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;In the above example point &lt;code&gt;1.&lt;/code&gt; is the &lt;code&gt;option-spec&lt;/code&gt; declaration, points &lt;code&gt;2.&lt;/code&gt; and &lt;code&gt;3.&lt;/code&gt; happen inside &lt;code&gt;getopt-long&lt;/code&gt; and point &lt;code&gt;4.&lt;/code&gt; happens in the last &lt;code&gt;let&lt;/code&gt;.&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;With the above code we can run a simple greeter with a basic command line interface with:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;$ guile -s greet-getopt-long.scm -s --language it hajar
CIAO, HAJAR
$ guile -s greet-getopt-long.scm -h

Usage: greet-getopt-long.scm [OPTIONS] NAME

Say hello to someone.

Positional arguments:
  NAME

Options:
  -h, --help               Show this help message and exit
  -s, --shout
  -l, --language LANGUAGE   (default: en)&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;In case you are interested you can also &lt;a href=&quot;/static/code/greet-getopt-long.scm&quot;&gt;have a look at the complete code&lt;/a&gt; for the &lt;code&gt;getopt-long&lt;/code&gt; example.&lt;/p&gt;&lt;p&gt;In general &lt;code&gt;(ice-9 getopt-long)&lt;/code&gt; is a solid and battle tested API. In case having additional dependencies outside of the Guile runtime is not acceptable, I think it is still a nice option to have, but it could be easier to use.&lt;/p&gt;&lt;p&gt;Default values are specified at &lt;code&gt;option-ref&lt;/code&gt; call site, this means that if you read an option with a default value in multiple places you might forget to set the default value in one. Additionally the option specification format (albeit powerful, as it allows more features than I show above, &lt;a href=&quot;https://www.gnu.org/software/guile/manual/html_node/Option-Specification.html&quot;&gt;like type validation and more&lt;/a&gt;) is not easy to remember (at least for me) and it does not allow describing positional arguments.&lt;/p&gt;&lt;p&gt;One last detail is the need for users to handle &lt;code&gt;--help&lt;/code&gt; by themselves. It's good to be able to opt in in that fine grained control but most simple scripts that just want to accept some values (I think of the output of many &lt;code&gt;program-file&lt;/code&gt; gexps all over Guix) are usually fine with the library generating the help message and handling scenarios when the user passes &lt;code&gt;-h&lt;/code&gt; or &lt;code&gt;--help&lt;/code&gt;.&lt;/p&gt;&lt;h2 id=&quot;(srfi_srfi-37)&quot;&gt;(srfi srfi-37)&lt;/h2&gt;&lt;p&gt;&lt;code&gt;(srfi srfi-37)&lt;/code&gt; is the second oldest Guile API for parsing command line arguments, it was first added to Guile in 2007:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;commit d4c382218de2050de207318e9d8558c0aac6a7b9
Author: Ludovic Courtès &amp;lt;ludo@gnu.org&amp;gt;
Date:   Wed Jul 18 20:40:09 2007 +0000

Revision: lcourtes@laas.fr--2006-libre/guile-core--cvs-head--0--patch-81
Creator:  Ludovic Courtes &amp;lt;ludovic.courtes@laas.fr&amp;gt;

Added SRFI-37, by Stephen Compall.

(See ChangeLogs.)&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;It is similar to &lt;code&gt;(ice-9 getopt-long)&lt;/code&gt; in spirit: positional arguments are left up to the user to be parsed, help messages must be manually crafted and the user must manually handle &lt;code&gt;--help&lt;/code&gt; (even if it's easier than with &lt;code&gt;(ice-9 getopt-long)&lt;/code&gt;) and options are declared in a specification.&lt;/p&gt;&lt;pre&gt;&lt;code&gt;&lt;span class=&quot;syntax-comment&quot;&gt;;; Options specification
&lt;/span&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;define&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;%options&lt;/span&gt;
  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;list&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;option&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;#\s&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;shout&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;#f&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;#f&lt;/span&gt;               &lt;span class=&quot;syntax-comment&quot;&gt;;(short long) mandatory? optional?
&lt;/span&gt;                &lt;span class=&quot;syntax-comment&quot;&gt;;; Here the API is leaking,
&lt;/span&gt;                &lt;span class=&quot;syntax-comment&quot;&gt;;; the end result is simply to
&lt;/span&gt;                &lt;span class=&quot;syntax-comment&quot;&gt;;; set 'shout? to #t
&lt;/span&gt;                &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;lambda&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;opt&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;arg&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;result&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;alist-cons&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;'shout?&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;#t&lt;/span&gt;
                              &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;alist-delete&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;'shout?&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;result&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;option&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;#\h&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;help&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;#f&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;#f&lt;/span&gt;
                &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;lambda&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;args&lt;/span&gt;
                  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;show-help&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;exit&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;option&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;#\l&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;language&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;#t&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;#f&lt;/span&gt;
                &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;lambda&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;opt&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;arg&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;result&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;alist-cons&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;'language&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;arg&lt;/span&gt;
                              &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;alist-delete&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;'language&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;result&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;define&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;%default-options&lt;/span&gt;
  &lt;span class=&quot;syntax-comment&quot;&gt;;; Alist of default option values.
&lt;/span&gt;  &lt;span class=&quot;syntax-symbol&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;shout?&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;#f&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;language&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;en&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
    
&lt;span class=&quot;syntax-comment&quot;&gt;;; Display help message
&lt;/span&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;define&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;show-help&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;display&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;Usage: greet.scm [OPTIONS] NAME

Say hello to someone\n&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;newline&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;display&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;Positional arguments:&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;newline&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;display&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;  NAME&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;newline&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;newline&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;display&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;Options:&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;display&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;
  -h, --help             Show this help message and exit&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;display&lt;/span&gt;  &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;
  -s, --shout&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;newline&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;display&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;
  -l, --language LEVEL    (default: en)&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;newline&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;But still, there are some differences. &lt;code&gt;(srfi srfi-37)&lt;/code&gt; makes it easier to handle &lt;code&gt;--help&lt;/code&gt; with its callback approach in the specification, but the in general the API is leaking, forcing the user to manually manipulate options with &lt;code&gt;alist-cons&lt;/code&gt; and &lt;code&gt;alist-delete&lt;/code&gt;. Any user error here will weirdly break programs without users not easily noticing.&lt;/p&gt;&lt;p&gt;The second difference of &lt;code&gt;(srfi srfi-37)&lt;/code&gt; is &lt;code&gt;args-fold&lt;/code&gt;. It is called instead of calling &lt;code&gt;getopt-long&lt;/code&gt;, it returns an association list mapping option names to option values. This format has the nice property of being easily introspectable and easy to change programmatically.&lt;/p&gt;&lt;pre&gt;&lt;code&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;define&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;options&lt;/span&gt;
  &lt;span class=&quot;syntax-comment&quot;&gt;;; Derive parsing rules from the options specification,
&lt;/span&gt;  &lt;span class=&quot;syntax-comment&quot;&gt;;; and parse the command line into an association list.
&lt;/span&gt;  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;args-fold&lt;/span&gt;
   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;cdr&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;command-line&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;syntax-symbol&quot;&gt;%options&lt;/span&gt;
   &lt;span class=&quot;syntax-comment&quot;&gt;;; Called in case of an unrecognized option
&lt;/span&gt;   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;lambda&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;opt&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;arg&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;result&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
     &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;display&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;~A: unrecognized option~%&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;syntax-comment&quot;&gt;;; Accumulation procedure for positional arguments
&lt;/span&gt;   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;lambda&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;arg&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;result&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
     &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;alist-cons&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;'argument&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;arg&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;result&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;syntax-comment&quot;&gt;;; Start seed
&lt;/span&gt;   &lt;span class=&quot;syntax-symbol&quot;&gt;%default-options&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;let*&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;language&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;assoc-ref&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;options&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;'language&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
       &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;shout?&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;assoc-ref&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;options&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;'shout?&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
       &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;assoc-ref&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;options&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;'argument&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
       &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;msg&lt;/span&gt;
        &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;not&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
            &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;error&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;NAME argument is required but none was passed&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
            &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;string-append&lt;/span&gt;
             &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;and&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;string?&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;language&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;string=?&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;language&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;it&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                 &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;ciao, &amp;quot;&lt;/span&gt;
                 &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;hello, &amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
             &lt;span class=&quot;syntax-symbol&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;display&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;shout?&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;string-upcase&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;msg&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;msg&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;newline&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This script is completely equivalent to the example for &lt;code&gt;(ice-9 getopt-long)&lt;/code&gt;, &lt;a href=&quot;/static/code/greet-srfi37.scm&quot;&gt;check out its complete code&lt;/a&gt; in case you are interested.&lt;/p&gt;&lt;p&gt;&lt;code&gt;(srfi srfi-37)&lt;/code&gt; is sligthly easier to use than &lt;code&gt;(ice-9 getopt-long)&lt;/code&gt;, but the option specification format is even more difficult to remember. I am almost unable to write or modify an option specification without having the Guile manual open. &lt;code&gt;args-fold&lt;/code&gt; is super cool, it just misses support for parsing positional arguments to be perfect.&lt;/p&gt;&lt;h2 id=&quot;guile-config&quot;&gt;guile-config&lt;/h2&gt;&lt;p&gt;This is probably the most complex tool in the list and definitely the one with a broader scope. It has been my default up until now, as it is very handy and follows a batteries included approach. &lt;a href=&quot;https://gitlab.com/a-sassmannshausen/guile-config&quot;&gt;guile-config&lt;/a&gt; is a library to declare application configurations specifications that are used to derive command line interfaces and configuration files. It does a lot of stuff, I really invite you to check it out as in my opinion for medium sized projects is perfect. My dream is that the portion of &lt;code&gt;guile-config&lt;/code&gt;'s code that overlaps with &lt;code&gt;(guix records)&lt;/code&gt; would be abstracted from both projects into a common dependency, but this is another story and we will tell it another time.&lt;/p&gt;&lt;p&gt;In &lt;code&gt;guile-config&lt;/code&gt;, users declare the configuration of an application with a &lt;code&gt;configuration&lt;/code&gt; record:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;use-modules&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;config&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;define&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;%configuration&lt;/span&gt;
  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;configuration&lt;/span&gt;
   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;'greet-config&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;synopsis&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;The configuration of greet-config.&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;keywords&lt;/span&gt;
    &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;list&lt;/span&gt;
     &lt;span class=&quot;syntax-comment&quot;&gt;;; Command line options or
&lt;/span&gt;     &lt;span class=&quot;syntax-comment&quot;&gt;;; configuration file fields
&lt;/span&gt;     &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;switch&lt;/span&gt;
      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;'language&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;character&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;#\l&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;default&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;en&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;test&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;string?&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;handler&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;identity&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;example&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;it&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;synopsis&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;Language to use.&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;description&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;The language to use for the output.&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
     &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;switch&lt;/span&gt;
      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;'shout?&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;character&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;#\s&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;default&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;#f&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;test&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;boolean?&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;handler&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;identity&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;synopsis&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;Enable shouting mode&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;description&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;Whether to enable shouting mode.&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;syntax-comment&quot;&gt;;; Positional arguments
&lt;/span&gt;   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;arguments&lt;/span&gt;
    &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;list&lt;/span&gt;
     &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;argument&lt;/span&gt;
      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;'name&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;test&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;string?&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;handler&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;identity&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;example&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;Hajar&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;synopsis&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;Name of a friend&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;description&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;The name of the friend you want to greet.&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;parser&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;sexp-parser&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;copyright&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;Giacomo Leidi &amp;lt;therewasa@fishinthecalculator.me&amp;gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;version&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;0.1.0&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;license&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;GPL3+&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;author&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;Giacomo Leidi&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This record contains all informations to derive command line option names, types and help messages. This allows guile-config to perform validation and help message generation on behalf of the user.&lt;/p&gt;&lt;pre&gt;&lt;code&gt;&lt;span class=&quot;syntax-comment&quot;&gt;;; Parse options and in case -h/--help is detected
&lt;/span&gt;&lt;span class=&quot;syntax-comment&quot;&gt;;; generate the help message, display it and exit
&lt;/span&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;define&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;options&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;getopt-config-auto&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;command-line&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;%configuration&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;syntax-comment&quot;&gt;;; Access configuration values
&lt;/span&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;let*&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;language&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;option-ref&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;options&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;'language&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
       &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;shout?&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;option-ref&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;options&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;'shout?&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
       &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;option-ref&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;options&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
       &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;msg&lt;/span&gt;
        &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;string-append&lt;/span&gt;
         &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;and&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;string?&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;language&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;string=?&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;language&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;it&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
             &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;ciao, &amp;quot;&lt;/span&gt;
             &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;hello, &amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
         &lt;span class=&quot;syntax-symbol&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;display&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;shout?&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;string-upcase&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;msg&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;msg&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;newline&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Here is the &lt;a href=&quot;/static/code/greet-config.scm&quot;&gt;complete code for the above script&lt;/a&gt;. It is exactly what I need, were it not for the focus on configuration files also, as you can notice from the &lt;code&gt;(parser sexp-parser)&lt;/code&gt; line of the configuration specification. This is a specification for something that can be parsed from a file, not a specification of a simple command line interface.&lt;/p&gt;&lt;p&gt;In many cases people just want to write small scripts calling each other and having a structured command line interface that performs validation and is easy to write. My hope with &lt;code&gt;guile-arguments&lt;/code&gt; is to create exactly that.&lt;/p&gt;&lt;h2 id=&quot;guile-arguments&quot;&gt;guile-arguments&lt;/h2&gt;&lt;p&gt;&lt;code&gt;(arguments)&lt;/code&gt; was born due to an itch I often get while writing Guile scripts. In case they are very simple I always resort to calling &lt;code&gt;(first (command-line))&lt;/code&gt;, &lt;code&gt;(second (command-line))&lt;/code&gt; and so on, because I am never able to remember any of the above API by heart. In some case where I really needed a structured command line API I even resorted to Python. No parentheses, can you imagine?&lt;/p&gt;&lt;p&gt;&lt;code&gt;(arguments)&lt;/code&gt; API is really small and hopefully easy to remember. Users first have to declare a parser specification, which defines all the options the command will have:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;use-modules&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;arguments&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;syntax-comment&quot;&gt;;; We declare a structured specification of the
&lt;/span&gt;&lt;span class=&quot;syntax-comment&quot;&gt;;; command line API
&lt;/span&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;define&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;parser&lt;/span&gt;
  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;argument-parser&lt;/span&gt;
    &lt;span class=&quot;syntax-keyword&quot;&gt;#:program&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;greet&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;syntax-keyword&quot;&gt;#:description&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;Say hello to someone.&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;syntax-comment&quot;&gt;;; Flags are boolean toggles, #f by default
&lt;/span&gt;    &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;flag&lt;/span&gt;
      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;'shout?&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;short&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;#\s&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;help&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;Shout instead of speaking&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;syntax-comment&quot;&gt;;; Options are arguments that take a value,
&lt;/span&gt;    &lt;span class=&quot;syntax-comment&quot;&gt;;; if multiple? is #t they can be passed multiple
&lt;/span&gt;    &lt;span class=&quot;syntax-comment&quot;&gt;;; times to represent lists
&lt;/span&gt;    &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;option&lt;/span&gt;
      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;'language&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;short&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;#\l&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;default&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;en&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;help&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;Language code&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;syntax-comment&quot;&gt;;; Positional arguments are arguments referenced
&lt;/span&gt;    &lt;span class=&quot;syntax-comment&quot;&gt;;; by position. They also can be multiple? but
&lt;/span&gt;    &lt;span class=&quot;syntax-comment&quot;&gt;;; only one of them can and it must be the last
&lt;/span&gt;    &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;positional&lt;/span&gt;
      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;'name&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;help&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;Name of the friend to greet&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Next users must call &lt;code&gt;parse-arguments&lt;/code&gt; to get back a structured object representing the command line:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;&lt;span class=&quot;syntax-comment&quot;&gt;;; Parse command line. parse-arguments parses (cdr (command-line)) by default,
&lt;/span&gt;&lt;span class=&quot;syntax-comment&quot;&gt;;; but in case you want to pass the command line yourself, you can pass it
&lt;/span&gt;&lt;span class=&quot;syntax-comment&quot;&gt;;; as the last argument: (parse-arguments parser your-command-line)
&lt;/span&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;define&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;arguments&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;parse-arguments&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;parser&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;syntax-comment&quot;&gt;;; Unpack arguments and use them
&lt;/span&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;match-arguments&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;arguments&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;shout?&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;language&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;msg&lt;/span&gt;
         &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;string-append&lt;/span&gt;
          &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;string=?&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;language&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;it&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
              &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;ciao, &amp;quot;&lt;/span&gt;
              &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;hello, &amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
          &lt;span class=&quot;syntax-symbol&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;display&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;shout?&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;string-upcase&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;msg&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;msg&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;newline&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;In this example we use &lt;code&gt;match-arguments&lt;/code&gt; which is syntax sugar around the &lt;code&gt;arguments-ref&lt;/code&gt; primitive to destructure arguments values out of the return value of &lt;code&gt;parse-arguments&lt;/code&gt;. In case users only want to access a single argument value they can call &lt;code&gt;(arguments-ref 'name-of-the-argument)&lt;/code&gt;.&lt;/p&gt;&lt;p&gt;There is not much more, the above would already be equivalent to the earlier examples:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;$&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;guix&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;shell&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;guile&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;-f&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;guix.scm&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;--&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;guile&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;-s&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;examples/greet.scm&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;-h&lt;/span&gt;
&lt;span class=&quot;syntax-symbol&quot;&gt;Usage:&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;greet&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;OPTIONS&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;NAME&lt;/span&gt;

&lt;span class=&quot;syntax-symbol&quot;&gt;Say&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;hello&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;to&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;someone.&lt;/span&gt;

&lt;span class=&quot;syntax-symbol&quot;&gt;Positional&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;arguments:&lt;/span&gt;
  &lt;span class=&quot;syntax-symbol&quot;&gt;NAME&lt;/span&gt;              &lt;span class=&quot;syntax-symbol&quot;&gt;Name&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;of&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;the&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;friend&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;to&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;greet&lt;/span&gt;

&lt;span class=&quot;syntax-symbol&quot;&gt;Options:&lt;/span&gt;
  &lt;span class=&quot;syntax-symbol&quot;&gt;-h,&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;--help&lt;/span&gt;               &lt;span class=&quot;syntax-symbol&quot;&gt;Show&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;this&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;help&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;message&lt;/span&gt; &lt;span class=&quot;syntax-special&quot;&gt;and&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;exit&lt;/span&gt;
  &lt;span class=&quot;syntax-symbol&quot;&gt;-s,&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;--shout&lt;/span&gt;              &lt;span class=&quot;syntax-symbol&quot;&gt;Shout&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;instead&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;of&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;speaking&lt;/span&gt;
  &lt;span class=&quot;syntax-symbol&quot;&gt;-l,&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;--language&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;LANGUAGE&lt;/span&gt;  &lt;span class=&quot;syntax-symbol&quot;&gt;Language&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;code&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;default:&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;en&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;code&gt;(arguments)&lt;/code&gt; intercepts &lt;code&gt;-h&lt;/code&gt; and &lt;code&gt;--help&lt;/code&gt; and automatically emits help messages and exits by default, but by passing &lt;code&gt;#:auto-help? #f&lt;/code&gt; users can turn off that behavior and handle the help request themselves.&lt;/p&gt;&lt;p&gt;In case you are interested you can have a look at the code of the &lt;code&gt;(arguments)&lt;/code&gt; greeter and test if from the &lt;a href=&quot;https://codeberg.org/fishinthecalculator/arguments/src/branch/main/examples/greet.scm&quot;&gt;Codeberg repository&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;You can get &lt;code&gt;guile-arguments&lt;/code&gt; from Guix or soon from openSUSE Tumbleweed. In case you want to play around with the code, you can find it on &lt;a href=&quot;https://codeberg.org/fishinthecalculator/arguments&quot;&gt;Codeberg&lt;/a&gt;.&lt;/p&gt;&lt;h3 id=&quot;next_steps&quot;&gt;Next steps&lt;/h3&gt;&lt;p&gt;&lt;code&gt;(arguments)&lt;/code&gt; is currently good enough for 80% of my personal use cases. What it currently misses is: first, the ability to structurally declare subcommands and subparsers, probably they can be made to work even with the current API but it'd be hacky, second, internationalization or the ability to handle different output languages such as in auto generated help messages but also in error messages. I really hope it can be of help also to others.&lt;/p&gt;&lt;p&gt;In case you are interested to chat about &lt;code&gt;(arguments)&lt;/code&gt;, or have any kind of feedback, reach out via email or on the Fediverse!&lt;/p&gt;</content></entry><entry><title>Bonfire &amp; Guix, a love story</title><id>https://fishinthecalculator.me/blog/bonfire--guix-a-love-story.html</id><author><name>Giacomo Leidi</name><email>therewasa@fishinthecalculator.me</email></author><updated>2025-06-04T23:23:00Z</updated><link href="https://fishinthecalculator.me/blog/bonfire--guix-a-love-story.html" rel="alternate" /><content type="html">&lt;p&gt;Bonfire is a new framework to build federated applications that just &lt;a href=&quot;https://github.com/bonfire-networks/bonfire-app/releases/tag/v1.0.0-rc.1&quot;&gt;reached RC1&lt;/a&gt;. It is written in Elixir, a nice functional language, and allows communities to create custom flavored Fediverse applications, that can be tailored for their specific needs. I have been &lt;a href=&quot;/projects.html#bonfire&quot;&gt;in touch with the core team&lt;/a&gt; and I'm trying to make the experience of running Bonfire on Guix as smooth as possible.&lt;/p&gt;&lt;p&gt;Guix is a general purpose provisioning tool, it implements trustable, functional and reproducible &lt;a href=&quot;https://codeberg.org/guix/guix/src/branch/master/gnu/packages/base.scm#L99&quot;&gt;package recipes&lt;/a&gt; in the Guile language. It implements also a distro called Guix System, featuring transactional, atomic upgrades and that can be completely be manipulated with Guile. This allows to easily modularize configuration bits and makes it possible to reuse or generate system configurations.&lt;/p&gt;&lt;p&gt;The post is structured in the following way:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;#where_you_start_from&quot;&gt;Where you start from&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;#dns_setup&quot;&gt;DNS Setup&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;#enabling_gocix&quot;&gt;Enabling &lt;code&gt;gocix&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;#ssl_certificates&quot;&gt;Setting up SSL certificates (HTTPS) with Certbot&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;#ssh_assumptions&quot;&gt;SSH assumptions&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;#secrets_setup&quot;&gt;Secrets setup&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;#automatic_database_provisioning&quot;&gt;Automatic database provisioning&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;#firewall_setup&quot;&gt;Firewall setup&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;#enabling_rootless_podman&quot;&gt;Enabling rootless Podman&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;#configuring_oci_provisioning&quot;&gt;Configuring OCI provisioning&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;#starting_bonfire_social&quot;&gt;Starting Bonfire Social&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;#running_a_reverse_proxy&quot;&gt;Running a Reverse proxy&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;#configuring_database_backups&quot;&gt;Configuring database backups&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;#enabling_automatic_upgrades&quot;&gt;Enabling automatic upgrades&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;#enabling_automatic_reboots&quot;&gt;Enabling automatic reboots&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;#summing_up&quot;&gt;Summing up&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;In case you just want to see the final configuration, you can &lt;a href=&quot;#summing_up&quot;&gt;jump from here&lt;/a&gt;.&lt;/p&gt;&lt;h3 id=&quot;where_you_start_from&quot;&gt;Where you start from&lt;/h3&gt;&lt;p&gt;In this post we'll set up a production Bonfire instance with a declarative approach over the Guix System. It will be a secure setup featuring: HTTPS, automatic backups and Guix provisioned secrets. This post also assumes you have a preinstalled Guix machine that you can login into either via console or SSH. If you need help with installing Guix, feel free to reach out, it takes time but I try to help everyone.&lt;/p&gt;&lt;p&gt;If, at any point while following the instructions, you get your system into a broken state you can always go back to the last known system generation with:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;# Supposing the last known good generation ID is 120
sudo guix system switch-generation 120&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Then reboot. You should now be back again in a functional system. I recommend noting the current generation ID you are in before doing anything, with:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;$ guix system list-generations

...

Generation 120  Jun 14 2025 20:57:49    (current)
  file name: /var/guix/profiles/system-120-link
  canonical file name: /gnu/store/lmg382z3zlpi9bcl81srd8dh92nr5aml-system
  label: GNU with Linux-Libre 6.14.11
  bootloader: grub
  root device: UUID: e4a319f6-6552-4d6b-afe8-9988df65173c
  kernel: /gnu/store/awmrxyh7i8phaqniwgmj7v4haxk8g9p2-linux-libre-6.14.11/bzImage
  channels:
    guix:
      repository URL: https://git.guix.gnu.org/guix.git
      branch: master
      commit: c8218094c47482c16f4cdd1e8092c35dab117418&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;In this case the generation ID is &lt;code&gt;120&lt;/code&gt; (note the &lt;code&gt;(current)&lt;/code&gt;).&lt;/p&gt;&lt;h3 id=&quot;dns_setup&quot;&gt;DNS setup&lt;/h3&gt;&lt;p&gt;Everything in this post assumes you have at least an &lt;code&gt;A&lt;/code&gt; DNS record pointing to your machine's public IP address. Even better if you have also an &lt;code&gt;AAAA&lt;/code&gt; record. Supposing your domain name is &lt;code&gt;bonfire.fishinthecalculator.me&lt;/code&gt; you can check if DNS is working fine on the Guix System with:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;$ guix shell bind bind:utils --  dig bonfire.fishinthecalculator.me A&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The same goes for &lt;code&gt;AAAA&lt;/code&gt; records:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;$ guix shell bind bind:utils --  dig bonfire.fishinthecalculator.me AAAA&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&quot;enabling_gocix&quot;&gt;Enabling gocix&lt;/h3&gt;&lt;p&gt;The first piece of configuration you'll need &lt;a href=&quot;https://github.com/fishinthecalculator/gocix?tab=readme-ov-file#configure&quot;&gt;is the &lt;code&gt;gocix&lt;/code&gt; channel&lt;/a&gt; in your user's &lt;code&gt;.config/guix/channels.scm&lt;/code&gt;. &lt;code&gt;gocix&lt;/code&gt; is a &lt;a href=&quot;/projects.html#gocix&quot;&gt;project I made&lt;/a&gt; to &lt;a href=&quot;https://github.com/fishinthecalculator/gocix?tab=readme-ov-file#motivation&quot;&gt;bring to your Guix installation&lt;/a&gt; cloud native applications, backed by OCI images, that can be configured in Guile. They share most of the nice properties Guix native services have: atomic upgrades, transactions and rollbacks.&lt;/p&gt;&lt;p&gt;After &lt;code&gt;guix pull&lt;/code&gt;, in a new shell, your &lt;code&gt;guix describe&lt;/code&gt; should look something (commit hashes will probably differ) like this:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;$ guix describe
Generation 68   Jun 13 2025 19:20:50    (current)
  guix 4c142ad
    repository URL: https://git.guix.gnu.org/guix.git
    branch: master
    commit: 4c142ad34b5ce32ce9004c3efa90d61d197ce436
  sops-guix 89f46bc
    repository URL: https://github.com/fishinthecalculator/sops-guix
    branch: main
    commit: 89f46bc4686504763f49e6b34c596720d347d8da
  gocix fca34c4
    repository URL: https://github.com/fishinthecalculator/gocix
    branch: main
    commit: fca34c4f871501b252d741fad0522a9fc65b65da&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&quot;ssl_certificates&quot;&gt;SSL certificates&lt;/h3&gt;&lt;p&gt;You want to setup SSL certificates provisioning as soon as possible, since everything from now on presupposes HTTPS. To do so on the Guix system, you have to add the &lt;code&gt;certbot-service-type&lt;/code&gt; to your &lt;code&gt;operating-system&lt;/code&gt; record (which after installation is available in &lt;code&gt;/etc/config.scm&lt;/code&gt;):&lt;/p&gt;&lt;pre&gt;&lt;code&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;use-modules&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;gnu&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;services&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;certbot&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;syntax-comment&quot;&gt;;for 'certbot-service-type'
&lt;/span&gt;
&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;operating-system&lt;/span&gt;
  &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;

  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;services&lt;/span&gt;
    &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;list&lt;/span&gt;
      &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;
      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;certbot-service-type&lt;/span&gt;
               &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;certbot-configuration&lt;/span&gt;
                &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;email&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;your@email.org&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;certificates&lt;/span&gt;
                 &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;list&lt;/span&gt;
                  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;certificate-configuration&lt;/span&gt;
                   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;domains&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;list&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;bonfire.fishinthecalculator.me&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Now, after running &lt;code&gt;sudo guix system reconfigure /etc/config.scm&lt;/code&gt;, you should be able to check the status of the &lt;code&gt;renew-certbot-certificates&lt;/code&gt; Shepherd service with:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;$ sudo herd status renew-certbot-certificates
● Status of renew-certbot-certificates:
  It is stopped (one-shot).
  It is enabled.
  Provides: renew-certbot-certificates
  Requires: nginx
  Custom action: configuration
  Will be respawned.

Recent messages (use '-n' to view more or less):
  2025-03-19 22:32:18
  2025-03-19 22:32:18 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  2025-03-19 22:32:18 Certificate not yet due for renewal; no action taken.
  2025-03-19 22:32:18 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  2025-03-19 22:32:18 Certificate successfully acquired: bonfire.fishinthecalculator.me&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The command shows that the service has successfully acquired an SSL certificate for your domain. From now on the Guix System &lt;a href=&quot;https://guix.gnu.org/manual/devel/en/guix.html#Certificate-Services&quot;&gt;will periodically take care of renewing the certificate&lt;/a&gt;. You can check the files are actually there with:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;$ sudo ls -l /etc/letsencrypt/live/bonfire.fishinthecalculator.me/
total 4
lrwxrwxrwx 1 root root  54 Mar  8 02:51 cert.pem -&amp;gt; ../../archive/bonfire.fishinthecalculator.me/cert1.pem
lrwxrwxrwx 1 root root  55 Mar  8 02:51 chain.pem -&amp;gt; ../../archive/bonfire.fishinthecalculator.me/chain1.pem
lrwxrwxrwx 1 root root  59 Mar  8 02:51 fullchain.pem -&amp;gt; ../../archive/bonfire.fishinthecalculator.me/fullchain1.pem
lrwxrwxrwx 1 root root  57 Mar  8 02:51 privkey.pem -&amp;gt; ../../archive/bonfire.fishinthecalculator.me/privkey1.pem
-rw-r--r-- 1 root root 692 Mar  8 02:51 README&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&quot;ssh_assumptions&quot;&gt;SSH assumptions&lt;/h3&gt;&lt;p&gt;If you need SSH access you are encouraged to turn off root login, password authentication and use only SSH keys. You can &lt;a href=&quot;https://guix.gnu.org/manual/devel/en/guix.html#index-openssh_002dconfiguration&quot;&gt;check the Guix manual on how to do that&lt;/a&gt;. Also &lt;code&gt;fail2ban&lt;/code&gt; &lt;a href=&quot;https://guix.gnu.org/manual/devel/en/guix.html#index-Fail2Ban&quot;&gt;is pretty easy to setup&lt;/a&gt; with its default configuration for port &lt;code&gt;22&lt;/code&gt;.&lt;/p&gt;&lt;h3 id=&quot;secrets_setup&quot;&gt;Secrets setup&lt;/h3&gt;&lt;p&gt;Next you are going to need to setup some secrets, both for the PostgreSQL database and the Bonfire instance. One way of doing so is with &lt;a href=&quot;https://getsops.io&quot;&gt;SOPS&lt;/a&gt; and &lt;a href=&quot;https://github.com/fishinthecalculator/sops-guix&quot;&gt;&lt;code&gt;sops-guix&lt;/code&gt;&lt;/a&gt;. You can read a &lt;a href=&quot;https://github.com/fishinthecalculator/sops-guix?tab=readme-ov-file#creating-secrets-with-sops&quot;&gt;more in depth version of this section&lt;/a&gt; at &lt;code&gt;sops-guix&lt;/code&gt;.&lt;/p&gt;&lt;p&gt;SOPS allows for two different encyption tools: &lt;a href=&quot;https://www.gnupg.org&quot;&gt;GnuPG&lt;/a&gt; and &lt;a href=&quot;https://age-encryption.org&quot;&gt;age&lt;/a&gt;. If you don't have any requirement the easiest way is to generate &lt;code&gt;age&lt;/code&gt; keys and encrypt secrets with them.&lt;/p&gt;&lt;pre&gt;&lt;code&gt;~$ sudo -i
Password: 
~# mkdir -p ~/.config/sops/age
~# guix shell age -- age-keygen -o /root/.config/sops/age/keys.txt
...

Public key: age1m3hcq7d9sl3d0uz6ezxvns4f7mjctksmmf5d8tpptmyz30rk9qnscgzfsa&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;You'll need one keypair for each user of the secret so, if you intend to be able to update secrets on a different machine than the one you are installing Bonfire on, make sure to generate a keypair there as well. If you are creating secrets on a PC or a laptop and intend to run Bonfire on a server you SSH into, this is your scenario. Create one keypair for your user on your machine at &lt;code&gt;$HOME.config/sops/age/keys.txt&lt;/code&gt; and the above on the server.&lt;/p&gt;&lt;p&gt;Next you need to create a SOPS configuration file, named &lt;code&gt;.sops.yaml&lt;/code&gt;, in the same directory your configuration file is:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;keys:
    - &amp;amp;user_yourself_age age1peu96695en0xrlshkd3j3zzd04payh3cx27yjw6r40z8ekemnuesmkrupn
    - &amp;amp;host_yoursystem age1m3hcq7d9sl3d0uz6ezxvns4f7mjctksmmf5d8tpptmyz30rk9qnscgzfsa

creation_rules:
    - path_regex: .*yoursystem\.yaml$
      key_groups:
          - age:
                - *user_yourself_age
                - *host_yoursystem&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;You are now ready to create the &lt;a href=&quot;https://docs.bonfirenetworks.org/deploy.html#secret-keys-for-which-you-should-put-random-secrets&quot;&gt;secrets you need&lt;/a&gt;.&lt;/p&gt;&lt;h4 id=&quot;postgresql_secret&quot;&gt;PostgreSQL secret&lt;/h4&gt;&lt;p&gt;You will need a password to protect the PostgreSQL access from unauthorized users. You can generate a random string with:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;$ guix shell openssl -- openssl rand -base64 32
v/hSYQHNCJMYW+U8D3m6ADQ+5382jN9iJ69gfImEISY=&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;From the same directory where the &lt;code&gt;.sops.yaml&lt;/code&gt; and your configuration are stored, run the following command to create a &lt;code&gt;yoursystem.yaml&lt;/code&gt; file that will store your encrypted secrets. Unencrypted secrets are supposed to never hit the disk, check out &lt;code&gt;sops-guix&lt;/code&gt; README for more information.&lt;/p&gt;&lt;pre&gt;&lt;code&gt;$ guix shell sops -- sops yoursystem.yaml&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Your default editor will pop up. Replace the SOPS example secrets and add the following content to the file:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;postgres:
    bonfire: v/hSYQHNCJMYW+U8D3m6ADQ+5382jN9iJ69gfImEISY=&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Save and close the editor. You can now check inside &lt;code&gt;yoursystem.yaml&lt;/code&gt; and see that the secrets is effectively encrypted.&lt;/p&gt;&lt;h4 id=&quot;meilisearch_secret&quot;&gt;meilisearch secret&lt;/h4&gt;&lt;p&gt;Bonfire requires an additional service to run searches, &lt;a href=&quot;https://www.meilisearch.com/&quot;&gt;&lt;code&gt;meilisearch&lt;/code&gt;&lt;/a&gt;. Generate another password and add, the same way as before with &lt;code&gt;sops yoursystem.yaml&lt;/code&gt;, to your secrets file the following:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;meilisearch:
    master: ...&lt;/code&gt;&lt;/pre&gt;&lt;h4 id=&quot;bonfire_secrets&quot;&gt;Bonfire secrets&lt;/h4&gt;&lt;p&gt;The last three secrets are for Bonfire. You can do that with a one-liner with:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;$ sops set yoursystem.yaml '[&amp;quot;bonfire&amp;quot;]' &amp;quot;$(echo '{&amp;quot;secret_key_base&amp;quot;: &amp;quot;&amp;quot;, &amp;quot;signing_salt&amp;quot;: &amp;quot;&amp;quot;, &amp;quot;encryption_salt&amp;quot;: &amp;quot;&amp;quot;}'  | jq  &amp;quot;.secret_key_base = \&amp;quot;$(openssl rand -base64 128)\&amp;quot;&amp;quot; | jq  &amp;quot;.signing_salt = \&amp;quot;$(openssl rand -base64 128)\&amp;quot;&amp;quot;  | jq  &amp;quot;.encryption_salt = \&amp;quot;$(openssl rand -base64 128)\&amp;quot;&amp;quot;)&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This should create correctly sized secrets for Bonfire.&lt;/p&gt;&lt;h4 id=&quot;email_secrets&quot;&gt;Email secrets&lt;/h4&gt;&lt;p&gt;Bonfire needs to be able to send emails to users, both for invites and password change. It &lt;a href=&quot;https://docs.bonfirenetworks.org/Bonfire.Mailer.html&quot;&gt;supports many ways to do so&lt;/a&gt;, I happen to use the free tier of Mailjet but there are many options. Email setup is out of scope for this post, but at the end of the setup process you'll get one or more secret tokens. Add them in &lt;code&gt;yoursystem.yaml&lt;/code&gt; the same way you did for the other secrets and save the file. Make sure to remember the list of keys in the YAML file necessary to access the secrets, in my case they are:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;mail:
    bonfire:
        key: ...
        private_key: ...&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;When all secrets are in your &lt;code&gt;yoursystem.yaml&lt;/code&gt; file your can add the following to your operating system configuration:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;use-modules&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;guix&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;gexp&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;            &lt;span class=&quot;syntax-comment&quot;&gt;;for 'local-file'
&lt;/span&gt;             &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;guix&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;utils&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;           &lt;span class=&quot;syntax-comment&quot;&gt;;for 'current-source-directory'
&lt;/span&gt;             &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;sops&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;services&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;sops&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;   &lt;span class=&quot;syntax-comment&quot;&gt;;for 'sops-secrets-service-type' and 'sops-sops-secret-&amp;gt;secret-file'
&lt;/span&gt;             &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;sops&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;secrets&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;         &lt;span class=&quot;syntax-comment&quot;&gt;;for 'sops-secret'
&lt;/span&gt;             &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;define&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;%project-root&lt;/span&gt;
 &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;current-source-directory&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;define&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;sops.yaml&lt;/span&gt;
  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;local-file&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;string-append&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;%project-root&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;/.sops.yaml&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
              &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;sops.yaml&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;define-public&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;yoursystem.yaml&lt;/span&gt;
  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;local-file&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;string-append&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;%project-root&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;/yoursystem.yaml&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
              &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;yoursystem.yaml&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;syntax-comment&quot;&gt;;; PostgreSQL
&lt;/span&gt;
&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;define-public&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;bonfire-postgres-password-secret&lt;/span&gt;
  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;sops-secret&lt;/span&gt;
   &lt;span class=&quot;syntax-comment&quot;&gt;;; Each element of this list represents
&lt;/span&gt;   &lt;span class=&quot;syntax-comment&quot;&gt;;; one key in yoursystem.yaml.  In this case
&lt;/span&gt;   &lt;span class=&quot;syntax-comment&quot;&gt;;; it represents:
&lt;/span&gt;   &lt;span class=&quot;syntax-comment&quot;&gt;;;
&lt;/span&gt;   &lt;span class=&quot;syntax-comment&quot;&gt;;; postgres:
&lt;/span&gt;   &lt;span class=&quot;syntax-comment&quot;&gt;;;      bonfire:
&lt;/span&gt;   &lt;span class=&quot;syntax-comment&quot;&gt;;;
&lt;/span&gt;   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;key&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;postgres&amp;quot;&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;bonfire&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;user&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;oci-container&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;group&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;postgres&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;file&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;yoursystem.yaml&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;permissions&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;#o440&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;syntax-comment&quot;&gt;;; Meilisearch
&lt;/span&gt;
&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;define-public&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;meilisearch-key-secret&lt;/span&gt;
  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;sops-secret&lt;/span&gt;
   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;key&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;meilisearch&amp;quot;&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;master&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;user&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;oci-container&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;group&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;users&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;file&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;yoursystem.yaml&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;permissions&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;#o400&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;syntax-comment&quot;&gt;;; Bonfire
&lt;/span&gt;
&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;define-public&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;bonfire-mail-key-secret&lt;/span&gt;
  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;sops-secret&lt;/span&gt;
   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;key&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;mail&amp;quot;&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;bonfire&amp;quot;&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;key&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;user&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;oci-container&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;group&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;users&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;file&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;yoursystem.yaml&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;permissions&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;#o400&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
   
&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;define-public&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;bonfire-mail-private-key-secret&lt;/span&gt;
  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;sops-secret&lt;/span&gt;
   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;key&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;mail&amp;quot;&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;bonfire&amp;quot;&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;private_key&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;user&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;oci-container&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;group&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;users&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;file&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;yoursystem.yaml&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;permissions&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;#o400&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;define-public&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;bonfire-secret-key-base-secret&lt;/span&gt;
  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;sops-secret&lt;/span&gt;
   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;key&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;bonfire&amp;quot;&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;secret_key_base&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;user&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;oci-container&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;group&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;users&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;file&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;yoursystem.yaml&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;permissions&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;#o400&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;define-public&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;bonfire-signing-salt-secret&lt;/span&gt;
  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;sops-secret&lt;/span&gt;
   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;key&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;bonfire&amp;quot;&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;signing_salt&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;user&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;oci-container&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;group&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;users&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;file&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;yoursystem.yaml&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;permissions&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;#o400&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;define-public&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;bonfire-encryption-salt-secret&lt;/span&gt;
  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;sops-secret&lt;/span&gt;
   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;key&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;bonfire&amp;quot;&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;encryption_salt&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;user&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;oci-container&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;group&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;users&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;file&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;yoursystem.yaml&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;permissions&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;#o400&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;operating-system&lt;/span&gt;
  &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;

  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;services&lt;/span&gt;
    &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;list&lt;/span&gt;
      &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;
      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;certbot-service-type&lt;/span&gt;
               &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
      
      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;sops-secrets-service-type&lt;/span&gt;
               &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;sops-service-configuration&lt;/span&gt;
                &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;config&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;sops.yaml&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;secrets&lt;/span&gt;
                 &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;list&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;meilisearch-key-secret&lt;/span&gt;
                       &lt;span class=&quot;syntax-symbol&quot;&gt;bonfire-postgres-password-secret&lt;/span&gt;
                       &lt;span class=&quot;syntax-symbol&quot;&gt;bonfire-mail-key-secret&lt;/span&gt;
                       &lt;span class=&quot;syntax-symbol&quot;&gt;bonfire-mail-private-key-secret&lt;/span&gt;
                       &lt;span class=&quot;syntax-symbol&quot;&gt;bonfire-secret-key-base-secret&lt;/span&gt;
                       &lt;span class=&quot;syntax-symbol&quot;&gt;bonfire-signing-salt-secret&lt;/span&gt;
                       &lt;span class=&quot;syntax-symbol&quot;&gt;bonfire-encryption-salt-secret&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&quot;automatic_database_provisioning&quot;&gt;Automatic database provisioning&lt;/h3&gt;&lt;p&gt;Bonfire supports the PostgreSQL database engine and requires the &lt;code&gt;postgis&lt;/code&gt; extension, this is what is is required to set them up:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;use-modules&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;gnu&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;packages&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;geo&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;        &lt;span class=&quot;syntax-comment&quot;&gt;;for postgis
&lt;/span&gt;             &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;gnu&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;packages&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;databases&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;  &lt;span class=&quot;syntax-comment&quot;&gt;;for 'postgresql'
&lt;/span&gt;             &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;gnu&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;services&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;databases&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;  &lt;span class=&quot;syntax-comment&quot;&gt;;for 'postgresql-service-type' and 'postgresql-role-service-type'
&lt;/span&gt;             &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;


&lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;

&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;operating-system&lt;/span&gt;
  &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;

  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;services&lt;/span&gt;
    &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;list&lt;/span&gt;
      &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;
      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;certbot-service-type&lt;/span&gt;
               &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
      
      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;sops-secrets-service-type&lt;/span&gt;
               &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

      &lt;span class=&quot;syntax-comment&quot;&gt;;; Postgres
&lt;/span&gt;      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;postgresql-service-type&lt;/span&gt;
               &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;postgresql-configuration&lt;/span&gt;
               &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;postgresql&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;postgresql&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                &lt;span class=&quot;syntax-comment&quot;&gt;;; Bonfire requires postgis.
&lt;/span&gt;                &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;extension-packages&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;list&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;postgis&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;port&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;5432&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;postgresql-role-service-type&lt;/span&gt;
               &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;postgresql-role-configuration&lt;/span&gt;
                &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;shepherd-requirement&lt;/span&gt;
                 &lt;span class=&quot;syntax-comment&quot;&gt;;; Allow database passwords to be provisioned through SOPS secrets 
&lt;/span&gt;                 &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;append&lt;/span&gt;
                  &lt;span class=&quot;syntax-symbol&quot;&gt;%default-postgresql-role-shepherd-requirement&lt;/span&gt;
                  &lt;span class=&quot;syntax-symbol&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;sops-secrets&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&quot;firewall_setup&quot;&gt;Firewall setup&lt;/h3&gt;&lt;p&gt;The &lt;code&gt;iptables-service-type&lt;/code&gt; is required by the &lt;code&gt;rootless-podman-service-type&lt;/code&gt;, and in general in case the machine is exposed to the Internet having a firewall is a good idea. The following configuration allows only TCP or UDP connections on ports &lt;code&gt;22&lt;/code&gt;, &lt;code&gt;80&lt;/code&gt; and &lt;code&gt;443&lt;/code&gt;. All ICMP traffic is dropped. All of this both for IPv4 and IPv6.&lt;/p&gt;&lt;pre&gt;&lt;code&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;use-modules&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;gnu&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;services&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;networking&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;syntax-comment&quot;&gt;;for 'iptables-service-type'
&lt;/span&gt;             &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;guix&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;gexp&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;               &lt;span class=&quot;syntax-comment&quot;&gt;;for 'plain-file'
&lt;/span&gt;             &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;


&lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;

&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;operating-system&lt;/span&gt;
  &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;

  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;services&lt;/span&gt;
    &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;list&lt;/span&gt;
      &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;
      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;certbot-service-type&lt;/span&gt;
               &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
      
      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;sops-secrets-service-type&lt;/span&gt;
               &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

       &lt;span class=&quot;syntax-comment&quot;&gt;;; Postgres
&lt;/span&gt;      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;postgresql-service-type&lt;/span&gt;
               &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;postgresql-role-service-type&lt;/span&gt;
               &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;iptables-service-type&lt;/span&gt;
               &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;iptables-configuration&lt;/span&gt;
                &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;ipv4-rules&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;plain-file&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;iptables.rules&amp;quot;&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;*filter
:INPUT ACCEPT
:FORWARD ACCEPT
:OUTPUT ACCEPT
-A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p tcp --dport 22 -j ACCEPT
-A INPUT -p tcp --dport 80 -j ACCEPT
-A INPUT -p tcp --dport 443 -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-port-unreachable
COMMIT
&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;ipv6-rules&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;plain-file&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;ip6tables.rules&amp;quot;&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;*filter
:INPUT ACCEPT
:FORWARD ACCEPT
:OUTPUT ACCEPT
-A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p tcp --dport 22 -j ACCEPT
-A INPUT -p tcp --dport 80 -j ACCEPT
-A INPUT -p tcp --dport 443 -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -j REJECT --reject-with icmp6-port-unreachable
COMMIT
&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;If the machine is not exposed to the internet then it is sufficient to add to your services:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;use-modules&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;gnu&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;services&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;networking&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;syntax-comment&quot;&gt;;for 'iptables-service-type'
&lt;/span&gt;             &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;

&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;operating-system&lt;/span&gt;
  &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;

  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;services&lt;/span&gt;
    &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;list&lt;/span&gt;
      &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;
      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;certbot-service-type&lt;/span&gt;
               &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
      
      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;sops-secrets-service-type&lt;/span&gt;
               &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

       &lt;span class=&quot;syntax-comment&quot;&gt;;; Postgres
&lt;/span&gt;      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;postgresql-service-type&lt;/span&gt;
               &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;postgresql-role-service-type&lt;/span&gt;
               &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;iptables-service-type&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&quot;enabling_rootless_podman&quot;&gt;Enabling rootless Podman&lt;/h3&gt;&lt;p&gt;If you want to be able to run rootless containers with your own user &lt;a href=&quot;https://guix.gnu.org/manual/devel/en/guix.html#index-container-management_002c-podman&quot;&gt;follow the Guix manual&lt;/a&gt;, for the Bonfire OCI image to work it is sufficient to add the &lt;code&gt;rootless-podman-service-type&lt;/code&gt; and it DBus dependencies to your configuration:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;use-modules&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;gnu&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;services&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;containers&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;syntax-comment&quot;&gt;;for 'rootless-podman-service-type'
&lt;/span&gt;             &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;gnu&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;services&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;dbus&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;       &lt;span class=&quot;syntax-comment&quot;&gt;;for 'dbus-service-type'
&lt;/span&gt;             &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;gnu&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;services&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;desktop&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;    &lt;span class=&quot;syntax-comment&quot;&gt;;for 'elogind-service-type'
&lt;/span&gt;             &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;

&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;operating-system&lt;/span&gt;
  &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;

  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;services&lt;/span&gt;
    &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;list&lt;/span&gt;
      &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;
      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;certbot-service-type&lt;/span&gt;
               &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
      
      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;sops-secrets-service-type&lt;/span&gt;
               &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

       &lt;span class=&quot;syntax-comment&quot;&gt;;; Postgres
&lt;/span&gt;      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;postgresql-service-type&lt;/span&gt;
               &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;postgresql-role-service-type&lt;/span&gt;
               &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;iptables-service-type&lt;/span&gt;
               &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

      &lt;span class=&quot;syntax-comment&quot;&gt;;; The DBus clique
&lt;/span&gt;      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;elogind-service-type&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;dbus-root-service-type&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;rootless-podman-service-type&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&quot;configuring_oci_provisioning&quot;&gt;Configuring OCI provisioning&lt;/h3&gt;&lt;p&gt;Bonfire currently runs as an OCI image on the Guix System. This is an advantage in that it's not needed to package and maintain Guix native packages for all the Elixir dependencies, and is a disadvantage since binaries in the OCI image &lt;a href=&quot;https://guix.gnu.org/it/blog/2024/identifying-software/&quot;&gt;can't be verifiably connected to the source code&lt;/a&gt; they and their dependencies are built from. In the past I did some &lt;a href=&quot;https://github.com/fishinthecalculator/bonfire-guix&quot;&gt;effort to package Bonfire extensions&lt;/a&gt; but the work to build the Social flavor is still immense.&lt;/p&gt;&lt;p&gt;To run OCI services with the &lt;code&gt;rootless-podman-service-type&lt;/code&gt;, you need to configure the &lt;code&gt;oci-service-type&lt;/code&gt;:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;use-modules&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;gnu&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;services&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;containers&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;syntax-comment&quot;&gt;;for 'rootless-podman-service-type'
&lt;/span&gt;             &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;gnu&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;services&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;dbus&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;       &lt;span class=&quot;syntax-comment&quot;&gt;;for 'dbus-service-type'
&lt;/span&gt;             &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;gnu&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;services&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;desktop&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;    &lt;span class=&quot;syntax-comment&quot;&gt;;for 'elogind-service-type'
&lt;/span&gt;             &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;

&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;operating-system&lt;/span&gt;
  &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;

  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;services&lt;/span&gt;
    &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;list&lt;/span&gt;
      &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;
      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;certbot-service-type&lt;/span&gt;
               &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
      
      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;sops-secrets-service-type&lt;/span&gt;
               &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

       &lt;span class=&quot;syntax-comment&quot;&gt;;; Postgres
&lt;/span&gt;      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;postgresql-service-type&lt;/span&gt;
               &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;postgresql-role-service-type&lt;/span&gt;
               &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;iptables-service-type&lt;/span&gt;
               &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

      &lt;span class=&quot;syntax-comment&quot;&gt;;; The DBus clique
&lt;/span&gt;      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;elogind-service-type&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;dbus-root-service-type&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;rootless-podman-service-type&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
      
      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;oci-service-type&lt;/span&gt;
               &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;oci-configuration&lt;/span&gt;
                &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;runtime&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;'podman&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Now reconfigure your system and reboot it to finalize service upgrades.&lt;/p&gt;&lt;h3 id=&quot;starting_bonfire_social&quot;&gt;Starting Bonfire Social&lt;/h3&gt;&lt;p&gt;To provision a functional Bonfire instance you will need two services, meilisearch and the Bonfire flavour. The &lt;code&gt;(oci services bonfire)&lt;/code&gt; module provides a Guix System service able to provision a database, SOPS secrets and the Bonfire instance. Add the following to your operating system configuration, and make sure to change the values based on your actual setup:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;use-modules&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;oci&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;services&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;bonfire&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;     &lt;span class=&quot;syntax-comment&quot;&gt;;for 'oci-bonfire-service-type'
&lt;/span&gt;             &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;oci&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;services&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;meilisearch&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;syntax-comment&quot;&gt;;for 'oci-meilisearch-service-type'
&lt;/span&gt;             &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;

&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;operating-system&lt;/span&gt;
  &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;

  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;services&lt;/span&gt;
    &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;list&lt;/span&gt;
      &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;
      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;certbot-service-type&lt;/span&gt;
               &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
      
      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;sops-secrets-service-type&lt;/span&gt;
               &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

       &lt;span class=&quot;syntax-comment&quot;&gt;;; Postgres
&lt;/span&gt;      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;postgresql-service-type&lt;/span&gt;
               &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;postgresql-role-service-type&lt;/span&gt;
               &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;iptables-service-type&lt;/span&gt;
               &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

      &lt;span class=&quot;syntax-comment&quot;&gt;;; The DBus clique
&lt;/span&gt;      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;elogind-service-type&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;dbus-root-service-type&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;rootless-podman-service-type&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
      
      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;oci-service-type&lt;/span&gt;
               &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
      
      &lt;span class=&quot;syntax-comment&quot;&gt;;; meilisearch
&lt;/span&gt;      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;oci-meilisearch-service-type&lt;/span&gt;
               &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;oci-meilisearch-configuration&lt;/span&gt;
                &lt;span class=&quot;syntax-comment&quot;&gt;;; We use the host network since we have a firewall.
&lt;/span&gt;                &lt;span class=&quot;syntax-comment&quot;&gt;;; An OCI network could be used between Bonfire and meilisearch.
&lt;/span&gt;                &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;network&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;host&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;port&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;7700&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                &lt;span class=&quot;syntax-comment&quot;&gt;;; Since secrets are provisioned by sops-guix
&lt;/span&gt;                &lt;span class=&quot;syntax-comment&quot;&gt;;; sops-secrets must be added as a Shepherd dependency.
&lt;/span&gt;                &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;shepherd-requirement&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;user-processes&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;sops-secrets&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;master-key&lt;/span&gt;
                 &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;sops-secret-&amp;gt;secret-file&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;meilisearch-key-secret&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

      &lt;span class=&quot;syntax-comment&quot;&gt;;; Bonfire
&lt;/span&gt;      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;oci-bonfire-service-type&lt;/span&gt;
               &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;oci-bonfire-configuration&lt;/span&gt;
                &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;configuration&lt;/span&gt;
                 &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;bonfire-configuration&lt;/span&gt;
                  &lt;span class=&quot;syntax-comment&quot;&gt;;; Networking
&lt;/span&gt;                  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;hostname&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;bonfire.fishinthecalculator.me&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;  &lt;span class=&quot;syntax-comment&quot;&gt;;replace with your domain
&lt;/span&gt;                  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;port&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;4000&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;public-port&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;443&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;network&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;host&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                  &lt;span class=&quot;syntax-comment&quot;&gt;;; Postgres
&lt;/span&gt;                  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;postgres-user&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;bonfire&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;postgres-db&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;bonfire&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                  &lt;span class=&quot;syntax-comment&quot;&gt;;; Mail
&lt;/span&gt;                  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;mail-domain&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;bonfire.fishinthecalculator.me&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;                &lt;span class=&quot;syntax-comment&quot;&gt;;replace with your domain
&lt;/span&gt;                  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;mail-from&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;friendlyadmin@bonfire.fishinthecalculator.me&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;  &lt;span class=&quot;syntax-comment&quot;&gt;;replace with your domain
&lt;/span&gt;                  &lt;span class=&quot;syntax-comment&quot;&gt;;; Shepherd
&lt;/span&gt;                  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;upload-data-directory&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;/var/lib/bonfire/uploads&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;requirement&lt;/span&gt;
                   &lt;span class=&quot;syntax-symbol&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;user-processes&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;postgresql&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;postgres-roles&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;sops-secrets&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;podman-meilisearch&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;extra-variables&lt;/span&gt;
                   &lt;span class=&quot;syntax-symbol&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;MAIL_BACKEND&amp;quot;&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;mailjet&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                     &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;SERVER_PORT&amp;quot;&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;4000&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                     &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;SEARCH_MEILI_INSTANCE&amp;quot;&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;http://localhost:7700&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                  &lt;span class=&quot;syntax-comment&quot;&gt;;; Secrets
&lt;/span&gt;                  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;meili-master-key&lt;/span&gt;
                   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;sops-secret-&amp;gt;secret-file&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;meilisearch-key-secret&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;postgres-password&lt;/span&gt;
                   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;sops-secret-&amp;gt;secret-file&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;bonfire-postgres-password-secret&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;mail-key&lt;/span&gt;
                   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;sops-secret-&amp;gt;secret-file&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;bonfire-mail-key-secret&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;mail-private-key&lt;/span&gt;
                   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;sops-secret-&amp;gt;secret-file&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;bonfire-mail-private-key-secret&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;secret-key-base&lt;/span&gt;
                   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;sops-secret-&amp;gt;secret-file&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;bonfire-secret-key-base-secret&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;signing-salt&lt;/span&gt;
                   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;sops-secret-&amp;gt;secret-file&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;bonfire-signing-salt-secret&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;encryption-salt&lt;/span&gt;
                   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;sops-secret-&amp;gt;secret-file&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;bonfire-encryption-salt-secret&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Now after reconfiguring your system, which might take a while, you should have a &lt;code&gt;podman-bonfire&lt;/code&gt; service among your root's &lt;code&gt;herd status&lt;/code&gt;:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;$ sudo herd status podman-bonfire
Password: 
● Status of podman-bonfire:
  It is running since 11:48:45 AM (12 hours ago).
  Main PID: 26476
  Command: /run/current-system/profile/bin/podman run --rm --replace --name podman-bonfire --entrypoint /bin/sh --env POSTGRES_USER=bonfire --env FLAVOUR=social --env HOSTNAME=bonfire.fishinthecalculator.me --env POSTGRES_HOST=localhost --env POSTGRES_DB=bonfire --env MAIL_DOMAIN=bonfire.fishinthecalculator.me --env MAIL_FROM=friendlyadmin@bonfire.fishinthecalculator.me --env MAIL_PORT=465 --env MAIL_SSL=true --env PORT=4000 --env PUBLIC_PORT=443 --env LANG --env SEEDS_USER=root --env ERLANG_COOKIE=bonfire_cookie --env MIX_ENV=prod --env PLUG_BACKEND=bandit --env APP_NAME=Bonfire --env MAIL_BACKEND=mailjet --env SERVER_PORT=4000 --env SEARCH_MEILI_INSTANCE=http://localhost:7700 --network host -v /var/lib/bonfire/uploads:/opt/app/data/uploads -v /run/secrets/meilisearch:/run/secrets/meilisearch:ro -v /run/secrets/postgres:/run/secrets/postgres:ro -v /run/secrets/bonfire/mail:/run/secrets/bonfire/mail:ro -v /run/secrets/bonfire:/run/secrets/bonfire:ro docker.io/bonfirenetworks/bonfire:1.0.0-rc.1.10-social-amd64 -c &amp;quot;set -e; export MEILI_MASTER_KEY=\&amp;quot;$(cat /run/secrets/meilisearch/master)\&amp;quot;; export POSTGRES_PASSWORD=\&amp;quot;$(cat /run/secrets/postgres/bonfire)\&amp;quot;; export MAIL_KEY=\&amp;quot;$(cat /run/secrets/mail/bonfire/key)\&amp;quot;; export MAIL_PRIVATE_KEY=\&amp;quot;$(cat /run/secrets/mail/bonfire/private_key)\&amp;quot;; export SECRET_KEY_BASE=\&amp;quot;$(cat /run/secrets/bonfire/secret_key_base)\&amp;quot;; export SIGNING_SALT=\&amp;quot;$(cat /run/secrets/bonfire/signing_salt)\&amp;quot;; export ENCRYPTION_SALT=\&amp;quot;$(cat /run/secrets/bonfire/encryption_salt)\&amp;quot;; exec -a ./bin/bonfire ./bin/bonfire start&amp;quot;
  It is enabled.
  Provides: podman-bonfire
  Requires: postgresql postgres-roles sops-secrets podman-meilisearch cgroups2-fs-owner cgroups2-limits rootless-podman-shared-root-fs user-processes podman-volumes
  Custom actions: command-line entrypoint pull
  Will not be respawned.
  Log file: /var/log/bonfire.log

Recent messages (use '-n' to view more or less):
  2025-06-13 23:45:44     Phoenix.Router.__call__/5 @ deps/phoenix/lib/phoenix/router.ex:475
  2025-06-13 23:45:44     Bonfire.Web.Endpoint.plug_builder_call/2 @ lib/bonfire/web/endpoint.ex:1
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;On the first run it will take some time as it will need to perform database migrations, in general you can check its output by reading &lt;code&gt;/var/log/bonfire.log&lt;/code&gt;.&lt;/p&gt;&lt;h3 id=&quot;running_a_reverse_proxy&quot;&gt;Running a reverse proxy&lt;/h3&gt;&lt;p&gt;The last piece to be able to access your instance from the Internet is a reverse proxy. We'll use NGINX but any one should work. To configure NGINX to forward traffic to Bonfire the following must be added to your configuration:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;use-modules&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;gnu&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;services&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;web&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;         &lt;span class=&quot;syntax-comment&quot;&gt;;for 'nginx-service-type'
&lt;/span&gt;             &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;

&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;operating-system&lt;/span&gt;
  &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;

  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;services&lt;/span&gt;
    &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;list&lt;/span&gt;
      &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;
      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;certbot-service-type&lt;/span&gt;
               &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
      
      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;sops-secrets-service-type&lt;/span&gt;
               &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

       &lt;span class=&quot;syntax-comment&quot;&gt;;; Postgres
&lt;/span&gt;      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;postgresql-service-type&lt;/span&gt;
               &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;postgresql-role-service-type&lt;/span&gt;
               &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;iptables-service-type&lt;/span&gt;
               &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

      &lt;span class=&quot;syntax-comment&quot;&gt;;; The DBus clique
&lt;/span&gt;      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;elogind-service-type&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;dbus-root-service-type&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;rootless-podman-service-type&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
      
      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;oci-service-type&lt;/span&gt;
               &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
      
      &lt;span class=&quot;syntax-comment&quot;&gt;;; meilisearch
&lt;/span&gt;      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;oci-meilisearch-service-type&lt;/span&gt;
               &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

      &lt;span class=&quot;syntax-comment&quot;&gt;;; Bonfire
&lt;/span&gt;      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;oci-bonfire-service-type&lt;/span&gt;
               &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;nginx-service-type&lt;/span&gt;
               &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;nginx-configuration&lt;/span&gt;
                &lt;span class=&quot;syntax-comment&quot;&gt;;; Wait for bonfire to start
&lt;/span&gt;                &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;shepherd-requirement&lt;/span&gt;
                 &lt;span class=&quot;syntax-symbol&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;podman-bonfire&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;server-blocks&lt;/span&gt;
                 &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;list&lt;/span&gt;
                   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;nginx-server-configuration&lt;/span&gt;
                    &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;server-name&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;list&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;bonfire.fishinthecalculator.me&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                    &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;listen&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;443 ssl&amp;quot;&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;[::]:443 ssl&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                    &lt;span class=&quot;syntax-comment&quot;&gt;;; Replace with your domain
&lt;/span&gt;                    &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;ssl-certificate&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;/etc/certs/bonfire.fishinthecalculator.me/fullchain.pem&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                    &lt;span class=&quot;syntax-comment&quot;&gt;;; Replace with your domain
&lt;/span&gt;                    &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;ssl-certificate-key&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;/etc/certs/bonfire.fishinthecalculator.me/privkey.pem&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                    &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;locations&lt;/span&gt;
                     &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;list&lt;/span&gt;
                      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;nginx-location-configuration&lt;/span&gt;
                       &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;uri&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;/&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                       &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;body&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;list&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;string-append&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;proxy_pass http://localhost:4000;&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                       &lt;span class=&quot;syntax-comment&quot;&gt;;; Taken from https://www.nginx.com/resources/wiki/start/topics/examples/full/
&lt;/span&gt;                       &lt;span class=&quot;syntax-comment&quot;&gt;;; Those settings are used when proxies are involved
&lt;/span&gt;                       &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;proxy_redirect          off;&amp;quot;&lt;/span&gt;
                       &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;proxy_set_header        Host $host;&amp;quot;&lt;/span&gt;
                       &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;proxy_set_header        X-Real-IP $remote_addr;&amp;quot;&lt;/span&gt;
                       &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;&amp;quot;&lt;/span&gt;
                       &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;proxy_http_version      1.1;&amp;quot;&lt;/span&gt;
                       &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;proxy_cache_bypass      $http_upgrade;&amp;quot;&lt;/span&gt;
                       &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;proxy_set_header        Upgrade $http_upgrade;&amp;quot;&lt;/span&gt;
                       &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;proxy_set_header        Connection \&amp;quot;upgrade\&amp;quot;;&amp;quot;&lt;/span&gt;
                       &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;proxy_set_header        X-Forwarded-Proto $scheme;&amp;quot;&lt;/span&gt;
                       &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;proxy_set_header        X-Forwarded-Host  $host;&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                      &lt;span class=&quot;syntax-comment&quot;&gt;;; Statically serve uploads media.
&lt;/span&gt;                      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;nginx-location-configuration&lt;/span&gt;
                       &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;uri&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;/data/uploads/&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                       &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;body&lt;/span&gt;
                        &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;list&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;alias /var/lib/bonfire/uploads/;&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                              &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;index  index.html index.htm;&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Now after reconfiguring you should be able to access your instance and set it up. The first user to register is the admin, they can decide how further user can be added to the instance.&lt;/p&gt;&lt;p&gt;&lt;img src=&quot;/static/images/bonfire.fishinthecalculator.me.png&quot; alt=&quot;bonfire.fishinthecalculator.me's home page&quot; /&gt;&lt;/p&gt;&lt;h3 id=&quot;configuring_database_backups&quot;&gt;Configuring database backups&lt;/h3&gt;&lt;p&gt;If you'd like to have nightly jobs dumping Bonfire's database to disk, to be able to recover from data corruption for example, you can use the &lt;code&gt;postgresql-backup-service-type&lt;/code&gt;. There is &lt;a href=&quot;https://codeberg.org/guix/guix/pulls/500&quot;&gt;a PR&lt;/a&gt; for sending it upstream, but to use it now you'll have to add the &lt;a href=&quot;https://codeberg.org/fishinthecalculator/small-guix#configure&quot;&gt;&lt;code&gt;small-guix&lt;/code&gt; channel&lt;/a&gt; to your &lt;code&gt;.config/guix/channels.scm&lt;/code&gt;. After running &lt;code&gt;guix pull&lt;/code&gt;, in a new shell, &lt;code&gt;guix describe&lt;/code&gt; should mention &lt;code&gt;small-guix&lt;/code&gt;.&lt;/p&gt;&lt;p&gt;Now you can add the following to your operating system configuration:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;use-modules&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;small-guix&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;services&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;databases&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;   &lt;span class=&quot;syntax-comment&quot;&gt;;for 'postgresql-backup-service-type'
&lt;/span&gt;             &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;

&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;operating-system&lt;/span&gt;
  &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;

  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;services&lt;/span&gt;
    &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;list&lt;/span&gt;
      &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;
      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;certbot-service-type&lt;/span&gt;
               &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
      
      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;sops-secrets-service-type&lt;/span&gt;
               &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

       &lt;span class=&quot;syntax-comment&quot;&gt;;; Postgres
&lt;/span&gt;      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;postgresql-service-type&lt;/span&gt;
               &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;postgresql-role-service-type&lt;/span&gt;
               &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
               
      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;postgresql-backup-service-type&lt;/span&gt;
               &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;postgresql-backup-configuration&lt;/span&gt;
                &lt;span class=&quot;syntax-comment&quot;&gt;;; Every day at 5 AM.
&lt;/span&gt;                &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;schedule&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;0 5 * * *&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                &lt;span class=&quot;syntax-comment&quot;&gt;;; Databases to backup.
&lt;/span&gt;                &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;databases&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;bonfire&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                &lt;span class=&quot;syntax-comment&quot;&gt;;; Which day to take the weekly backup from (1-7 = Monday-Sunday).
&lt;/span&gt;                &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;day-of-week-to-keep&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;6&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                &lt;span class=&quot;syntax-comment&quot;&gt;;; Number of days to keep daily backups.
&lt;/span&gt;                &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;days-to-keep&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                &lt;span class=&quot;syntax-comment&quot;&gt;;; How many weeks to keep weekly backups.
&lt;/span&gt;                &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;weeks-to-keep&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;iptables-service-type&lt;/span&gt;
               &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

      &lt;span class=&quot;syntax-comment&quot;&gt;;; The DBus clique
&lt;/span&gt;      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;elogind-service-type&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;dbus-root-service-type&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;rootless-podman-service-type&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
      
      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;oci-service-type&lt;/span&gt;
               &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
      
      &lt;span class=&quot;syntax-comment&quot;&gt;;; meilisearch
&lt;/span&gt;      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;oci-meilisearch-service-type&lt;/span&gt;
               &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

      &lt;span class=&quot;syntax-comment&quot;&gt;;; Bonfire
&lt;/span&gt;      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;oci-bonfire-service-type&lt;/span&gt;
               &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;nginx-service-type&lt;/span&gt;
               &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;After some time, you'll get something like this at &lt;code&gt;/var/lib/postgresql-backups&lt;/code&gt;:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;$ sudo  tree -a /var/lib/postgresql-backups/
/var/lib/postgresql-backups/
├── 2025-06-05-daily
│   └── bonfire.custom
├── 2025-06-06-daily
│   └── bonfire.custom
├── 2025-06-07-weekly
│   └── bonfire.custom
├── 2025-06-08-daily
│   └── bonfire.custom
├── 2025-06-09-daily
│   └── bonfire.custom
├── 2025-06-10-daily
│   └── bonfire.custom
├── 2025-06-11-daily
│   └── bonfire.custom
└── 2025-06-12-daily
    └── bonfire.custom&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;You can then long term encrypt and backup these on S3, OneDrive, Google Drive with &lt;code&gt;rclone&lt;/code&gt; and the &lt;code&gt;restic-backup-service-type&lt;/code&gt;, check it out &lt;a href=&quot;https://guix.gnu.org/manual/devel/en/guix.html#Miscellaneous-Services&quot;&gt;on the Guix Manual&lt;/a&gt;, search for &lt;code&gt;restic-backup-service-type&lt;/code&gt;.&lt;/p&gt;&lt;h3 id=&quot;enabling_automatic_upgrades&quot;&gt;Enabling automatic upgrades&lt;/h3&gt;&lt;p&gt;A good practice for a server exposed to the Internet is to continually apply security fixes. On Guix, &lt;a href=&quot;https://issues.guix.gnu.org/issue/78332&quot;&gt;for now&lt;/a&gt;, this means following the default branch. To automatically upgrade your system overnight, &lt;a href=&quot;https://guix.gnu.org/manual/devel/en/guix.html#Unattended-Upgrades&quot;&gt;you can use the &lt;code&gt;unattended-upgrade-service-type&lt;/code&gt;&lt;/a&gt;, configuring it to use &lt;code&gt;gocix&lt;/code&gt; (and &lt;code&gt;small-guix&lt;/code&gt; in case you use PostgreSQL backups) and to run at any given time. I run it once every night at 2AM:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;use-modules&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;gnu&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;services&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;admin&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;              &lt;span class=&quot;syntax-comment&quot;&gt;;for 'unattended-upgrade-service-type'
&lt;/span&gt;             &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;guix&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;channels&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;                   &lt;span class=&quot;syntax-comment&quot;&gt;;for 'channel-&amp;gt;code'
&lt;/span&gt;             &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;

&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;define&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;%channels&lt;/span&gt;
  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;cons*&lt;/span&gt;
   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;channel&lt;/span&gt;
    &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;'small-guix&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;url&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;https://codeberg.org/fishinthecalculator/small-guix.git&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;branch&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;main&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;syntax-comment&quot;&gt;;; Enable signature verification:
&lt;/span&gt;    &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;introduction&lt;/span&gt;
     &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;make-channel-introduction&lt;/span&gt;
      &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;f260da13666cd41ae3202270784e61e062a3999c&amp;quot;&lt;/span&gt;
      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;openpgp-fingerprint&lt;/span&gt;
       &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;8D10 60B9 6BB8 292E 829B  7249 AED4 1CC1 93B7 01E2&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;channel&lt;/span&gt;
    &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;'gocix&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;url&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;https://github.com/fishinthecalculator/gocix&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;branch&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;main&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;syntax-comment&quot;&gt;;; Enable signature verification:
&lt;/span&gt;    &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;introduction&lt;/span&gt;
    &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;make-channel-introduction&lt;/span&gt;
     &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;cdb78996334c4f63304ecce224e95bb96bfd4c7d&amp;quot;&lt;/span&gt;
     &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;openpgp-fingerprint&lt;/span&gt;
      &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;8D10 60B9 6BB8 292E 829B  7249 AED4 1CC1 93B7 01E2&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;syntax-symbol&quot;&gt;%default-channels&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;operating-system&lt;/span&gt;
  &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;

  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;services&lt;/span&gt;
    &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;list&lt;/span&gt;
      &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;
      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;certbot-service-type&lt;/span&gt;
               &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
      
      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;sops-secrets-service-type&lt;/span&gt;
               &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

       &lt;span class=&quot;syntax-comment&quot;&gt;;; Postgres
&lt;/span&gt;      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;postgresql-service-type&lt;/span&gt;
               &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;postgresql-role-service-type&lt;/span&gt;
               &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
               
      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;postgresql-backup-service-type&lt;/span&gt;
               &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;iptables-service-type&lt;/span&gt;
               &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

      &lt;span class=&quot;syntax-comment&quot;&gt;;; The DBus clique
&lt;/span&gt;      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;elogind-service-type&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;dbus-root-service-type&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;rootless-podman-service-type&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
      
      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;oci-service-type&lt;/span&gt;
               &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
      
      &lt;span class=&quot;syntax-comment&quot;&gt;;; meilisearch
&lt;/span&gt;      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;oci-meilisearch-service-type&lt;/span&gt;
               &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

      &lt;span class=&quot;syntax-comment&quot;&gt;;; Bonfire
&lt;/span&gt;      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;oci-bonfire-service-type&lt;/span&gt;
               &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;nginx-service-type&lt;/span&gt;
               &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;unattended-upgrade-service-type&lt;/span&gt;
               &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;unattended-upgrade-configuration&lt;/span&gt;
                &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;schedule&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;0 2 * * *&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                 &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;system-expiration&lt;/span&gt;
                  &lt;span class=&quot;syntax-comment&quot;&gt;;; 30 days
&lt;/span&gt;                  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;30&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;24&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;3600&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                 &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;channels&lt;/span&gt;
                  &lt;span class=&quot;syntax-symbol&quot;&gt;#~&lt;/span&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;list&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;#$@&lt;/span&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;map&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;channel-&amp;gt;code&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;%channels&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                 &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;operating-system-file&lt;/span&gt;
                  &lt;span class=&quot;syntax-comment&quot;&gt;;; The path to your configuration file.
&lt;/span&gt;                  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;file-append&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;%project-root&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;/config.scm&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;After reconfiguring, you should have a new Shepherd timer:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;
$ sudo herd status unattended-upgrade 
● Status of unattended-upgrade:
  It is running since Fri 13 Jun 2025 11:21:31 PM CEST (87 minutes ago).
  Timed service.
  Periodically running: /gnu/store/67mzs4f35yrbj224y2ygr73vy1s1iqis-unattended-upgrade
  It is enabled.
  Provides: unattended-upgrade
  Requires: user-processes networking
  Custom action: trigger
  Will be respawned.

Upcoming timer alarms:
  11:10:00 PM (in 22 hours)
  Sun 15 Jun 2025 11:10:00 PM CEST (in 46 hours)
  Mon 16 Jun 2025 11:10:00 PM CEST (in 3 days)
  Tue 17 Jun 2025 11:10:00 PM CEST (in 4 days)
  Wed 18 Jun 2025 11:10:00 PM CEST (in 5 days)&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Note, this does not mean you should run major upgrades overnight: you should be able to pin every package version either referencing a package variable that has the version in its symbol, or with one of the many Guix package &lt;a href=&quot;https://guix.gnu.org/manual/devel/en/guix.html#Defining-Package-Variants&quot;&gt;extension&lt;/a&gt; and &lt;a href=&quot;https://guix.gnu.org/manual/devel/en/guix.html#Inferiors&quot;&gt;transformation mechanisms&lt;/a&gt;. You can pin OCI services by specifying an explicit image, like so:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;operating-system&lt;/span&gt;
  &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;

  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;services&lt;/span&gt;
    &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;list&lt;/span&gt;
      &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;

      &lt;span class=&quot;syntax-comment&quot;&gt;;; Bonfire
&lt;/span&gt;      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;oci-bonfire-service-type&lt;/span&gt;
               &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;oci-bonfire-configuration&lt;/span&gt;
                &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;image&lt;/span&gt;
                 &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;docker.io/bonfirenetworks/bonfire:1.0.0-rc.1.11-social-amd64&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&quot;enabling_automatic_reboots&quot;&gt;Enabling automatic reboots&lt;/h3&gt;&lt;p&gt;Not all upgrades can be performed online and restarting sevices regularly sometimes helps (it's the classic magic happening inside computers, if you know, you know). In case you want to regularly reboot your system you can use the &lt;code&gt;unattended-reboot-service-type&lt;/code&gt;: it will provision a Shepherd timer which will reboot the system once triggered. This allows updates, for example for the Shepherd, the kernel or core packages, to be automatically finalized. In the future this should probably add an health check to see whether the system is functional and roll back otherwise.&lt;/p&gt;&lt;p&gt;To enable regular reboots add the following to your configuration:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;use-modules&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;small-guix&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;services&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;unattended-reboot&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;   &lt;span class=&quot;syntax-comment&quot;&gt;;for 'unattended-reboot-service-type'
&lt;/span&gt;             &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;

&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;operating-system&lt;/span&gt;
  &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;

  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;services&lt;/span&gt;
    &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;list&lt;/span&gt;
      &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;
      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;certbot-service-type&lt;/span&gt;
               &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
      
      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;sops-secrets-service-type&lt;/span&gt;
               &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

       &lt;span class=&quot;syntax-comment&quot;&gt;;; Postgres
&lt;/span&gt;      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;postgresql-service-type&lt;/span&gt;
               &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;postgresql-role-service-type&lt;/span&gt;
               &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
               
      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;postgresql-backup-service-type&lt;/span&gt;
               &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;iptables-service-type&lt;/span&gt;
               &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

      &lt;span class=&quot;syntax-comment&quot;&gt;;; The DBus clique
&lt;/span&gt;      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;elogind-service-type&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;dbus-root-service-type&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;rootless-podman-service-type&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
      
      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;oci-service-type&lt;/span&gt;
               &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
      
      &lt;span class=&quot;syntax-comment&quot;&gt;;; meilisearch
&lt;/span&gt;      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;oci-meilisearch-service-type&lt;/span&gt;
               &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

      &lt;span class=&quot;syntax-comment&quot;&gt;;; Bonfire
&lt;/span&gt;      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;oci-bonfire-service-type&lt;/span&gt;
               &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;nginx-service-type&lt;/span&gt;
               &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;unattended-upgrade-service-type&lt;/span&gt;
               &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;unattended-reboot-service-type&lt;/span&gt;
               &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;unattended-reboot-configuration&lt;/span&gt;
                &lt;span class=&quot;syntax-comment&quot;&gt;;; Every day at 6AM.
&lt;/span&gt;                &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;schedule&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;0 6 * * *&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&quot;summing_up&quot;&gt;Summing up&lt;/h3&gt;&lt;p&gt;Let's try to see it all together:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;use-modules&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;gnu&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;packages&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;geo&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;                        &lt;span class=&quot;syntax-comment&quot;&gt;;for 'postgis'
&lt;/span&gt;             &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;gnu&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;packages&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;databases&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;                  &lt;span class=&quot;syntax-comment&quot;&gt;;for 'postgresql'
&lt;/span&gt;             &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;gnu&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;services&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;admin&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;                      &lt;span class=&quot;syntax-comment&quot;&gt;;for 'unattended-upgrade-service-type'
&lt;/span&gt;             &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;gnu&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;services&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;certbot&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;                    &lt;span class=&quot;syntax-comment&quot;&gt;;for 'certbot-service-type'
&lt;/span&gt;             &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;gnu&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;services&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;databases&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;                  &lt;span class=&quot;syntax-comment&quot;&gt;;for 'postgresql-service-type' and 'postgresql-role-service-type'
&lt;/span&gt;             &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;gnu&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;services&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;containers&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;                 &lt;span class=&quot;syntax-comment&quot;&gt;;for 'rootless-podman-service-type'
&lt;/span&gt;             &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;gnu&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;services&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;dbus&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;                       &lt;span class=&quot;syntax-comment&quot;&gt;;for 'dbus-service-type'
&lt;/span&gt;             &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;gnu&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;services&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;desktop&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;                    &lt;span class=&quot;syntax-comment&quot;&gt;;for 'elogind-service-type'
&lt;/span&gt;             &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;gnu&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;services&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;networking&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;                 &lt;span class=&quot;syntax-comment&quot;&gt;;for 'iptables-service-type'
&lt;/span&gt;             &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;gnu&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;services&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;web&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;                        &lt;span class=&quot;syntax-comment&quot;&gt;;for 'nginx-service-type'
&lt;/span&gt;             &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;guix&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;channels&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;                           &lt;span class=&quot;syntax-comment&quot;&gt;;for 'channel-&amp;gt;code'
&lt;/span&gt;             &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;guix&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;gexp&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;                               &lt;span class=&quot;syntax-comment&quot;&gt;;for 'local-file' and 'plain-file'
&lt;/span&gt;             &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;guix&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;utils&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;                              &lt;span class=&quot;syntax-comment&quot;&gt;;for 'current-source-directory'
&lt;/span&gt;             &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;oci&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;services&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;containers&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;                 &lt;span class=&quot;syntax-comment&quot;&gt;;for 'oci-service-type'
&lt;/span&gt;             &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;oci&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;services&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;bonfire&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;                    &lt;span class=&quot;syntax-comment&quot;&gt;;for 'oci-bonfire-service-type'
&lt;/span&gt;             &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;oci&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;services&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;meilisearch&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;                &lt;span class=&quot;syntax-comment&quot;&gt;;for 'oci-meilisearch-service-type'
&lt;/span&gt;             &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;small-guix&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;services&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;databases&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;           &lt;span class=&quot;syntax-comment&quot;&gt;;for 'postgresql-backup-service-type'
&lt;/span&gt;             &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;small-guix&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;services&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;unattended-reboot&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;   &lt;span class=&quot;syntax-comment&quot;&gt;;for 'unattended-reboot-service-type'
&lt;/span&gt;             &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;sops&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;services&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;sops&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;                      &lt;span class=&quot;syntax-comment&quot;&gt;;for 'sops-secrets-service-type' and 'sops-sops-secret-&amp;gt;secret-file'
&lt;/span&gt;             &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;sops&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;secrets&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;                            &lt;span class=&quot;syntax-comment&quot;&gt;;for 'sops-secret'
&lt;/span&gt;             &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;define&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;%project-root&lt;/span&gt;
 &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;current-source-directory&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;define&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;sops.yaml&lt;/span&gt;
  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;local-file&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;string-append&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;%project-root&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;/.sops.yaml&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
              &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;sops.yaml&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;define-public&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;yoursystem.yaml&lt;/span&gt;
  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;local-file&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;string-append&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;%project-root&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;/yoursystem.yaml&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
              &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;yoursystem.yaml&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;syntax-comment&quot;&gt;;; PostgreSQL
&lt;/span&gt;
&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;define-public&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;bonfire-postgres-password-secret&lt;/span&gt;
  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;sops-secret&lt;/span&gt;
   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;key&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;postgres&amp;quot;&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;bonfire&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;user&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;oci-container&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;group&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;postgres&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;file&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;yoursystem.yaml&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;permissions&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;#o440&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;syntax-comment&quot;&gt;;; Meilisearch
&lt;/span&gt;
&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;define-public&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;meilisearch-key-secret&lt;/span&gt;
  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;sops-secret&lt;/span&gt;
   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;key&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;meilisearch&amp;quot;&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;master&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;user&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;oci-container&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;group&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;users&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;file&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;yoursystem.yaml&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;permissions&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;#o400&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;syntax-comment&quot;&gt;;; Bonfire
&lt;/span&gt;
&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;define-public&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;bonfire-mail-key-secret&lt;/span&gt;
  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;sops-secret&lt;/span&gt;
   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;key&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;mail&amp;quot;&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;bonfire&amp;quot;&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;key&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;user&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;oci-container&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;group&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;users&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;file&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;yoursystem.yaml&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;permissions&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;#o400&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
   
&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;define-public&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;bonfire-mail-private-key-secret&lt;/span&gt;
  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;sops-secret&lt;/span&gt;
   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;key&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;mail&amp;quot;&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;bonfire&amp;quot;&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;private_key&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;user&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;oci-container&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;group&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;users&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;file&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;yoursystem.yaml&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;permissions&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;#o400&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;define-public&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;bonfire-secret-key-base-secret&lt;/span&gt;
  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;sops-secret&lt;/span&gt;
   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;key&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;bonfire&amp;quot;&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;secret_key_base&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;user&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;oci-container&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;group&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;users&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;file&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;yoursystem.yaml&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;permissions&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;#o400&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;define-public&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;bonfire-signing-salt-secret&lt;/span&gt;
  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;sops-secret&lt;/span&gt;
   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;key&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;bonfire&amp;quot;&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;signing_salt&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;user&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;oci-container&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;group&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;users&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;file&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;yoursystem.yaml&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;permissions&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;#o400&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;define-public&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;bonfire-encryption-salt-secret&lt;/span&gt;
  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;sops-secret&lt;/span&gt;
   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;key&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;bonfire&amp;quot;&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;encryption_salt&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;user&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;oci-container&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;group&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;users&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;file&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;yoursystem.yaml&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;permissions&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;#o400&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;syntax-comment&quot;&gt;;; Channels
&lt;/span&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;define&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;%channels&lt;/span&gt;
  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;cons*&lt;/span&gt;
   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;channel&lt;/span&gt;
    &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;'small-guix&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;url&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;https://codeberg.org/fishinthecalculator/small-guix.git&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;branch&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;main&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;syntax-comment&quot;&gt;;; Enable signature verification:
&lt;/span&gt;    &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;introduction&lt;/span&gt;
     &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;make-channel-introduction&lt;/span&gt;
      &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;f260da13666cd41ae3202270784e61e062a3999c&amp;quot;&lt;/span&gt;
      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;openpgp-fingerprint&lt;/span&gt;
       &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;8D10 60B9 6BB8 292E 829B  7249 AED4 1CC1 93B7 01E2&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;channel&lt;/span&gt;
    &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;'gocix&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;url&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;https://github.com/fishinthecalculator/gocix&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;branch&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;main&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;syntax-comment&quot;&gt;;; Enable signature verification:
&lt;/span&gt;    &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;introduction&lt;/span&gt;
    &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;make-channel-introduction&lt;/span&gt;
     &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;cdb78996334c4f63304ecce224e95bb96bfd4c7d&amp;quot;&lt;/span&gt;
     &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;openpgp-fingerprint&lt;/span&gt;
      &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;8D10 60B9 6BB8 292E 829B  7249 AED4 1CC1 93B7 01E2&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;syntax-symbol&quot;&gt;%default-channels&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;operating-system&lt;/span&gt;
  &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt; &lt;span class=&quot;syntax-comment&quot;&gt;;; Bootloader, filesystems, users, packages, sudoers and so on...
&lt;/span&gt;
  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;services&lt;/span&gt;
    &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;list&lt;/span&gt;
      &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt; &lt;span class=&quot;syntax-comment&quot;&gt;;; Here you will most probably have to append to %base-sytem if this
&lt;/span&gt;          &lt;span class=&quot;syntax-comment&quot;&gt;;; is a headless machine
&lt;/span&gt;      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;certbot-service-type&lt;/span&gt;
               &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;certbot-configuration&lt;/span&gt;
                &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;email&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;your@email.org&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;  &lt;span class=&quot;syntax-comment&quot;&gt;;replace with your email
&lt;/span&gt;                &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;certificates&lt;/span&gt;
                 &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;list&lt;/span&gt;
                  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;certificate-configuration&lt;/span&gt;
                   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;domains&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;list&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;bonfire.fishinthecalculator.me&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;syntax-comment&quot;&gt;;replace with your domain
&lt;/span&gt;      
      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;sops-secrets-service-type&lt;/span&gt;
               &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;sops-service-configuration&lt;/span&gt;
                &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;config&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;sops.yaml&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

      &lt;span class=&quot;syntax-comment&quot;&gt;;; Postgres
&lt;/span&gt;      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;postgresql-service-type&lt;/span&gt;
               &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;postgresql-configuration&lt;/span&gt;
                &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;postgresql&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;postgresql&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                &lt;span class=&quot;syntax-comment&quot;&gt;;; Bonfire requires postgis.
&lt;/span&gt;                &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;extension-packages&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;list&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;postgis&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;port&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;5432&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;postgresql-role-service-type&lt;/span&gt;
               &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;postgresql-role-configuration&lt;/span&gt;
                &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;shepherd-requirement&lt;/span&gt;
                 &lt;span class=&quot;syntax-comment&quot;&gt;;; Allow database passwords to be provisioned through SOPS secrets 
&lt;/span&gt;                 &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;append&lt;/span&gt;
                  &lt;span class=&quot;syntax-symbol&quot;&gt;%default-postgresql-role-shepherd-requirement&lt;/span&gt;
                  &lt;span class=&quot;syntax-symbol&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;sops-secrets&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
               
      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;postgresql-backup-service-type&lt;/span&gt;
               &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;postgresql-backup-configuration&lt;/span&gt;
                &lt;span class=&quot;syntax-comment&quot;&gt;;; Every day at 5 AM.
&lt;/span&gt;                &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;schedule&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;0 5 * * *&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                &lt;span class=&quot;syntax-comment&quot;&gt;;; Databases to backup.
&lt;/span&gt;                &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;databases&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;bonfire&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                &lt;span class=&quot;syntax-comment&quot;&gt;;; Which day to take the weekly backup from (1-7 = Monday-Sunday).
&lt;/span&gt;                &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;day-of-week-to-keep&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;6&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                &lt;span class=&quot;syntax-comment&quot;&gt;;; Number of days to keep daily backups.
&lt;/span&gt;                &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;days-to-keep&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                &lt;span class=&quot;syntax-comment&quot;&gt;;; How many weeks to keep weekly backups.
&lt;/span&gt;                &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;weeks-to-keep&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;iptables-service-type&lt;/span&gt;
               &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;iptables-configuration&lt;/span&gt;
                &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;ipv4-rules&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;plain-file&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;iptables.rules&amp;quot;&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;*filter
:INPUT ACCEPT
:FORWARD ACCEPT
:OUTPUT ACCEPT
-A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p tcp --dport 22 -j ACCEPT
-A INPUT -p tcp --dport 80 -j ACCEPT
-A INPUT -p tcp --dport 443 -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-port-unreachable
COMMIT
&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;ipv6-rules&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;plain-file&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;ip6tables.rules&amp;quot;&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;*filter
:INPUT ACCEPT
:FORWARD ACCEPT
:OUTPUT ACCEPT
-A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p tcp --dport 22 -j ACCEPT
-A INPUT -p tcp --dport 80 -j ACCEPT
-A INPUT -p tcp --dport 443 -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -j REJECT --reject-with icmp6-port-unreachable
COMMIT
&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

      &lt;span class=&quot;syntax-comment&quot;&gt;;; The DBus clique
&lt;/span&gt;      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;elogind-service-type&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;dbus-root-service-type&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;rootless-podman-service-type&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
      
      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;oci-service-type&lt;/span&gt;
               &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;oci-configuration&lt;/span&gt;
                &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;runtime&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;'podman&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
      
      &lt;span class=&quot;syntax-comment&quot;&gt;;; meilisearch
&lt;/span&gt;      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;oci-meilisearch-service-type&lt;/span&gt;
               &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;oci-meilisearch-configuration&lt;/span&gt;
                &lt;span class=&quot;syntax-comment&quot;&gt;;; We use the host network since we have a firewall.
&lt;/span&gt;                &lt;span class=&quot;syntax-comment&quot;&gt;;; An OCI network could be used between Bonfire and meilisearch.
&lt;/span&gt;                &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;network&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;host&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;port&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;7700&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                &lt;span class=&quot;syntax-comment&quot;&gt;;; Since secrets are provisioned by sops-guix
&lt;/span&gt;                &lt;span class=&quot;syntax-comment&quot;&gt;;; sops-secrets must be added as a Shepherd dependency.
&lt;/span&gt;                &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;shepherd-requirement&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;user-processes&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;sops-secrets&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;master-key&lt;/span&gt;
                 &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;sops-secret-&amp;gt;secret-file&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;meilisearch-key-secret&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

      &lt;span class=&quot;syntax-comment&quot;&gt;;; Bonfire
&lt;/span&gt;      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;oci-bonfire-service-type&lt;/span&gt;
               &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;oci-bonfire-configuration&lt;/span&gt;
                &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;configuration&lt;/span&gt;
                 &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;bonfire-configuration&lt;/span&gt;
                  &lt;span class=&quot;syntax-comment&quot;&gt;;; Networking
&lt;/span&gt;                  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;hostname&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;bonfire.fishinthecalculator.me&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;  &lt;span class=&quot;syntax-comment&quot;&gt;;replace with your domain
&lt;/span&gt;                  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;port&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;4000&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;public-port&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;443&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;network&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;host&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                  &lt;span class=&quot;syntax-comment&quot;&gt;;; Postgres
&lt;/span&gt;                  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;postgres-user&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;bonfire&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;postgres-db&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;bonfire&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                  &lt;span class=&quot;syntax-comment&quot;&gt;;; Mail
&lt;/span&gt;                  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;mail-domain&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;bonfire.fishinthecalculator.me&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;                &lt;span class=&quot;syntax-comment&quot;&gt;;replace with your domain
&lt;/span&gt;                  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;mail-from&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;friendlyadmin@bonfire.fishinthecalculator.me&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;  &lt;span class=&quot;syntax-comment&quot;&gt;;replace with your domain
&lt;/span&gt;                  &lt;span class=&quot;syntax-comment&quot;&gt;;; Shepherd
&lt;/span&gt;                  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;upload-data-directory&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;/var/lib/bonfire/uploads&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;requirement&lt;/span&gt;
                   &lt;span class=&quot;syntax-symbol&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;user-processes&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;postgresql&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;postgres-roles&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;sops-secrets&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;podman-meilisearch&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;extra-variables&lt;/span&gt;
                   &lt;span class=&quot;syntax-symbol&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;MAIL_BACKEND&amp;quot;&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;mailjet&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                     &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;SERVER_PORT&amp;quot;&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;4000&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                     &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;SEARCH_MEILI_INSTANCE&amp;quot;&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;http://localhost:7700&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                  &lt;span class=&quot;syntax-comment&quot;&gt;;; Secrets
&lt;/span&gt;                  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;meili-master-key&lt;/span&gt;
                   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;sops-secret-&amp;gt;secret-file&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;meilisearch-key-secret&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;postgres-password&lt;/span&gt;
                   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;sops-secret-&amp;gt;secret-file&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;bonfire-postgres-password-secret&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;mail-key&lt;/span&gt;
                   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;sops-secret-&amp;gt;secret-file&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;bonfire-mail-key-secret&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;mail-private-key&lt;/span&gt;
                   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;sops-secret-&amp;gt;secret-file&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;bonfire-mail-private-key-secret&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;secret-key-base&lt;/span&gt;
                   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;sops-secret-&amp;gt;secret-file&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;bonfire-secret-key-base-secret&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;signing-salt&lt;/span&gt;
                   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;sops-secret-&amp;gt;secret-file&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;bonfire-signing-salt-secret&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;encryption-salt&lt;/span&gt;
                   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;sops-secret-&amp;gt;secret-file&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;bonfire-encryption-salt-secret&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

      &lt;span class=&quot;syntax-comment&quot;&gt;;; Reverse proxy
&lt;/span&gt;      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;nginx-service-type&lt;/span&gt;
               &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;nginx-configuration&lt;/span&gt;
                &lt;span class=&quot;syntax-comment&quot;&gt;;; Wait for bonfire to start
&lt;/span&gt;                &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;shepherd-requirement&lt;/span&gt;
                 &lt;span class=&quot;syntax-symbol&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;podman-bonfire&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;server-blocks&lt;/span&gt;
                 &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;list&lt;/span&gt;
                   &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;nginx-server-configuration&lt;/span&gt;
                    &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;server-name&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;list&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;bonfire.fishinthecalculator.me&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                    &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;listen&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;443 ssl&amp;quot;&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;[::]:443 ssl&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                    &lt;span class=&quot;syntax-comment&quot;&gt;;; Replace with your domain
&lt;/span&gt;                    &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;ssl-certificate&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;/etc/certs/bonfire.fishinthecalculator.me/fullchain.pem&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                    &lt;span class=&quot;syntax-comment&quot;&gt;;; Replace with your domain
&lt;/span&gt;                    &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;ssl-certificate-key&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;/etc/certs/bonfire.fishinthecalculator.me/privkey.pem&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                    &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;locations&lt;/span&gt;
                     &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;list&lt;/span&gt;
                      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;nginx-location-configuration&lt;/span&gt;
                       &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;uri&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;/&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                       &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;body&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;list&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;string-append&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;proxy_pass http://localhost:4000;&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                       &lt;span class=&quot;syntax-comment&quot;&gt;;; Taken from https://www.nginx.com/resources/wiki/start/topics/examples/full/
&lt;/span&gt;                       &lt;span class=&quot;syntax-comment&quot;&gt;;; Those settings are used when proxies are involved
&lt;/span&gt;                       &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;proxy_redirect          off;&amp;quot;&lt;/span&gt;
                       &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;proxy_set_header        Host $host;&amp;quot;&lt;/span&gt;
                       &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;proxy_set_header        X-Real-IP $remote_addr;&amp;quot;&lt;/span&gt;
                       &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;&amp;quot;&lt;/span&gt;
                       &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;proxy_http_version      1.1;&amp;quot;&lt;/span&gt;
                       &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;proxy_cache_bypass      $http_upgrade;&amp;quot;&lt;/span&gt;
                       &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;proxy_set_header        Upgrade $http_upgrade;&amp;quot;&lt;/span&gt;
                       &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;proxy_set_header        Connection \&amp;quot;upgrade\&amp;quot;;&amp;quot;&lt;/span&gt;
                       &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;proxy_set_header        X-Forwarded-Proto $scheme;&amp;quot;&lt;/span&gt;
                       &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;proxy_set_header        X-Forwarded-Host  $host;&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                      &lt;span class=&quot;syntax-comment&quot;&gt;;; Statically serve uploads media.
&lt;/span&gt;                      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;nginx-location-configuration&lt;/span&gt;
                       &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;uri&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;/data/uploads/&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                       &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;body&lt;/span&gt;
                        &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;list&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;alias /var/lib/bonfire/uploads/;&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                              &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;index  index.html index.htm;&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

      &lt;span class=&quot;syntax-comment&quot;&gt;;; Automatic upgrades.
&lt;/span&gt;      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;unattended-upgrade-service-type&lt;/span&gt;
               &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;unattended-upgrade-configuration&lt;/span&gt;
                &lt;span class=&quot;syntax-comment&quot;&gt;;; Every night at 2AM.
&lt;/span&gt;                &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;schedule&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;0 2 * * *&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                 &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;system-expiration&lt;/span&gt;
                  &lt;span class=&quot;syntax-comment&quot;&gt;;; 30 days
&lt;/span&gt;                  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;30&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;24&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;3600&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                 &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;channels&lt;/span&gt;
                  &lt;span class=&quot;syntax-symbol&quot;&gt;#~&lt;/span&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;list&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;#$@&lt;/span&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;map&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;channel-&amp;gt;code&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;%channels&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                 &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;operating-system-file&lt;/span&gt;
                  &lt;span class=&quot;syntax-comment&quot;&gt;;; The path to your configuration file.
&lt;/span&gt;                  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;file-append&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;%project-root&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;/config.scm&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

      &lt;span class=&quot;syntax-comment&quot;&gt;;; Automatic reboots.
&lt;/span&gt;      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;unattended-reboot-service-type&lt;/span&gt;
               &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;unattended-reboot-configuration&lt;/span&gt;
                &lt;span class=&quot;syntax-comment&quot;&gt;;; Every day at 6AM.
&lt;/span&gt;                &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;schedule&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;0 6 * * *&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This post has still many assumptions baked in which will require some experimentation on your side, if you have questions let me know. You can also look at &lt;a href=&quot;https://codeberg.org/fishinthecalculator/guix-deployments/src/branch/main/modules/fishinthecalculator/virtual-nellone/system/config.scm&quot;&gt;the configuration&lt;/a&gt; for the machine running &lt;code&gt;bonfire.fishinthecalculator.me&lt;/code&gt;.&lt;/p&gt;&lt;h2 id=&quot;future_work&quot;&gt;Future work&lt;/h2&gt;&lt;p&gt;Currently &lt;code&gt;bonfire.fishinthecalculator.me&lt;/code&gt; runs pretty smoothly but the users are very few and the machine hosts other services. Next steps would probably be setup monitoring with Prometheus and Grafana for the VM and the Bonfire instance.&lt;/p&gt;</content></entry><entry><title>Declarative, transactional, cloud native OCI provisioning with Guix</title><id>https://fishinthecalculator.me/blog/declarative-transactional-cloud-native-oci-provisioning-with-guix.html</id><author><name>Giacomo Leidi</name><email>therewasa@fishinthecalculator.me</email></author><updated>2025-05-06T23:33:00Z</updated><link href="https://fishinthecalculator.me/blog/declarative-transactional-cloud-native-oci-provisioning-with-guix.html" rel="alternate" /><content type="html">&lt;p&gt;Many applications are packaged in OCI images but not in Guix. A good subset of them is written either in NodeJS, Go, Rust or languages that, as a general approach, encourage applications to have huge dependency graphs.&lt;/p&gt;&lt;p&gt;The Guix project accepts package contributions that comply to very strict standards in terms of whether the package and its dependencies can be completely built from source. It's the reason why practically no Javascript application (or even web applications with complex frontends) are in Guix mainline. It is not clear whether they will ever be.&lt;/p&gt;&lt;h2 id=&quot;oci_backed_services&quot;&gt;OCI backed services&lt;/h2&gt;&lt;p&gt;Yet the Guix System is completely usable for self hosting purposes. If you use &lt;code&gt;docker compose&lt;/code&gt; on the Guix System, you end up having two different interfaces to manage your system services: Shepherd and Docker/Podman. The &lt;code&gt;oci-service-type&lt;/code&gt; aims at implementing Shepherd Services that look and feel native (so you can configure and manage them with the usual consistent interface that Guix exposes) but under the hood are implemented as &lt;code&gt;docker run&lt;/code&gt; or &lt;code&gt;podman run&lt;/code&gt; invocations.&lt;/p&gt;&lt;pre&gt;&lt;code&gt;    &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;simple-service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;'oci-provisioning&lt;/span&gt;
                    &lt;span class=&quot;syntax-symbol&quot;&gt;oci-service-type&lt;/span&gt;
                    &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;oci-extension&lt;/span&gt;
                      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;networks&lt;/span&gt;
                        &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;list&lt;/span&gt;
                          &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;oci-network-configuration&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;monitoring&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;containers&lt;/span&gt;
                       &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;list&lt;/span&gt;
                        &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;oci-container-configuration&lt;/span&gt;
                          &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;image&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;prom/prometheus&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                          &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;network&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;monitoring&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                          &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;ports&lt;/span&gt;
                           &lt;span class=&quot;syntax-symbol&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;9000&amp;quot;&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;9000&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                             &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;9090&amp;quot;&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;9090&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                        &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;oci-container-configuration&lt;/span&gt;
                          &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;image&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;docker.io/grafana/grafana:latest&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                          &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;network&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;monitoring&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                          &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;ports&lt;/span&gt;
                           &lt;span class=&quot;syntax-symbol&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;3000:3000&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                          &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;volumes&lt;/span&gt;
                           &lt;span class=&quot;syntax-symbol&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;/var/lib/grafana&amp;quot;&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;/var/lib/grafana&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;In this example two different Shepherd services are going to be added
to the system. Each &lt;code&gt;oci-container-configuration&lt;/code&gt; record translates to
a &lt;code&gt;docker run&lt;/code&gt; or &lt;code&gt;podman run&lt;/code&gt; invocation and its fields directly
map to options. You can refer to the &lt;a href=&quot;https://docs.docker.com/engine/reference/commandline/run&quot;&gt;Docker&lt;/a&gt; or &lt;a href=&quot;https://docs.podman.io/en/stable/markdown/podman-run.1.html&quot;&gt;Podman&lt;/a&gt; upstream documentation
for semantics of each value. If the images are not found, they will be pulled.
You can refer to the &lt;a href=&quot;https://docs.docker.com/engine/reference/commandline/pull/&quot;&gt;Docker&lt;/a&gt; or &lt;a href=&quot;https://docs.podman.io/en/stable/markdown/podman-pull.1.html&quot;&gt;Podman&lt;/a&gt; upstream documentation for semantics.&lt;/p&gt;&lt;h3 id=&quot;a_backend_example&quot;&gt;A backend example&lt;/h3&gt;&lt;p&gt;Let's start with a simple example, you can imagine this being the equivalent of your backend service or SQL process. Its behavior is quite simple: when someone sends an HTTP GET request for the &lt;code&gt;/whosin&lt;/code&gt; path at the port &lt;code&gt;7777&lt;/code&gt;, the script returns &lt;code&gt;out of office&lt;/code&gt; and writes &lt;code&gt;empty&lt;/code&gt; into &lt;code&gt;/tmp/office&lt;/code&gt;:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;    $ curl localhost:7777/whosin
    out of office
    
    $ cat /tmp/office
    empty&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;In case any other path is queried, it returns &lt;code&gt;unknown path&lt;/code&gt; and the requested path over HTTP and writes &lt;code&gt;on fire&lt;/code&gt; into &lt;code&gt;/tmp/office&lt;/code&gt;.  This is what happens when the &lt;code&gt;/lallo&lt;/code&gt; path is requested:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;    $ curl localhost:7777/lallo &amp;amp;&amp;amp; cat /tmp/office
    unknown path /lallo
    on fire
    empty&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;We can now run the server in background with Shepherd, to check its behavior as a native process inside a Shepherd service:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;    $ herd spawn transient -- `pwd`/backend.scm /tmp
    $ herd status | grep transient-
     + transient-198
    $ herd status transient-198
    ● Status of transient-198:
      It is transient, running since 07:24:53 PM (4 minutes ago).
      Main PID: 17653
      Command: backend.scm /tmp
      It is enabled.
      Provides: transient-198
      Requires: transient
      Will not be respawned.&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;As you can see the behavior is the same as the one the script manifests when run from shell as a regular command:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;    $ curl localhost:7777/whosin &amp;amp;&amp;amp; cat /tmp/office
    out of office
    empty&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&quot;the_frontend_script&quot;&gt;The frontend script&lt;/h3&gt;&lt;p&gt;You can imagine this being the equivalent of your frontend or some kind of middlweare service. Its behavior is: when someone sends an HTTP GET request for the &lt;code&gt;/doorbell&lt;/code&gt; path at the port &lt;code&gt;7778&lt;/code&gt;, the frontend calls the backend at &lt;code&gt;http://localhost:7777/whosin&lt;/code&gt;, then reads the &lt;code&gt;/tmp/office&lt;/code&gt; file contents and returns everything via HTTP to the client. Let's try:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;    $ herd spawn transient -- `pwd`/frontend.scm /tmp http://localhost:7777/whosin
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;If we check now, we should have two different transient services, one for the backend and one for the frontend:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;    $ herd status | grep transient-
     + transient-198
     + transient-199&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;We can now test whether the code is sound:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;    $ curl localhost:7777/lallo &amp;amp;&amp;amp; cat /tmp/office
    unknown path /lallo
    on fire
    
    $ curl localhost:7778/doorbell
    backend state: out of office
    office state: empty
    
    $ cat /tmp/office
    empty
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Now let's try running these scripts inside containers and see what changes from the native Shepherd services and the containerized ones.&lt;/p&gt;&lt;h3 id=&quot;an_home_service_example&quot;&gt;An Home service example&lt;/h3&gt;&lt;p&gt;Let's start by defining a Guile OCI image in our Guix Home configuration and gexps for the scripts:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;    &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;define&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;guile-oci-image&lt;/span&gt;
      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;oci-image&lt;/span&gt;
       &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;repository&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;guile&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
       &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;value&lt;/span&gt;
        &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;specifications-&amp;gt;manifest&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;guile&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
       &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;pack-options&lt;/span&gt;
        &lt;span class=&quot;syntax-symbol&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-keyword&quot;&gt;#:symlinks&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;/bin&amp;quot;&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;bin&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
    
    &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;define&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;script-file&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;script-name&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;local-file&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;string-append&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;getenv&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;HOME&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                                 &lt;span class=&quot;syntax-comment&quot;&gt;;; I happen to store these scripts in my HOME directory,
&lt;/span&gt;                                 &lt;span class=&quot;syntax-comment&quot;&gt;;; you should replace this with the directory where you
&lt;/span&gt;                                 &lt;span class=&quot;syntax-comment&quot;&gt;;; store your scripts.
&lt;/span&gt;                                 &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;/&amp;quot;&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;script-name&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;.scm&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;string-append&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;script-name&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;.scm&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

    &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;define&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;backend-script&lt;/span&gt;
     &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;script-file&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;backend&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
    
    &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;define&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;frontend-script&lt;/span&gt;
     &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;script-file&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;frontend&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;And add the following to your Home services:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;    &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;home-oci-service-type&lt;/span&gt;
             &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;for-home&lt;/span&gt;
              &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;oci-configuration&lt;/span&gt;
               &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;runtime&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;'podman&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
    
    &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;simple-service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;'home-oci-provisioning&lt;/span&gt;
          &lt;span class=&quot;syntax-symbol&quot;&gt;home-oci-service-type&lt;/span&gt;
          &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;oci-extension&lt;/span&gt;
           &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;networks&lt;/span&gt;
            &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;list&lt;/span&gt;
             &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;oci-network-configuration&lt;/span&gt;
              &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;my-network&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
           &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;volumes&lt;/span&gt;
            &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;list&lt;/span&gt;
             &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;oci-volume-configuration&lt;/span&gt;
              &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;my-volume&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
           &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;containers&lt;/span&gt;
            &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;list&lt;/span&gt;
             &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;oci-container-configuration&lt;/span&gt;
              &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;provision&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;backend&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
              &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;image&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;guile-oci-image&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
              &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;entrypoint&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;/bin/guile&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
              &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;network&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;my-network&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
              &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;command&lt;/span&gt;
               &lt;span class=&quot;syntax-symbol&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;-s&amp;quot;&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;/backend.scm&amp;quot;&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;/my-volume&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
              &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;volumes&lt;/span&gt;
               &lt;span class=&quot;syntax-symbol&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;my-volume&amp;quot;&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;/my-volume&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                 &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;,backend-script&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;/backend.scm&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
             &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;oci-container-configuration&lt;/span&gt;
              &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;provision&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;frontend&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
              &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;image&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;guile-oci-image&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
              &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;requirement&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;backend&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
              &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;entrypoint&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;/bin/guile&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
              &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;network&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;my-network&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
              &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;command&lt;/span&gt;
               &lt;span class=&quot;syntax-symbol&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;-s&amp;quot;&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;/frontend.scm&amp;quot;&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;/my-volume&amp;quot;&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;http://backend:7777/whosin&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
              &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;volumes&lt;/span&gt;
               &lt;span class=&quot;syntax-symbol&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;my-volume&amp;quot;&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;/my-volume&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                 &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;,frontend-script&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;/frontend.scm&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;You can now run &lt;code&gt;guix home reconfigure ...&lt;/code&gt;. After Guix Home is done, check the services' status:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;    $ herd status backend
    ● Status of backend:
      It is running since 11:21:38 PM (9 seconds ago).
      Main PID: 1756
      Command: /home/paul/.guix-home/profile/bin/podman run --rm --replace --name backend --entrypoint /bin/guile --network my-network -v my-volume:/my-volume -v /gnu/store/qiqwy2j7a598wp8v68294fpbjmmahrqc-backend.scm:/backend.scm localhost/guile:latest -s /backend.scm /my-volume
      It is enabled.
      Provides: backend
      Requires: home-podman-networks home-podman-volumes
      Custom action: command-line
      Will not be respawned.
    
    Recent messages (use '-n' to view more or less):
      2025-03-09 23:21:40 Copying config sha256:d111b778901b847eca5043a590e41c432a0471b3d8c3b75fe00fb2ad15088d59
      2025-03-09 23:21:40 Writing manifest to image destination
      2025-03-09 23:21:40 Loading image for backend from /gnu/store/2ndlvrpblk171qixkspywrrm4z5fah5n-backend.tar.gz...
      2025-03-09 23:21:40 Loaded image: localhost/guile.latest:latest
      2025-03-09 23:21:40 Tagged /gnu/store/2ndlvrpblk171qixkspywrrm4z5fah5n-backend.tar.gz with localhost/guile:latest...&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;and the same for the frontend:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;    $ herd status frontend
    ● Status of frontend:
      It is running since 11:21:38 PM (36 seconds ago).
      Main PID: 1757
      Command: /home/paul/.guix-home/profile/bin/podman run --rm --replace --name frontend --entrypoint /bin/guile --network my-network -p 7778:7778 -v my-volume:/my-volume -v /gnu/store/m1avaw2681bbljxcidy7vb4x0i3898db-frontend.scm:/frontend.scm localhost/guile:latest -s /frontend.scm /my-volume http://backend:7777/whosin
      It is enabled.
      Provides: frontend
      Requires: home-podman-networks home-podman-volumes backend
      Custom action: command-line
      Will not be respawned.
    
    Recent messages (use '-n' to view more or less):
      2025-03-09 23:21:40 Writing manifest to image destination
      2025-03-09 23:21:40 Untagged: localhost/guile.latest:latest
      2025-03-09 23:21:40 Loading image for frontend from /gnu/store/ak3pzlin4ay98p14blxaj7zgrv8fh632-frontend.tar.gz...
      2025-03-09 23:21:40 Loaded image: localhost/guile.latest:latest
      2025-03-09 23:21:40 Tagged /gnu/store/ak3pzlin4ay98p14blxaj7zgrv8fh632-frontend.tar.gz with localhost/guile:latest...&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Now let's test the functionality. We only exposed the frontend port, so we expect not to be able to connect to &lt;code&gt;7777&lt;/code&gt;:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;    $ curl localhost:7777/whosin
    curl: (7) Failed to connect to localhost port 7777 after 0 ms: Couldn't connect to server&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;only to the frontend port (which is the &lt;code&gt;7778&lt;/code&gt;):&lt;/p&gt;&lt;pre&gt;&lt;code&gt;    $ curl localhost:7778/doorbell
    backend state: out of office
    office state: empty&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;We can check the &lt;code&gt;office&lt;/code&gt; file contents with:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;    $ podman volume export my-volume | tar xv
    office
    $ cat office
    empty&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Now, let's have a closer look at the Shepherd services. Shepherd services
provisioned by the &lt;code&gt;oci-service-type&lt;/code&gt; support different set of actions.&lt;/p&gt;&lt;p&gt;The network provisioning service provides the following action:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;    $ herd doc home-podman-networks list-actions
    command-line:
      Prints home-podman-networks OCI runtime command line invocation.
    
    $ herd command-line home-podman-networks
    /home/paul/.guix-home/profile/bin/podman network create my-network&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;the same goes for the volumes provisioning service:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;    $ herd doc home-podman-networks list-actions
    command-line:
      Prints home-podman-volumes OCI runtime command line invocation.
    
    $ herd command-line home-podman-volumes
    /home/paul/.guix-home/profile/bin/podman volume create my-volume&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;and for containers which reference a cached image, like in our case:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;    $ herd doc backend list-actions
    command-line:
      Prints backend OCI runtime command line invocation.
    
    $ herd command-line backend
    /home/paul/.guix-home/profile/bin/podman run --rm --replace --name backend --entrypoint /bin/guile --network my-network -v my-volume:/my-volume -v /gnu/store/qiqwy2j7a598wp8v68294fpbjmmahrqc-backend.scm:/backend.scm localhost/guile:latest -s /backend.scm /my-volume&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;OCI containers that have a remote image reference in their &lt;code&gt;image&lt;/code&gt; field,
additionally support a &lt;code&gt;pull&lt;/code&gt; action:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;    $ sudo herd doc podman-forgejo list-actions
    command-line:
      Prints podman-forgejo OCI runtime command line invocation.
    
    pull:
      Pull podman-forgejo image (codeberg.org/forgejo/forgejo:10.0.1-rootless).
    
    $ sudo herd command-line podman-forgejo
    /run/current-system/profile/bin/podman run --rm --replace --name podman-forgejo --env USER_UID=34595 --env USER_GID=98715 -p 3000:3000 -p 2202:22 -v forgejo:/var/lib/gitea -v /etc/timezone:/etc/timezone:ro -v /etc/localtime:/etc/localtime:ro codeberg.org/forgejo/forgejo:10.0.1-rootless
    
    $ sudo tail -n 17 /var/log/forgejo.log
    2025-03-09 23:50:11 Trying to pull codeberg.org/forgejo/forgejo:10.0.1-rootless...
    2025-03-09 23:50:14 Getting image source signatures
    2025-03-09 23:50:14 Copying blob sha256:15ab256cd4da0c6bf93a7cfa7e85e16dc9da5020c3415b630e59b09df76d27db
    2025-03-09 23:50:14 Copying blob sha256:71d5a7a4eeb57275b451cfab8e904d9fa727a37f88fa3bc75942e1b4460acd44
    2025-03-09 23:50:14 Copying blob sha256:66a3d608f3fa52124f8463e9467f170c784abd549e8216aa45c6960b00b4b79b
    2025-03-09 23:50:14 Copying blob sha256:662951a9d959644cb6d446eed38ee5a42b231df7100397a93a5c2f22bf68712b
    2025-03-09 23:50:14 Copying blob sha256:9cace756fe1f230966ec1022c17c33168f14c9e067e559c97950fdbfa2bba40b
    2025-03-09 23:50:14 Copying blob sha256:d962a541e1a1144a3c08f44260b04c7e37cdd99db572c8ae6a8f54cd8f9eafbe
    2025-03-09 23:50:14 Copying blob sha256:7dc8ff21196384b18f484da3eb1bde3064c7b506de71fdf45c6a12e7425d3bb9
    2025-03-09 23:50:14 Copying blob sha256:82cdec355329fbe7dbbfeee91deca478d805ea4a20a07bf4f486beeb6ec9c342
    2025-03-09 23:50:14 Copying blob sha256:c768a4796c3cea8130cd679fcdebbe3ec0c2d7399bc5e85758e20efb4eb834b6
    2025-03-09 23:50:14 Copying blob sha256:43402951a99e9088f7eb19a737a806b81906305e15cd5bb0ecf1a1fa816da5f9
    2025-03-09 23:50:14 Copying blob sha256:003e5af9ef5613ad37b723e8bf9fdbf80c2a656c9a61741941797ebcc1891cc3
    2025-03-09 23:50:14 Copying blob sha256:4f4fb700ef54461cfa02571ae0db9a0dc1e0cdb5577484a6d75e68dc38e8acc1
    2025-03-09 23:50:14 Copying config sha256:55f1bcd32c34de7e1544e5dfac45208cce1a8bb298858ff61978ff858c7c5f6b
    2025-03-09 23:50:14 Writing manifest to image destination
    2025-03-09 23:50:14 55f1bcd32c34de7e1544e5dfac45208cce1a8bb298858ff61978ff858c7c5f6b&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&quot;oci-container-service-type_vs_oci-service-type&quot;&gt;oci-container-service-type vs oci-service-type&lt;/h2&gt;&lt;p&gt;The new &lt;code&gt;oci-service-type&lt;/code&gt; deprecates the &lt;code&gt;oci-container-service-type&lt;/code&gt;: it is
completely backward compatible and now, while deprecated, the
&lt;code&gt;oci-container-service-type&lt;/code&gt; is actually implemented extending the
&lt;code&gt;oci-service-type&lt;/code&gt;.&lt;/p&gt;&lt;p&gt;It brings additional features, such as: rootless podman support, the ability
to provision networks and volumes, and better image caching.&lt;/p&gt;&lt;p&gt;To make the switch in service code you need to change your extension from&lt;/p&gt;&lt;pre&gt;&lt;code&gt;    &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service-extension&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;oci-container-service-type&lt;/span&gt;
                       &lt;span class=&quot;syntax-symbol&quot;&gt;oci-bonfire-configuration-&amp;gt;oci-container-configuration&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;to&lt;/p&gt;&lt;pre&gt;&lt;code&gt;    &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service-extension&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;oci-service-type&lt;/span&gt;
                       &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;lambda&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;config&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                         &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;oci-extension&lt;/span&gt;
                          &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;containers&lt;/span&gt;
                           &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;list&lt;/span&gt;
                            &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;oci-bonfire-configuration-&amp;gt;oci-container-configuration&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;config&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;To make the switch in &lt;code&gt;operating-system&lt;/code&gt; records, you need to change from&lt;/p&gt;&lt;pre&gt;&lt;code&gt;    &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;simple-service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;'oci-containers&lt;/span&gt;
                    &lt;span class=&quot;syntax-symbol&quot;&gt;oci-container-service-type&lt;/span&gt;
                    &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;list&lt;/span&gt;
                     &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;oci-container-configuration&lt;/span&gt;
                      &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;to&lt;/p&gt;&lt;pre&gt;&lt;code&gt;    &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;simple-service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;'oci-containers&lt;/span&gt;
                    &lt;span class=&quot;syntax-symbol&quot;&gt;oci-service-type&lt;/span&gt;
                    &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;oci-extension&lt;/span&gt;
                     &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;containers&lt;/span&gt;
                      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;list&lt;/span&gt;
                       &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;oci-container-configuration&lt;/span&gt;
                        &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;</content></entry><entry><title>Unprivileged container management on the Guix System</title><id>https://fishinthecalculator.me/blog/unprivileged-container-management-on-the-guix-system.html</id><author><name>Giacomo Leidi</name><email>therewasa@fishinthecalculator.me</email></author><updated>2024-08-23T04:20:00Z</updated><link href="https://fishinthecalculator.me/blog/unprivileged-container-management-on-the-guix-system.html" rel="alternate" /><content type="html">&lt;p&gt;Docker is known to have less than optimal security defaults, hence the hype for Podman. If you want to run rootless containers in your Guix System, it is sufficient to add the following to your &lt;code&gt;operating-system&lt;/code&gt; configuration.&lt;/p&gt;&lt;pre&gt;&lt;code&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;use-service-modules&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;containers&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;networking&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;use-modules&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;gnu&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;system&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;accounts&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;  &lt;span class=&quot;syntax-comment&quot;&gt;;for 'subid-range'
&lt;/span&gt;
&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;operating-system&lt;/span&gt;
  &lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;
  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;users&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;cons&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;user-account&lt;/span&gt;
                &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;alice&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;comment&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;Your own user&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;group&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;users&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

                &lt;span class=&quot;syntax-comment&quot;&gt;;; Adding the account to the &amp;quot;cgroup&amp;quot; group
&lt;/span&gt;                &lt;span class=&quot;syntax-comment&quot;&gt;;; makes it possible to run podman commands.
&lt;/span&gt;                &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;supplementary-groups&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;cgroup&amp;quot;&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;wheel&amp;quot;&lt;/span&gt;
                                        &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;audio&amp;quot;&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;video&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
               &lt;span class=&quot;syntax-symbol&quot;&gt;%base-user-accounts&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;services&lt;/span&gt;
    &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;append&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;list&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;iptables-service-type&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;rootless-podman-service-type&lt;/span&gt;
                           &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;rootless-podman-configuration&lt;/span&gt;
                             &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;subgids&lt;/span&gt;
                               &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;list&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;subid-range&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;alice&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                             &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;subuids&lt;/span&gt;
                               &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;list&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;subid-range&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;alice&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
            &lt;span class=&quot;syntax-symbol&quot;&gt;%base-services&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;You can now run &lt;code&gt;guix system reconfigure ...&lt;/code&gt;, after Guix is done, reboot your machine and you should be able to run Podman containers. This is the hello world suggested by Podman:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;$ podman run -it --rm docker.io/alpine cat /etc/*release*
NAME=&amp;quot;Alpine Linux&amp;quot;
ID=alpine
VERSION_ID=3.20.2
PRETTY_NAME=&amp;quot;Alpine Linux v3.20&amp;quot;
HOME_URL=&amp;quot;https://alpinelinux.org/&amp;quot;
BUG_REPORT_URL=&amp;quot;https://gitlab.alpinelinux.org/alpine/aports/-/issues&amp;quot;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;and with &lt;code&gt;guix shell podman-compose&lt;/code&gt;, you can run this &lt;a href=&quot;https://github.com/fishinthecalculator/rootless-podman-nginx-static-server&quot;&gt;Podman compose hello world&lt;/a&gt; from the root of the repository:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;$ mkdir data
$ echo hello world &amp;gt; data/index.html
$ podman compose up -d

...

exit code: 0
$ curl localhost:8080
hello world&lt;/code&gt;&lt;/pre&gt;</content></entry><entry><title>Secrets management with SOPS Guix</title><id>https://fishinthecalculator.me/blog/secrets-management-with-sops-guix.html</id><author><name>Giacomo Leidi</name><email>therewasa@fishinthecalculator.me</email></author><updated>2024-01-02T16:20:00Z</updated><link href="https://fishinthecalculator.me/blog/secrets-management-with-sops-guix.html" rel="alternate" /><content type="html">&lt;p&gt;Dealing with secrets in functional operating systems can range from pretty usable to complete hell. Nix has &lt;a href=&quot;https://nixos.wiki/wiki/Comparison_of_secret_managing_schemes&quot;&gt;several answers to this problem&lt;/a&gt;, the more integrated of which appears to be &lt;a href=&quot;https://github.com/Mic92/sops-nix&quot;&gt;&lt;code&gt;sops-nix&lt;/code&gt;&lt;/a&gt;. After spending some months envying our neighbors grass, I figured it was time for Guix to have its own (attempt at an) answer to the secrets problem.&lt;/p&gt;&lt;p&gt;This is how the &lt;a href=&quot;https://github.com/fishinthecalculator/sops-guix&quot;&gt;SOPS Guix&lt;/a&gt; channel was born, the first take I'm aware of at implementing secure deploying of secrets with Guix and &lt;a href=&quot;https://getsops.io&quot;&gt;SOPS&lt;/a&gt; and as the name shows is quite inspired from Nix's &lt;code&gt;sops-nix&lt;/code&gt;.&lt;/p&gt;&lt;h2 id=&quot;secure_secret_provisioning_with_guix&quot;&gt;Secure secret provisioning with Guix&lt;/h2&gt;&lt;p&gt;This channels exposes the &lt;code&gt;sops-secrets-service-type&lt;/code&gt; Guix service and the &lt;code&gt;sops-secret&lt;/code&gt; record to safely handle secrets with Guix. It works by putting encrypted secrets in the store and by adding a one-shot Shepherd service that decrypts them at startup in a ramfs/tmpfs filesystem. This means that clear text secrets never hit the disk and that you can (and actually are encouraged to) check in your SOPS secrets in the same version control system you use to track you Guix configurations.&lt;/p&gt;&lt;p&gt;Assuming that the right private keys are also provided, &lt;code&gt;sops-secret&lt;/code&gt;s can be included in Guix images, deployed with &lt;code&gt;guix deploy&lt;/code&gt; and included in Guix System/Home containers. Before starting, &lt;a href=&quot;https://github.com/fishinthecalculator/sops-guix/#configure&quot;&gt;make sure you add it to your &lt;code&gt;.config/guix/channels.scm&lt;/code&gt;&lt;/a&gt;, run &lt;code&gt;guix pull&lt;/code&gt; and make sure &lt;code&gt;sops-guix&lt;/code&gt; appears in your &lt;code&gt;guix describe&lt;/code&gt; output.&lt;/p&gt;&lt;h3 id=&quot;creating_secrets_with_sops&quot;&gt;Creating secrets with SOPS&lt;/h3&gt;&lt;p&gt;First of all you need to create encrypted secrets with SOPS. To do so I'm assuming you already have a GPG key for yourself and the machines you want to deploy secrets to. You should be able to list the private keys you have in your keyring with&lt;/p&gt;&lt;pre&gt;&lt;code&gt;user1@home:~ $ gpg --list-secret-keys
/home/user1/.gnupg/pubring.kbx
------------------------
sec   ed25519 2023-12-01 [SC] [expires: 2907-11-30]
      8D1060B96BB8B7249AED41CC193B701E2SODIJNS
uid           [ultimate] user1@example.org
ssb   cv25519 2023-12-01 [E]

pub   rsa3072 1970-01-01 [SCE]
      8C3E4F6EB38828939029AE7BE9B6AF0CD39DD935
uid           [ unknown] root (Imported from SSH) &amp;lt;root@localhost&amp;gt;

pub   rsa3072 1970-01-01 [SCE]
      ZZ3E4VREB38800039029AE7BE9B6AF0CD39AALH9
uid           [ unknown] root (Imported from SSH) &amp;lt;root@localhost&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;If you don't have a suitable set of GPG keys it's pretty simple to find online how generate them. Once you have a suitable set of keys for yourself and your machines you are ready to create the only configuration you need for SOPS: a &lt;code&gt;.sops.yaml&lt;/code&gt; file that you will place in your project's root directory, or anyway in the same directory where you keep your system configuration. In this file you define which keys will be able to access your secrets files, it may very well be something like:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;keys:
    - &amp;amp;user_user1 8D1060B96BB8B7249AED41CC193B701E2SODIJNS
    - &amp;amp;host_host1 8C3E4F6EB38828939029AE7BE9B6AF0CD39DD935
    - &amp;amp;host_host2 ZZ3E4VREB38800039029AE7BE9B6AF0CD39AALH9

creation_rules:
    - path_regex: .*common\.yaml$
      key_groups:
          - pgp:
                - *user_user1
                - *host_host1
                - *host_host2
    - path_regex: .*host1\.yaml$
      key_groups:
          - pgp:
                - *user_user1
                - *host_host1&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;In this file we define three keys called &lt;code&gt;user_user1&lt;/code&gt;, &lt;code&gt;host_host1&lt;/code&gt; and &lt;code&gt;host_host2&lt;/code&gt; . The prefixes &lt;code&gt;host_&lt;/code&gt; and &lt;code&gt;user_&lt;/code&gt; are just a convention to indicate that some GPG keys belong to users and some belong to machines.&lt;/p&gt;&lt;p&gt;We now have defined two secrets file names patterns and we declared permissions for each key, it should be possible now to run the following in your projects root directory:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;sops common.yaml&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This will open your default editor with an example content to define your secrets value. You can edit it or delete it and your own content for example:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;wireguard:
    private: MYPRIVATEKEY&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;after saving and closing the file you can see by &lt;code&gt;cat&lt;/code&gt;ting the secret file that &lt;code&gt;sops&lt;/code&gt; encrypted it before saving it, so you are free to check it in your VCS.&lt;/p&gt;&lt;h3 id=&quot;making_sure_the_right_host_keys_are_in_the_configured_gnupg_keyring&quot;&gt;Making sure the right host keys are in the configured GnuPG keyring&lt;/h3&gt;&lt;p&gt;For hosts to be able to decrypt secrets you need to provide in the &lt;code&gt;root&lt;/code&gt; user keyring (or anyway the keyring located at the configured &lt;code&gt;gnupg-homedir&lt;/code&gt;) the keys you defined in your &lt;code&gt;.sops.yaml&lt;/code&gt;. So based on the above example you'd need to provide &lt;code&gt;8C3E4F6EB38828939029AE7BE9B6AF0CD39DD935&lt;/code&gt;'s private key on &lt;code&gt;host1&lt;/code&gt; and &lt;code&gt;ZZ3E4VREB38800039029AE7BE9B6AF0CD39AALH9&lt;/code&gt;'s private key on &lt;code&gt;host2&lt;/code&gt; .&lt;/p&gt;&lt;p&gt;To check that your key is correctly imported into the keyring run:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;user1@host1:~ $ sudo gpg --list-secret-keys
/root/.gnupg/pubring.kbx
------------------------
pub   rsa3072 1970-01-01 [SCE]
      8C3E4F6EB38828939029AE7BE9B6AF0CD39DD935
uid           [ unknown] root (Imported from SSH) &amp;lt;root@localhost&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;By setting &lt;code&gt;generate-key?&lt;/code&gt; to &lt;code&gt;#t&lt;/code&gt; in &lt;code&gt;sops-service-configuration&lt;/code&gt; a GPG key will be automatically derived for you from your system's &lt;code&gt;/etc/ssh/ssh_host_rsa_key&lt;/code&gt; and added to the configured keyring. It is &lt;em&gt;discouraged&lt;/em&gt; to do so and you are more than encouraged to autonomally provide a key in your configured keyring.&lt;/p&gt;&lt;h3&gt;Adding secrets to your &lt;code&gt;operating-system&lt;/code&gt; record&lt;/h3&gt;&lt;p&gt;Now, supposing you have your &lt;code&gt;operating-system&lt;/code&gt; file in the same directory where you have your &lt;code&gt;.sops.yaml&lt;/code&gt; and &lt;code&gt;common.yaml&lt;/code&gt; files, you can simply add the following to your configuration:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;use-modules&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;sops&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;secrets&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
             &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;sops&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;services&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;sops&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
             &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;guix&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;utils&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;define&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;project-root&lt;/span&gt;
  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;current-source-directory&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;define&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;sops.yaml&lt;/span&gt;
  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;local-file&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;string-append&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;project-root&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;/.sops.yaml&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
              &lt;span class=&quot;syntax-comment&quot;&gt;;; This is because paths on the store
&lt;/span&gt;              &lt;span class=&quot;syntax-comment&quot;&gt;;; can not start with dots.
&lt;/span&gt;              &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;sops.yaml&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;define&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;common.yaml&lt;/span&gt;
  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;local-file&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;string-append&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;project-root&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;/common.yaml&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;operating-system&lt;/span&gt;
  &lt;span class=&quot;syntax-open&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;]&lt;/span&gt;
  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;services&lt;/span&gt;
    &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;list&lt;/span&gt;
       &lt;span class=&quot;syntax-open&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;]&lt;/span&gt;
       &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;sops-secrets-service-type&lt;/span&gt;
                &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;sops-service-configuration&lt;/span&gt;
                  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;gnupg-homedir&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;/mnt/.gnupg&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;generate-key?&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;#t&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;config&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;sops.yaml&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;secrets&lt;/span&gt;
                    &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;list&lt;/span&gt;
                      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;sops-secret&lt;/span&gt;
                        &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;key&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;wireguard&amp;quot;&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;private&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                        &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;file&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;common.yaml&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                        &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;user&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;user1&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                        &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;group&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;users&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                        &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;permissions&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;#o400&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Upon reconfiguration, this will yield the following content at &lt;code&gt;/run/secrets&lt;/code&gt;:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;user1@host1:~ $ sudo ls -la /run/secrets/
total 12
drwxr-xr-x 1 root root    50 Jan  2 12:44 .
drwxr-xr-x 1 root root   254 Jan  2 12:44 ..
lrwxrwxrwx 1 root root    53 Jan  2 12:44 .sops.yaml -&amp;gt; /gnu/store/lyhyh91jw2n2asa1w0fc0zmv93yxkxip-sops.yaml
-r-------- 1 user1 users  44 Jan  2 12:44 wireguard
user1@host1:~ $ cat /run/secrets/wireguard/private
MYPRIVATEKEY&lt;/code&gt;&lt;/pre&gt;&lt;h3&gt;Adding secrets to your &lt;code&gt;home-environment&lt;/code&gt; record&lt;/h3&gt;&lt;p&gt;&lt;code&gt;sops-guix&lt;/code&gt; also provides a Guix Home service that is able to provide most feature of the system service. Most significant limitations are:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;AFAIK &lt;code&gt;home-environment&lt;/code&gt;s can't configure ramfs mount points hence the &lt;code&gt;secrets-directory&lt;/code&gt; option is not available. Secrets are stored in &lt;code&gt;/run/user/$UID/secrets&lt;/code&gt; which usually is mounted on tmpfs.&lt;/li&gt;&lt;li&gt;&lt;code&gt;sops-secret-user&lt;/code&gt; and &lt;code&gt;sops-secrets-group&lt;/code&gt; are ignored. All secrets belong to the user running the Guix comman line but you can still set permissions.&lt;/li&gt;&lt;li&gt;There's no option to automatically generate GPG keys since probably users can easily generate one.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Now, supposing you have your &lt;code&gt;home-environment&lt;/code&gt; file in the same directory where you have your &lt;code&gt;.sops.yaml&lt;/code&gt; and your secrets files, you can simply add the following to your configuration:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;use-modules&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;sops&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;secrets&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
             &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;sops&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;home&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;services&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;sops&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
             &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;guix&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;utils&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;define&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;project-root&lt;/span&gt;
  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;current-source-directory&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;define&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;sops.yaml&lt;/span&gt;
  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;local-file&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;string-append&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;project-root&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;/.sops.yaml&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
              &lt;span class=&quot;syntax-comment&quot;&gt;;; This is because paths on the store
&lt;/span&gt;              &lt;span class=&quot;syntax-comment&quot;&gt;;; can not start with dots.
&lt;/span&gt;              &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;sops.yaml&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;define&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;user1.yaml&lt;/span&gt;
  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;local-file&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;string-append&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;project-root&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;/user1.yaml&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;home-environment&lt;/span&gt;
  &lt;span class=&quot;syntax-open&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;]&lt;/span&gt;
  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;services&lt;/span&gt;
    &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;list&lt;/span&gt;
       &lt;span class=&quot;syntax-open&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;]&lt;/span&gt;
       &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;home-sops-secrets-service-type&lt;/span&gt;
                &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;home-sops-service-configuration&lt;/span&gt;
                  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;gnupg-homedir&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;string-append&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;getenv&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;HOME&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;/.gnupg&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;config&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;sops.yaml&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;secrets&lt;/span&gt;
                    &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;list&lt;/span&gt;
                      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;sops-secret&lt;/span&gt;
                        &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;key&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;wireguard&amp;quot;&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;private&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                        &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;file&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;user1.yaml&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                        &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;permissions&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;#o400&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Upon reconfiguration, this will yield the following content at &lt;code&gt;/run/secrets/$YOUR_UID/secrets&lt;/code&gt;:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;user1@host1:~ $ ls -la /run/user/$(id -u)/secrets
total 12
drwxr-xr-x 1 user1 users    50 Jan  2 12:44 .
drwxr-xr-x 1 user1 users   254 Jan  2 12:44 ..
lrwxrwxrwx 1 user1 users    53 Jan  2 12:44 .sops.yaml -&amp;gt; /gnu/store/lyhyh91jw2n2asa1w0fc0zmv93yxkxip-sops.yaml
-r-------- 1 user1 users    44 Jan  2 12:44 wireguard
user1@host1:~ $ cat /run/user/$(id -u)/secrets/wireguard/private
MYPRIVATEKEY&lt;/code&gt;&lt;/pre&gt;</content></entry><entry><title>Monitor your Guix System with Grafana</title><id>https://fishinthecalculator.me/blog/monitor-your-guix-system-with-grafana.html</id><author><name>Giacomo Leidi</name><email>therewasa@fishinthecalculator.me</email></author><updated>2023-12-30T16:20:00Z</updated><link href="https://fishinthecalculator.me/blog/monitor-your-guix-system-with-grafana.html" rel="alternate" /><content type="html">&lt;p&gt;If you need to run Grafana on the Guix System this post is the right place. In this example we'll setup Grafana to read metrics from the same machine it's run upon, but you can adapt this to use a remote datasource.&lt;/p&gt;&lt;p&gt;First of all, &lt;a href=&quot;https://github.com/fishinthecalculator/gocix#configure&quot;&gt;add &lt;code&gt;gocix&lt;/code&gt;&lt;/a&gt; to your Guix channels and run &lt;code&gt;guix pull&lt;/code&gt;.&lt;/p&gt;&lt;p&gt;After making sure you have &lt;code&gt;gocix&lt;/code&gt; in your &lt;code&gt;guix describe&lt;/code&gt; output, you just need to add the following services to your &lt;code&gt;operating-system&lt;/code&gt; record and reconfigure your system.&lt;/p&gt;&lt;pre&gt;&lt;code&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;use-modules&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;oci&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;services&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;grafana&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
             &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;oci&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;services&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;prometheus&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
             &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;gnu&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;services&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;monitoring&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;operating-system&lt;/span&gt;
  &lt;span class=&quot;syntax-open&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;]&lt;/span&gt;
  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;services&lt;/span&gt;
    &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;list&lt;/span&gt;
      &lt;span class=&quot;syntax-open&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;]&lt;/span&gt;
      &lt;span class=&quot;syntax-comment&quot;&gt;;; Prometheus node exporter
&lt;/span&gt;      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;prometheus-node-exporter-service-type&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
      &lt;span class=&quot;syntax-comment&quot;&gt;;; Prometheus OCI backed Shepherd service
&lt;/span&gt;      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;oci-prometheus-service-type&lt;/span&gt;
               &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;oci-prometheus-configuration&lt;/span&gt;
                &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;network&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;host&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
      &lt;span class=&quot;syntax-comment&quot;&gt;;; Grafana OCI backed Shepherd service
&lt;/span&gt;      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;oci-grafana-service-type&lt;/span&gt;
               &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;oci-grafana-configuration&lt;/span&gt;
                &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;network&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;host&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;After you can see both Prometheus and Grafana spawned as Docker containers, such as in this example&lt;/p&gt;&lt;pre&gt;&lt;code&gt;docker ps
CONTAINER ID   IMAGE                     COMMAND                  CREATED          STATUS          PORTS                                                                                  NAMES
fede69fcf4bf   prom/prometheus:v2.45.0   &amp;quot;/bin/prometheus --w…&amp;quot;   26 seconds ago   Up 25 seconds   0.0.0.0:9000-&amp;gt;9000/tcp, :::9000-&amp;gt;9000/tcp, 0.0.0.0:9090-&amp;gt;9090/tcp, :::9090-&amp;gt;9090/tcp   docker-prometheus
caa2dc1f50c0   bitnami/grafana:10.1.5    &amp;quot;/opt/bitnami/script…&amp;quot;   26 seconds ago   Up 25 seconds   0.0.0.0:3000-&amp;gt;3000/tcp, :::3000-&amp;gt;3000/tcp                                              docker-grafana&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;you should be able to visit &lt;a href=&quot;http://localhost:3000&quot;&gt;localhost:3000&lt;/a&gt; and see the Grafana login page.&lt;/p&gt;&lt;p&gt;&lt;img src=&quot;/static/images/grafana-login.png&quot; alt=&quot;Grafana's login page&quot; /&gt;&lt;/p&gt;&lt;p&gt;The default credentials are &lt;code&gt;admin:admin&lt;/code&gt;, log in and configure a new datasource with &lt;code&gt;http://localhost:9090&lt;/code&gt; as URL. In this example we'll avoid creating a new dashboard from scratch and we'll import one from the &lt;a href=&quot;https://grafana.com/grafana/dashboards/&quot;&gt;Grafana's website&lt;/a&gt;. Just click on the button to create a new dashboard and choose the import option, paste &lt;code&gt;1860&lt;/code&gt; as the Dashboard ID, select the Prometheus datasource you just created and import the dashboard.&lt;/p&gt;&lt;p&gt;You should be presented with the full data available from the &lt;code&gt;prometheus-node-exporter-service-type&lt;/code&gt; by default.&lt;/p&gt;&lt;p&gt;&lt;img src=&quot;/static/images/grafana-dashboard.png&quot; alt=&quot;Grafana's Node Exporter Full dashboard&quot; /&gt;&lt;/p&gt;</content></entry><entry><title>Tame Docker selfhosting with Guix</title><id>https://fishinthecalculator.me/blog/tame-docker-selfhosting-with-guix.html</id><author><name>Giacomo Leidi</name><email>therewasa@fishinthecalculator.me</email></author><updated>2023-12-10T16:20:00Z</updated><link href="https://fishinthecalculator.me/blog/tame-docker-selfhosting-with-guix.html" rel="alternate" /><content type="html">&lt;p&gt;Many applications are packaged in &lt;a href=&quot;https://opencontainers.org&quot;&gt;OCI&lt;/a&gt;/Docker images but not in Guix. A good subset of them is written either in NodeJS, Go, Rust or languages that, as a general approach, encourage applications to have huge dependency graphs.&lt;/p&gt;&lt;p&gt;Let's take Grafana as an example. &lt;a href=&quot;https://github.com/grafana/grafana/blob/main/package.json&quot;&gt;According to its &lt;code&gt;package.json&lt;/code&gt;&lt;/a&gt; Grafana's web frontend has more than 180 direct dependencies and more than 170 build time dependencies, for a grand total of ~350 direct dependencies. This is excluding all transitive dependencies. In the same way, Grafana's &lt;a href=&quot;https://github.com/grafana/grafana/blob/main/go.mod&quot;&gt;Go backend&lt;/a&gt; has ~440 direct dependencies. Some of them may be optional, but go figure.&lt;/p&gt;&lt;p&gt;This phenomenon is not uncommon in modern software development, it's not that Grafana is doing worse than everyone else. Yet it's quite problematic, it clearly shows that nobody put the effort of auditing or even reviewing the dependency graph of one of the most used dashboarding application in the industry.&lt;/p&gt;&lt;p&gt;Dissecting the interests which prevent the investment in building software products with a sustainable maintenance process is a topic for another post, the point is that the Guix project accepts package contributions that comply to very strict standards in term of licensing and other criteria, such as whether the package and its dependencies can be completely built from source. It's the reason why practically no NodeJS application (or even web applications with complex frontends, such as Grafana) can be upstreamed to Guix. It is not clear &lt;a href=&quot;https://dustycloud.org/blog/javascript-packaging-dystopia/&quot;&gt;whether they will ever be&lt;/a&gt;, since especially in the Javascript world packages suffer from cyclical dependency which complicate the packaging process even more.&lt;/p&gt;&lt;p&gt;It is very painful to have to package whole dependency graphs just to use some service on the Guix System. This is especially true when you have a goal that you want to achieve and you could use Guix to achieve it, but it does not necessarily involve sending a bunch of patches upstream. It could be that you want to start some Matrix community around Guix or other people-sized technologies, you may want to self host a personal cloud with Nextcloud or maybe you want to setup an accessible monitoring dashboard for your services with Grafana and Prometheus. These are all softwares that do not follow the best sustainability practices, but they are pretty useful to use while we build the alternative technology (also called alt-tech) that we need to survive sustainably in our digital lives.&lt;/p&gt;&lt;h2 id=&quot;container_taming_on_guix&quot;&gt;Container taming on Guix&lt;/h2&gt;&lt;p&gt;If you use &lt;code&gt;docker compose&lt;/code&gt; on the Guix System, you end up having two different interfaces to manage your system services: Shepherd and Docker. The &lt;code&gt;oci-container-service-type&lt;/code&gt; aims at &lt;a href=&quot;https://guix.gnu.org/en/manual/devel/en/guix.html#index-oci_002dcontainer_002dservice_002dtype&quot;&gt;implementing Shepherd Services&lt;/a&gt; that look and feel native (so you can configure and manage them with the usual consistent interface that Guix exposes) but under the hood are implemented as &lt;code&gt;docker run&lt;/code&gt; (or &lt;code&gt;docker rm&lt;/code&gt;) invokations, so that you don't have to package those huge dependency graphs just to start self hosting on Guix.&lt;/p&gt;&lt;p&gt;Next you can find an example of how run Prometheus on the Guix System through the &lt;code&gt;oci-container-service-type&lt;/code&gt;. You just need to add&lt;/p&gt;&lt;pre&gt;&lt;code&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;use-modules&lt;/span&gt; &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;gnu&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;services&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;docker&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
             &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;gnu&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;services&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;monitoring&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
             &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;guix&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;gexp&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-special&quot;&gt;define&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;prometheus.yml&lt;/span&gt;
  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;plain-file&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;prometheus.yml&amp;quot;&lt;/span&gt;
              &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;global:
  scrape_interval: 30s
  scrape_timeout: 12s

scrape_configs:
  - job_name: prometheus
    metrics_path: /metrics
    static_configs:
      - targets: ['localhost:9090','localhost:9100']\n&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;operating-system&lt;/span&gt;
  &lt;span class=&quot;syntax-open&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;]&lt;/span&gt;
  &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;services&lt;/span&gt;
    &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;list&lt;/span&gt;
      &lt;span class=&quot;syntax-open&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;]&lt;/span&gt;
      &lt;span class=&quot;syntax-comment&quot;&gt;;; Prometheus node exporter
&lt;/span&gt;      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;prometheus-node-exporter-service-type&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
      &lt;span class=&quot;syntax-comment&quot;&gt;;; Prometheus OCI backed Shepherd service
&lt;/span&gt;      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;simple-service&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;oci-container-service-type&lt;/span&gt;
                      &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;list&lt;/span&gt;
                        &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;oci-container-configuration&lt;/span&gt;
                          &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;command&lt;/span&gt;
                            &lt;span class=&quot;syntax-symbol&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;--web.enable-lifecycle&amp;quot;&lt;/span&gt;
                              &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;--config.file=/etc/prometheus/prometheus.yml&amp;quot;&lt;/span&gt;
                              &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;--web.enable-admin-api&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                          &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;image&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;prom/prometheus:v2.45.0&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                          &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;ports&lt;/span&gt;
                            &lt;span class=&quot;syntax-symbol&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;9000&amp;quot;&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;9000&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                              &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;9090&amp;quot;&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;9090&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                          &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;volumes&lt;/span&gt;
                            &lt;span class=&quot;syntax-symbol&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;/var/lib/prometheus&amp;quot;&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;/prometheus&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;
                              &lt;span class=&quot;syntax-open&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;syntax-symbol&quot;&gt;,prometheus.yml&lt;/span&gt; &lt;span class=&quot;syntax-symbol&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;syntax-string&quot;&gt;&amp;quot;/etc/prometheus/prometheus.yml:ro&amp;quot;&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;syntax-close&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;to the &lt;code&gt;services&lt;/code&gt; field of your &lt;code&gt;operating-system&lt;/code&gt; record. In this example it's also shown how to install the Prometheus node exporter to collect metrics from the host.&lt;/p&gt;&lt;p&gt;This approach obviously is lacking in reproducibility and bootstrappability, but in my experience often users need some software that is not yet guixable (i.e. possible to include in Guix upstream) so they choose to use Nix or something else entirely.&lt;/p&gt;&lt;h2 id=&quot;what's_next?&quot;&gt;What's next?&lt;/h2&gt;&lt;p&gt;The &lt;code&gt;oci-container-service-type&lt;/code&gt; implements Shepherd services through Docker containers, but a Shepherd service is only a small block in the implementation of a nicely integrated Guix System service. To provide a secure, consistent and integrated experience a Guix System service may declare user accounts, to allow for less then root authority execution, or it may initialize some state upon activation: all things for which an additional service extension is required.&lt;/p&gt;&lt;p&gt;This is why I'm implementing a &lt;a href=&quot;https://github.com/fishinthecalculator/gocix&quot;&gt;library of (hopefully) community maintained Guix System services&lt;/a&gt; for many common self hostable applications such as Matrix Conduit, Forgejo, Grafana and more. These services try to be as similar as possible to an upstream provided service, in the hope of being upstreamed as soon as the underlying dependency graph is packaged.&lt;/p&gt;</content></entry></feed>