<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom"><title>frankie-tales</title><id>https://lovergine.com/feeds/tags/guile.xml</id><subtitle>Tag: guile</subtitle><updated>2026-06-18T07:00:01Z</updated><link href="https://lovergine.com/feeds/tags/guile.xml" rel="self" /><link href="https://lovergine.com" /><entry><title>Playing with Vagrant, Virtualbox and Guix</title><id>https://lovergine.com/playing-with-vagrant-virtualbox-and-guix.html</id><author><name>Francesco P. Lovergine</name><email>mbox@lovergine.com</email></author><updated>2024-09-04T18:20:00Z</updated><link href="https://lovergine.com/playing-with-vagrant-virtualbox-and-guix.html" rel="alternate" /><content type="html">&lt;p&gt;It is specifically convenient using &lt;code&gt;Guix-the-system&lt;/code&gt; within a &lt;em&gt;foreign distribution&lt;/em&gt;,
such as Debian, for development and tests. The package management
system can be used on top of the system, but I find it quite interesting to
explore the potential of the Guix distribution in the context of virtualized
environments. For personal use, that is also the ideal way to avoid breaking
your own daily boxes every couple of days with daredevil approaches to personal
computing.&lt;/p&gt;&lt;p&gt;I find it quite handy to use &lt;a href=&quot;https://www.vagrantup.com/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Vagrant&lt;/a&gt; to synthetically describe multiple virtual hosts within a virtual network, by means of a single &lt;code&gt;Vagrantfile&lt;/code&gt;. Nowadays, there are
multiple &lt;em&gt;virtualization systems&lt;/em&gt; usable for the same purpose, including the &lt;code&gt;libvirt&lt;/code&gt; ecosystem. Under the hood, those systems can generally manage multiple virtual machine engines (or even cloud systems). Vagrant under Debian can use either &lt;a href=&quot;https://libvirt.org/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;em&gt;Libvirt+KVM&lt;/em&gt;&lt;/a&gt; or &lt;a href=&quot;https://virtualbox.org/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;em&gt;Virtualbox&lt;/em&gt;&lt;/a&gt; (the default one used by the upstream Vagrant) as primary engines.&lt;/p&gt;&lt;p&gt;Users can develop their own Vagrant images (called &lt;em&gt;boxes&lt;/em&gt;) or use those made available on the Hashicorp cloud, as developed by third-party teams (which is the common case).&lt;/p&gt;&lt;p&gt;Unfortunately, while there are &lt;a href=&quot;https://app.vagrantup.com/debian/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;a handful&lt;/a&gt; of Debian boxes developed by &lt;a href=&quot;https://wiki.debian.org/Teams/Cloud/VagrantBaseBoxes&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;the Debian Cloud Team&lt;/a&gt;, like many other ones for multiple distributions and releases, this is not the case for Guix. At the time of this post, there is only &lt;a href=&quot;https://portal.cloud.hashicorp.com/vagrant/discover?query=guix&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;a single box&lt;/a&gt; created some years ago by &lt;a href=&quot;https://github.com/palfrey/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Tom Parker-Shemilt&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;Of course, the Guix team also made a &lt;code&gt;qcow2&lt;/code&gt; image available to run a virtualized desktop machine under a QEMU/KVM system, as explained &lt;a href=&quot;https://guix.gnu.org/manual/en/html_node/Running-Guix-in-a-VM.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;in the manual&lt;/a&gt;. What is described in this post can also be easily applied to create an alternative custom implementation with QEMU. What is required is to create a virtual disk image of some kind and use it to populate a custom distribution configuration via &lt;code&gt;guix&lt;/code&gt;. The resulting image will be runnable under a suitable virtualization system in the host foreign distribution.&lt;/p&gt;&lt;p&gt;Let's assume to use any recent version of Vagrant and Virtualbox, both installed on the host system, along with the Guix package manager. The following are the steps required to create a Vagrant box with a minimal configuration of Guix that is compatible (with some limitations) with Vagrant and can be used to run any number of Guix VMs. Each Guix vm can be reconfigured for specific goals using multiple configurations.&lt;/p&gt;&lt;p&gt;In this case, we will not need to use &lt;a href=&quot;https://www.packer.io/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Packer&lt;/a&gt; to prepare a box because the &lt;code&gt;vagrant package&lt;/code&gt; command directly supports Virtualbox images with the same purpose.&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Create an empty &lt;a href=&quot;https://en.wikipedia.org/wiki/Virtual_disk_and_virtual_drive&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;virtual disk&lt;/a&gt; image and partition it.&lt;/li&gt;&lt;li&gt;Prepare a suitable configuration written in Guile for Guix.&lt;/li&gt;&lt;li&gt;Run an initial setup of the mounted virtual disk using &lt;code&gt;guix&lt;/code&gt; on your host.&lt;/li&gt;&lt;li&gt;Create a basic Virtualbox machine and attach the virtual disk to it.&lt;/li&gt;&lt;li&gt;Convert the machine into a Vagrant box and register it.&lt;/li&gt;&lt;li&gt;Prepare a Vagrantfile snippet and run the vm(s).&lt;/li&gt;&lt;li&gt;(Re)configure vm(s) on the basis of your needs.&lt;/li&gt;&lt;li&gt;Done!&lt;/li&gt;&lt;/ul&gt;&lt;h2 id=&quot;create-a-virtual-disk-image-and-partition-it&quot;&gt;Create a virtual disk image and partition it&lt;/h2&gt;&lt;p&gt;This is the straightforward part. Here, I'm using the &lt;code&gt;vdi&lt;/code&gt; format, the native Virtualbox one, but the VMware &lt;code&gt;vmdk&lt;/code&gt; format can be used instead.&lt;/p&gt;&lt;pre&gt;&lt;code&gt; # load the Network Block Device module
 sudo modprobe nbd
 # create a thin device
 qemu-img create -f vdi guix-hd.vdi 100G
 # ... mount it
 sudo qemu-nbd -f vdi --connect=/dev/nbd0 guix-hd.vdi
 # ... partition it 
 sudo parted /dev/nbd0 mklabel msdos
 sudo parted -a cylinder /dev/nbd0 mkpart primary ext4 1 93G
 sudo parted -a cylinder /dev/nbd0 mkpart primary linux-swap 93G 100%
 sudo parted /dev/nbd0 set 1 boot on 
 # ... create a suitable fs
 sudo mkfs.ext4 /dev/nbd0p1
 sudo mkswap /dev/nbd0p2
 # ... have a look to the partions IDs
 sudo blkid /dev/nbd0p1 
 sudo blkid /dev/nbd0p2
 # ... mount the root fs
 sudo mount /dev/nbd0p1 /mnt &lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&quot;prepare-a-suitable-configuration-written-in-guile-for-guix&quot;&gt;Prepare a suitable configuration written in Guile for Guix&lt;/h2&gt;&lt;p&gt;Any valid configuration can be prepared, in this case this is a minimal one with
a pair of changes for Vagrant. Specifically, a &lt;code&gt;vagrant&lt;/code&gt; user in the &lt;code&gt;wheel&lt;/code&gt;
group needs to be added, and it should be able to run sudo without a
password. Even, the unsecure Vagrant key needs to be authorized to access via ssh.&lt;/p&gt;&lt;p&gt;Note that the key is added at the system level, and the root user has no password,
which should be appropriately changed after the first run or, even better, at
provisioning time. That is a requirement if the box would be exposed on public
network, because the default private and public keys of Vagrant are publicly distributed.&lt;/p&gt;&lt;p&gt;That is usually and automagically done by &lt;code&gt;vagrant&lt;/code&gt; at first boot, but Guix is a read-only system
and - as we will see - the Guix system is still not completely supported by Vagrant.&lt;/p&gt;&lt;pre&gt;&lt;code&gt;ROOTFS_UUID=$(sudo blkid -o value /dev/nbd0p1|head -1)
SWAP_UUID=$(sudo blkid -o value /dev/nbd0p2|head -1)
DEVICE=/dev/nbd0

# Download the unsecure ssh key used by Vagrant
wget -q -O vagrant.pub https://raw.githubusercontent.com/mitchellh/vagrant/master/keys/vagrant.pub

cat &amp;gt;guix-config.scm &amp;lt;&amp;lt;EOF
;; Indicate which modules to import to access the variables
;; used in this configuration.
(use-modules (gnu))
(use-modules (gnu system))
(use-modules (gnu services avahi))
(use-service-modules desktop networking ssh)

;; Prepare a salt function for a less silly password encryption
(set! *random-state* (random-state-from-platform))
(define str &amp;quot;0123456789abcdefghijklmnopqrstuvwxyz&amp;quot;)
(define rnd-chr (lambda () (string-ref str (random (- (string-length str) 1)))))
(define salt (lambda () (string-append (string (rnd-chr)) (string (rnd-chr)) (string (rnd-chr)))))

(operating-system
  (locale &amp;quot;en_US.utf8&amp;quot;)
  (timezone &amp;quot;Europe/Rome&amp;quot;)
  (keyboard-layout (keyboard-layout &amp;quot;us&amp;quot; &amp;quot;intl&amp;quot;))
  (host-name &amp;quot;guix&amp;quot;)

  ;; The list of user accounts ('root' is implicit).
  (users (cons* (user-account
                  (name &amp;quot;vagrant&amp;quot;)
                  (comment &amp;quot;Vagrant user&amp;quot;)
                  (group &amp;quot;users&amp;quot;)
                  (home-directory &amp;quot;/home/vagrant&amp;quot;)
                  (password (crypt &amp;quot;vagrant&amp;quot; (string-append &amp;quot;\$6\$&amp;quot; (salt))))
                  (supplementary-groups '(&amp;quot;wheel&amp;quot; &amp;quot;netdev&amp;quot; &amp;quot;audio&amp;quot; &amp;quot;video&amp;quot;)))
                %base-user-accounts))

  ;; Packages installed system-wide.  Users can also install packages
  ;; under their own account: use 'guix search KEYWORD' to search
  ;; for packages and 'guix install PACKAGE' to install a package.
  (packages (append (list (specification-&amp;gt;package &amp;quot;nss-certs&amp;quot;)
                          (specification-&amp;gt;package &amp;quot;rsync&amp;quot;))
                    %base-packages))

  ;; Below is the list of system services.  To search for available
  ;; services, run 'guix system search KEYWORD' in a terminal.
  (services
   (append (list (service dhcp-client-service-type)
                 (service openssh-service-type
                    ;; here the official unsecure Vagrant ssh key is used...
                    (openssh-configuration
                      (authorized-keys \`((&amp;quot;vagrant&amp;quot; ,(local-file &amp;quot;vagrant.pub&amp;quot;)))))))

           ;; This is the default list of services we
           ;; are appending to.
           %base-services))

  ;; Authorize vagrant to run sudo without password.
  (sudoers-file
    (plain-file &amp;quot;sudoers&amp;quot;
                 (string-append (plain-file-content %sudoers-specification)
                                &amp;quot;vagrant ALL=(ALL) NOPASSWD: ALL\\n&amp;quot;)))

  (bootloader (bootloader-configuration
                (bootloader grub-bootloader)
                (targets (list &amp;quot;$DEVICE&amp;quot;))
                (keyboard-layout keyboard-layout)))
  (swap-devices (list (swap-space
                        (target (uuid
                                 &amp;quot;$SWAP_UUID&amp;quot;)))))

  ;; The list of file systems that get &amp;quot;mounted&amp;quot;.  The unique
  ;; file system identifiers there (&amp;quot;UUIDs&amp;quot;) can be obtained
  ;; by running 'blkid' in a terminal.
  (file-systems (cons* (file-system
                         (mount-point &amp;quot;/&amp;quot;)
                         (device (uuid
                                  &amp;quot;$ROOTFS_UUID&amp;quot;
                                  'ext4))
                         (type &amp;quot;ext4&amp;quot;)) %base-file-systems)))
EOF&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&quot;run-an-initial-setup-of-the-mounted-virtual-disk-using-guix-on-your-host&quot;&gt;Run an initial setup of the mounted virtual disk using &lt;code&gt;guix&lt;/code&gt; on your host&lt;/h2&gt;&lt;p&gt;The &lt;code&gt;system init&lt;/code&gt; can be run more than once, if required.&lt;/p&gt;&lt;pre&gt;&lt;code&gt;sudo guix pull # only if needed to update packages...
sudo guix system init guix-config.scm /mnt
sudo umount /mnt
sudo qemu-nbd --disconnect /dev/nbd0&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&quot;create-a-basic-virtualbox-machine-and-attach-the-virtual-disk-to-it&quot;&gt;Create a basic Virtualbox machine and attach the virtual disk to it&lt;/h2&gt;&lt;p&gt;Now, the virtual disk should already be registered and visibile under your Virtualbox configuration.&lt;/p&gt;&lt;pre&gt;&lt;code&gt;VDI_UUID=`vboxmanage showhdinfo guix-hd.vdi|grep ^UUID|awk '{print $2}'` &amp;amp;&amp;amp; echo $VDI_UUID&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;should show the hexadecimal code associated to the now populated disk. It is now possible to create
a simple virtual machine, for instance:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;vboxmanage createvm --name=Guix --default --ostype=Linux_64 --register
vboxmanage modifyvm Guix --memory=4096 --cpus=2 --ioapic=on --vram=256 --cpu-profile=host \
                --audio-enabled=off --usb-xhci=off --usb-ehci=off --usb-ohci=off --mouse=ps2
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;and attach the virtual disk to it, as follows:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;vboxmanage storageattach Guix --storagectl=SATA --type=hdd --port=0 --device=0 --medium=$VDI_UUID
vboxmanage showvminfo Guix&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&quot;convert-the-machine-into-a-vagrant-box-and-register-it&quot;&gt;Convert the machine into a Vagrant box and register it&lt;/h2&gt;&lt;p&gt;The resulting vm can be directly used under Virtualbox, but the final touch is creating a proper Vagrant box to recycle and possibly publish on the cloud.&lt;/p&gt;&lt;pre&gt;&lt;code&gt;vagrant package --base Guix --output guix-small.box
vagrant box add guix-small.box --name=guix-small
vagrant box list&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Now the new box is ready for use in multiple configurations within a &lt;code&gt;Vagrantfile&lt;/code&gt;.&lt;/p&gt;&lt;h2 id=&quot;prepare-a-vagrantfile-snippet-and-run-the-vm-s&quot;&gt;Prepare a Vagrantfile snippet and run the vm(s)&lt;/h2&gt;&lt;p&gt;A simple &lt;code&gt;Vagrantfile&lt;/code&gt; can be used to create an instance of the box, such as:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;Vagrant.configure(&amp;quot;2&amp;quot;) do |config|
    config.vm.define &amp;quot;guix1&amp;quot; do |vm1|
     vm1.vm.box = &amp;quot;guix-small&amp;quot;
     vm1.vm.network &amp;quot;private_network&amp;quot;, ip: &amp;quot;192.168.1.2&amp;quot;
     vm1.vm.provider &amp;quot;virtualbox&amp;quot; do |vb1|
        vb1.memory = &amp;quot;8192&amp;quot;
    	vb1.name = &amp;quot;guix8G&amp;quot;
    	vb1.cpus = 4
    end
    config.vm.provision &amp;quot;shell&amp;quot;, inline: &amp;lt;&amp;lt;-SHELL
        guix pull
        guix install htop 
     SHELL
    end
end&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;A new machine can be created, started up and connected easily, with also an initial provisioning, by issuing:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;vagant up guix1
vagrant ssh guix1&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&quot;re-configure-vm-s-on-the-basis-of-your-needs&quot;&gt;(Re)configure vm(s) on the basis of your needs&lt;/h2&gt;&lt;p&gt;Both the box and the dependent virtual machines can be reconfigured as usual by &lt;code&gt;guix system reconfigure&lt;/code&gt; in the guest
or even remounting the original virtual disk (or any of the &lt;code&gt;vmdk&lt;/code&gt; copies cloned by Vagrant) as previously done, then
re-issuing a &lt;code&gt;system init&lt;/code&gt; with a new Guile configuration. Note that the same &lt;code&gt;reconfigure&lt;/code&gt; can also be run as described
&lt;a href=&quot;https://guix.gnu.org/manual/devel/en/html_node/Chrooting-into-an-existing-system.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;in the manual&lt;/a&gt;.&lt;/p&gt;&lt;h2 id=&quot;missing-features-in-vagrant-to-support-guix&quot;&gt;Missing features in Vagrant to support Guix&lt;/h2&gt;&lt;p&gt;Vagrant needs to recognize the installed system in order to perform a few operations, but unfortunately that is still not the
case for Guix. Specifically, that prevents the capability of halting the system, which is not exactly a nice thing. That must
be done manually by running &lt;code&gt;halt&lt;/code&gt; within an ssh session. For the same reason, Vagrant is not able to fully configure networking,
so the second network interface shown in the previous &lt;code&gt;Vagrantfile&lt;/code&gt; needs to be configured manually by adding a suitable
&lt;code&gt;static-networking-service-type&lt;/code&gt; section to the Guile configuration.&lt;/p&gt;&lt;p&gt;A suitable support would need to be added as a proper
&lt;a href=&quot;https://developer.hashicorp.com/vagrant/docs/plugins/guests&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;vagrant plugin&lt;/a&gt;
as in the case of other operating systems and distributions.
So, good but not good enough, maybe it is matter for another post, even if I'm not exactly a Ruby language fan.&lt;/p&gt;&lt;p&gt;In the meantime, have a good time by upping and destroying Vagrant Guix boxes.&lt;/p&gt;</content></entry><entry><title>The Guix system, take two</title><id>https://lovergine.com/the-guix-system-take-two.html</id><author><name>Francesco P. Lovergine</name><email>mbox@lovergine.com</email></author><updated>2024-09-02T20:00:00Z</updated><link href="https://lovergine.com/the-guix-system-take-two.html" rel="alternate" /><content type="html">&lt;p&gt;Let's give a second look at &lt;code&gt;Guix-the-system&lt;/code&gt; the main GNU Project distribution
I dealt with in &lt;a href=&quot;http://lovergine.com/an-initial-dive-into-guix.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;a previous
post&lt;/a&gt;.  This post is not
specifically limited to the distribution, it is also of interest when using Guix
in a foreign distribution, even if some configuration details change.&lt;/p&gt;&lt;h2 id=&quot;substitutes-and-grafts&quot;&gt;Substitutes and grafts&lt;/h2&gt;&lt;p&gt;As said previously, the daily use of a store-based rolling distribution adds
some overhead to the system at both upgrade and installation time. This pain
(that remembers me the old times of the source-based &lt;a href=&quot;https://gentoo.org&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Gentoo
distribution&lt;/a&gt; with its &lt;code&gt;emerge&lt;/code&gt; tool) is specifically
alleviated by the use of the so-called &lt;code&gt;substitutes servers&lt;/code&gt;, which provide
pre-built binaries for the base system, as well as alternative/unofficial
packages, too.&lt;/p&gt;&lt;p&gt;The &lt;em&gt;fall-back&lt;/em&gt; alternative is based on regular build-from-sources on the host
system, which could imply long times for both installations and distribution
upgrades. The official Guix system comes with a couple of official substitutes
(i.e., &lt;code&gt;ci.guix.gnu.org&lt;/code&gt; and &lt;code&gt;bordeaux.guix.gnu.org&lt;/code&gt;) but others can be added,
including possibly any suitable user's server in the LAN.&lt;/p&gt;&lt;p&gt;Another trick in Guix for alleviating the need for long &lt;em&gt;local&lt;/em&gt; rebuilds is the
use of &lt;em&gt;grafts&lt;/em&gt; that are sort of &lt;em&gt;in-place&lt;/em&gt; replacements for binary
dependencies, expressed at the source level. To explain in brief, if a package &lt;code&gt;A@1&lt;/code&gt;
has been replaced by &lt;code&gt;A@2&lt;/code&gt; and they both maintain the same ABI, any &lt;em&gt;reverse
dependency&lt;/em&gt; &lt;code&gt;B&lt;/code&gt; can avoid being rebuilt. This is called a &lt;em&gt;graft&lt;/em&gt; in Guix, and
greatly simplifies the long chains of forced rebuilds in many cases (for
instance, in case of security upgrades). Specifically, the &lt;code&gt;@&lt;/code&gt; in a Guix package
is the version separator.&lt;/p&gt;&lt;h2 id=&quot;a-monorepo-for-the-whole-distribution&quot;&gt;A monorepo for the whole distribution&lt;/h2&gt;&lt;p&gt;The Guix source archive is strictly based on &lt;code&gt;git&lt;/code&gt; and distributed development by
means of a &lt;a href=&quot;https://en.wikipedia.org/wiki/Monorepo&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;monorepo&lt;/a&gt;,
which, along with the need to represent the tree of dependencies for any
package and its updates at run-time require some operations that are specific
of the Guix package management approach:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;pulling&lt;/li&gt;&lt;li&gt;garbage collection&lt;/li&gt;&lt;li&gt;branching&lt;/li&gt;&lt;li&gt;using channels&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;The pull phase specifically could require ages (hours on my old low-end Asus
EEEpc), so it is an operation that should be applied typically in batch mode and quite often
in order to minimize execution times. It is not a potentially destructive
operation - similar to an &lt;code&gt;apt update&lt;/code&gt; with steroids - so it is better
to perform it quite often, every few days. At the end of the day, it does not
alter the status of the system, so it is safe enough for background execution.&lt;/p&gt;&lt;p&gt;The &lt;code&gt;gc&lt;/code&gt; operation works directly on the store to purge &lt;em&gt;obsolete&lt;/em&gt; (out of
the current status tree of dependencies) entries. If you jump to a past status,
the purge would impact bandwidth and CPU loads, of course.&lt;/p&gt;&lt;p&gt;The &lt;code&gt;branch&lt;/code&gt; specification has the same role as any sane distributed
environment organization of code. It is usable to pull from separate branches of
archives, instead of following the default one, &lt;code&gt;latest&lt;/code&gt;. This feature can be
paired with the Guix &lt;em&gt;time-machine&lt;/em&gt; to jump to any past tree of packages in the
chronology of the archive sources.&lt;/p&gt;&lt;p&gt;Finally, a &lt;em&gt;channel&lt;/em&gt; is simply an alternative archive of sources that is prepared
by third-party teams to integrate the official Guix one. For instance, a few independent
packages are offered by &lt;a href=&quot;https://www.inria.fr/en&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;INRIA&lt;/a&gt; and other institutions for
&lt;a href=&quot;https://hpc.guix.info/about/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;the HPC community&lt;/a&gt;, as well as an handful of non-free
packages hosted on &lt;a href=&quot;https://gitlab.com/nonguix/nonguix&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;the nonguix repository&lt;/a&gt; to
solve the well-known users-hostages' dilemma about using closed-source firmwares
and a few other proprietary stuff.&lt;/p&gt;&lt;h2 id=&quot;one-scheme-to-rule-them-all&quot;&gt;One Scheme to Rule Them All&lt;/h2&gt;&lt;p&gt;An exciting feature of Guix-the-System is the use of &lt;a href=&quot;https://www.gnu.org/software/guile/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Guile&lt;/a&gt;
to describe the whole system, including the core, all services, and even users.
In perspective, all installed packages could be also fully configured by using functional
Guile snippets of code. This is something currently done in Debian only in
a limited way, through &lt;code&gt;debconf templates&lt;/code&gt; and &lt;code&gt;dpkg selections&lt;/code&gt;.
In practice, today, one has to use &lt;code&gt;ansible&lt;/code&gt; or similar tools to declare
configurations in some &lt;em&gt;ad hoc&lt;/em&gt; DSL, using
tons of plugins and templates, case by case. In a word, it is a mess.&lt;/p&gt;&lt;p&gt;This is, at least for me, the most intriguing feature and open exciting possibilities.&lt;/p&gt;&lt;p&gt;Currently, any developer with a reasonably decent computer can easily use Guix to rebuild and customize
Guix itself by starting from a monorepo fork, changing its main configuration and
adding/modifying packages in a totally independent and self-consistent way. Something that
in traditional distributions is done by a plethora of tools and interfaces, written in multiple
generale-purpose or specific languages, and often not wholly documented and held together
with the glue.&lt;/p&gt;&lt;p&gt;Once added a layer of general-purpose configurators for common packages the
whole distribution generation could become fully autoconsistent and complete for
any host or set of boxes. Isn't that challenging?&lt;/p&gt;&lt;h2 id=&quot;guix-in-foreign-distributions&quot;&gt;Guix in foreign distributions&lt;/h2&gt;&lt;p&gt;Using Guix as an additional package manager in a foreign distribution
has more limitations, of course. First of all, one must
deal with &lt;code&gt;systemd&lt;/code&gt; as the typical init system. Therefore, the general
configuration of the host cannot be expressed in a synthetic way as a
Scheme script. That said, it is perfectly possible to use Guix as
a development environment for multiple languages ecosystems, thanks
to various Guile build modules. Even, it is possible to run Guix-the-system
in a &lt;em&gt;container&lt;/em&gt; (or a &lt;em&gt;virtual machine&lt;/em&gt;), to use the host system just as a basic
platform and create Guix-based services and applications on top.&lt;/p&gt;&lt;p&gt;But those will be the topics for other posts...&lt;/p&gt;&lt;h2 id=&quot;references&quot;&gt;References&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;https://guix.gnu.org/manual/en/html_node/Substitutes.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://guix.gnu.org/manual/en/html_node/Substitutes.html&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;https://guix.gnu.org/en/blog/2020/grafts-continued/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://guix.gnu.org/en/blog/2020/grafts-continued/&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;https://guix.gnu.org/en/manual/devel/en/html_node/Managing-Patches-and-Branches.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://guix.gnu.org/en/manual/devel/en/html_node/Managing-Patches-and-Branches.html&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;https://guix.gnu.org/manual/en/html_node/Complex-Configurations.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://guix.gnu.org/manual/en/html_node/Complex-Configurations.html&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;https://www.futurile.net/2023/05/01/guix-publish-caching-substitution-server/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://www.futurile.net/2023/05/01/guix-publish-caching-substitution-server/&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;</content></entry><entry><title>An initial dive into Guix</title><id>https://lovergine.com/an-initial-dive-into-guix.html</id><author><name>Francesco P. Lovergine</name><email>mbox@lovergine.com</email></author><updated>2024-08-18T19:00:00Z</updated><link href="https://lovergine.com/an-initial-dive-into-guix.html" rel="alternate" /><content type="html">&lt;p&gt;In the last few days, I got familiar with &lt;code&gt;Guix&lt;/code&gt;, which is both a modern package
management system and the main GNU Project distribution for Linux and Hurd (&lt;code&gt;the Guix system&lt;/code&gt;).
As a package management system, it can be installed on most &lt;em&gt;foreign distributions&lt;/em&gt;,
including Debian and any other, as an alternative/additional packaging system.&lt;/p&gt;&lt;p&gt;I both installed the Guix system natively on a small ancient laptop of mine
(an ASUS EEEpc 1215N), and
the Guix package manager on one of my Debian stable boxes. An interesting variant could
be installing the whole system under a container in a non-interactive
mode, but that may be a task for the future. Indeed, the last one could
be the most exciting application of Guix for reproducible deployment.&lt;/p&gt;&lt;h2 id=&quot;guix-the-package-manager&quot;&gt;Guix, the package manager&lt;/h2&gt;&lt;p&gt;Guix (the package management system) is the most interesting part. It is a &lt;em&gt;modern&lt;/em&gt;
system with multiple advanced features, inspired by &lt;a href=&quot;https://nixos.wiki/wiki/Nix_package_manager&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Nix&lt;/a&gt;,
a pre-existing system based on a JSON-based DSL.
Nix and Guix are both declarative and functional package managers with similar goals
for software maintenance.&lt;/p&gt;&lt;p&gt;Both of them declare to have the largest collection of FOSS packages in the world, but ok:
both currently have &lt;em&gt;hubs&lt;/em&gt; with tens of thousands of binary packages.
Maybe not the largest, but respectful.
Of course, Guix is an FSF project and therefore highly choosy about the software
that can be distributed within the Guix archives. That's not specifically different
from the Debian approach, but for the derogation that historically the Debian Project
considered for limited proprietary-but-distributable stuff (the non-free+contrib section).&lt;/p&gt;&lt;p&gt;One interesting aspect of Guix (at least for me) is that it is specifically
based on Guile, an extendable Scheme dialect which is the main DSL used in the GNU ecosystem.
All packages are expressed as small snippets of Guile functions that declare
pre-dependencies, as well as the build, installation and test phases of each software.&lt;/p&gt;&lt;p&gt;Anyone who has worked on software packaging in Debian from the beginning knows that
the mythical &lt;code&gt;debian/rules&lt;/code&gt; is essentially a &lt;em&gt;Makefile&lt;/em&gt; with steroids, accompanied
by a handful of declarative files, lately simplified by the use of some frameworks,
such as &lt;a href=&quot;https://joeyh.name/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Joey Hess's&lt;/a&gt; &lt;code&gt;debhelper&lt;/code&gt; or others commonly used
in the past. Maybe not the most elegant approach to packaging and configuring, let me say.
Probably at the time - 30 years ago or so - the most pragmatic one, for sure. And it worked even for a lot of years.&lt;/p&gt;&lt;p&gt;In respect with traditional system-wide packaging, the Nix/Guix approach has several
interesting features:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;transitional, per-user, multi-profile capabilities&lt;/li&gt;&lt;li&gt;a rolling-back capability at the system and user level&lt;/li&gt;&lt;li&gt;an all-in-one system of packing with dependencies&lt;/li&gt;&lt;li&gt;a single expressive way of defining software configurations at both system-wide and per-user levels&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Guix &lt;em&gt;per se&lt;/em&gt; adds the use of Guile to all the rest so that all configurations are
synthetically expressed in S-exp, without the need to learn yet another DSL to
describe the software chains of dependencies.&lt;/p&gt;&lt;h2 id=&quot;guix-the-system&quot;&gt;Guix, the system&lt;/h2&gt;&lt;p&gt;The Guix free-software-only system has some interesting characteristics, including the use
of &lt;code&gt;shepherd&lt;/code&gt; as an alternative Guile-based &lt;em&gt;init system&lt;/em&gt; and the rolling-on distribution
style. The non-FHS basic organization of the filesystem could also pose some problems
to install software that are strictly dependent on that, that's for sure a good reason
to use Guix-on-Debian instead of Guix-the-system only. That issue is also partially mitigated
by a combination of a container technology support, and an FHS emulation layer.&lt;/p&gt;&lt;p&gt;In my opinion, the whole thing is quite interesting for building development environments
and exploring reproducible deployment systems.&lt;/p&gt;&lt;h2 id=&quot;the-gnu-touch&quot;&gt;The GNU touch&lt;/h2&gt;&lt;p&gt;But for the FSF strictly free approach to collecting software (including the missing firmware blobs
for the Linux-libre software, as for Debian until version 12), the Guix system has some typical
geek-only pillars for its ecosystem and community:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;strictly read the reference manuals and info files (i.e., do your homework)&lt;/li&gt;&lt;li&gt;use mailing lists&lt;/li&gt;&lt;li&gt;use IRC dedicated channels&lt;/li&gt;&lt;li&gt;use your brain and experience to solve issues&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Nothing different from the traditional Debian project community and approach to personal computing.
Therefore, nowadays something for geeky folk mainly, I guess.&lt;/p&gt;&lt;h2 id=&quot;issues-and-challenges&quot;&gt;Issues and challenges&lt;/h2&gt;&lt;p&gt;For sure, the user workflow to install and run software changes radically and in a very
different manner. One has the need to get familiar the Guix CLI interface and mode of operations.
The Guix approach to deployment and maintenance adds an evident overhead to the system
(for both storage and CPUs), partially
mitigated by the use of substitutes/hubs to reduce building from source requirements.
Not the best thing for old boxes, I guess.&lt;/p&gt;&lt;p&gt;Anyway, it is possible to use local &lt;em&gt;substitutes&lt;/em&gt; to reduce the load for
average systems. As a rolling distribution and/or software hub, I found it reasonably updated, but
that largely depends on applications and domains. Nobody makes miracles in those regards,
&lt;em&gt;DebianGis&lt;/em&gt; packages in &lt;em&gt;testing/unstable&lt;/em&gt; are more up-to-date for geospatial apps,
and probably even more flexible. Sorry, no silver bullet, guys.
Even Guix does not have (still?) a dedicated security team, so I would recommend it currently
only for personal/development use, not for servers.&lt;/p&gt;&lt;p&gt;An important feature of Guix is its support for reproducible software deployment, as an
alternative/integration to the ubiquitous containers, an aspect to deeply explore.&lt;/p&gt;&lt;h2 id=&quot;references&quot;&gt;References&lt;/h2&gt;&lt;p&gt;The main resources about Guix are &lt;a href=&quot;https://guix.gnu.org/manual/en/html_node/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;the Reference Manual&lt;/a&gt;
and &lt;a href=&quot;https://guix.gnu.org/en/cookbook/en/html_node/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;The Cookbook&lt;/a&gt;, of course.
I found some interesting non-trivial articles about Guix and its internals on some &lt;em&gt;indie sites&lt;/em&gt;
here listed:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;https://systemcrafters.net/craft-your-system-with-guix/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://systemcrafters.net/craft-your-system-with-guix/&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;https://www.futurile.net/archives.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://www.futurile.net/archives.html&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;https://github.com/techenthusiastsorg/awesome-guix&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://github.com/techenthusiastsorg/awesome-guix&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;https://hpc.guix.info/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://hpc.guix.info/&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;</content></entry><entry><title>Rebuild process running</title><id>https://lovergine.com/rebuild-process-running.html</id><author><name>Francesco P. Lovergine</name><email>mbox@lovergine.com</email></author><updated>2024-07-04T19:00:00Z</updated><link href="https://lovergine.com/rebuild-process-running.html" rel="alternate" /><content type="html">&lt;p&gt;&lt;em&gt;A long time ago, in a galaxy far, far away...&lt;/em&gt; I used to have a personal home
page hosted somewhere. That was one of many other side projects of my life.  I
discovered some years ago that having multiple failed side projects along the
way is a common experience for geeks and for many non-geek people, too. For
reasons that are still not completely clear to me, some months ago, I decided
that restarting a personal website in 2024 could be a not so weird idea.&lt;/p&gt;&lt;p&gt;One of the motivations is probably connected to the general idea that abandoning
corporate social networks and regaining possession of our digital identities is
nowadays the way to go. The &lt;a href=&quot;https://en.wikipedia.org/wiki/IndieWeb&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;indieweb&lt;/a&gt;
is a return to the original idea of the World Wide Web and a duty of all of us
geeks of the early days of the Internet.&lt;/p&gt;&lt;p&gt;For the same reason, the only social network I'm now actively using
is &lt;a href=&quot;https://floss.social/@gisgeek&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Mastodon&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;That said, blogging could be a challenging activity for me, I rarely think my
casual thoughts are deep and interesting enough to be good for a public
exposure. I generally prefer to focalize on activities that require more
time and efforts than a few minutes to write down a draft note. But anyway,
let me start and see how it will go in the next months.&lt;/p&gt;&lt;p&gt;In the next few sections I'll dial with how I created this system and what
are my goals for the next short future.&lt;/p&gt;&lt;h2 id=&quot;jamstack&quot;&gt;Jamstack&lt;/h2&gt;&lt;p&gt;First of all, I decided almost immediately to run a &lt;a href=&quot;https://jamstack.org/what-is-jamstack/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;em&gt;jamstack system&lt;/em&gt;&lt;/a&gt; for
generating static pages starting from simple text documents. Such kind of
system is more than enough for my purpose and even for a lot of web sites
out there that instead use &lt;a href=&quot;https://wordpress.org/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Wordpress&lt;/a&gt; or other exotic &lt;a href=&quot;ihttps://en.wikipedia.org/wiki/Content_management_system&quot;&gt;content management
systems&lt;/a&gt; with a
&lt;a href=&quot;https://en.wikipedia.org/wiki/Database#Database_management_system&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;DBMS&lt;/a&gt;.&lt;/p&gt;&lt;h2 id=&quot;lisp-and-scheme&quot;&gt;Lisp and Scheme&lt;/h2&gt;&lt;p&gt;Once decided for a &lt;em&gt;jamstack&lt;/em&gt; the possible choices are embarrassingly
numerous, but as a few people could know, I always prefer by age and inclination
unconventional &lt;em&gt;niche&lt;/em&gt; solutions for my personal stuff. So, why not taking in
consideration a family of languages that last year I decided to go in detail
and never touched before? That would be the perfect occasion to motivate myself
into such study.&lt;/p&gt;&lt;h2 id=&quot;guile-and-haunt&quot;&gt;Guile and Haunt&lt;/h2&gt;&lt;p&gt;Fortunately, the possibile choices for a jamstack application is much more
restricted, and I soon focalized on the &lt;em&gt;GNU Guile&lt;/em&gt; dialect of Scheme
and the &lt;a href=&quot;https://dthompson.us/projects/haunt.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Haunt blogging application&lt;/a&gt; by
&lt;a href=&quot;https://dthompson.us/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;David Thompson&lt;/a&gt;. In just a couple of hours I managed to
bootstrap all required modules and scripts to create a working system. Great!&lt;/p&gt;&lt;h2 id=&quot;so-what&quot;&gt;So what?&lt;/h2&gt;&lt;p&gt;The following posts and work will probably be concentrated on refinements of the styling
and code, but at least I finalized an initial version of this new blog to write
about... what? Well, I'm a techie and researcher in Earth Observation and remote
sensing of the environment, with a special interest in geospatial technologies at large,
so some topics will be obvious. For all the rest, who knows? Have a look to my
haunt from time to time, it could be interesting...&lt;/p&gt;</content></entry></feed>