<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>emacs &amp;mdash; csantosb</title>
    <link>https://infosec.press/csantosb/tag:emacs</link>
    <description>Random thoughts</description>
    <pubDate>Wed, 13 May 2026 21:31:07 +0000</pubDate>
    <item>
      <title>on writting freely</title>
      <link>https://infosec.press/csantosb/on-writting-freely</link>
      <description>&lt;![CDATA[img br/&#xA;Putting new ideas in community, exchanging opinions, replying to someone&#39;s else impressions, sharing public experiences, showing feelings about modern way of living, writing down notes on what’s going on from one’s side ... So many interesting and useful content around to share. The question is, how to do so simply and without complications ? How not to expend way too much time messing with tooling ? Is it yet possible to concentrate on what really matters, contents ? Here I summarize the way I’ve found to contribute to this blog, which fits best with my workflow. !--more-- br/&#xA;&#xA;the what&#xA;&#xA;First and foremost, for the requirements. br/&#xA;In my case, the requisites are simple, even if hard to get when one thinks about. br/&#xA;I need a distracting free environment to concentrate on what really matters: the content I’m willing to share. For sure, I do need to remain within my working environment, that’s to say, #emacs. I need to switch context quickly between any current activity and writing prose when something comes up; while writing, I need to stay focus. Similarly, I want to switch back to previous context when the writing is complete. No doubt, I need to complete previous posts when I have something new to include or to correct, so I need a means of retrieving previous posts quickly. Needless to say, I need a #freesoftware tool I may tune to my needs, fixing issues or including new features. br/&#xA;Last, but not least, I privilege a way to push remotely without complicated compilations of anything at all: a couple of keystrokes, and the post is sent online under its right form, including some markup and images. Updating previous versions if necessary should be that simple too, and I must be able to check the rendering with any web browser, included eww under emacs, so no javascript or fancy stuff involved. That’s it by now. br/&#xA;Easy, right ? br/&#xA;&#xA;the how&#xA;&#xA;My current choice goes for writefreely as an open, decentralized and free alternative to web publishing on the web, which concentrates on providing a simple reading experience. This solution may be self-hosted, but there are also some friendly communities around helping out. Infosec.press is one of them. Blog posts show up in the #fediverse under the (platform) user account, so that they are easy to follow. Server side, this is more than what I need. br/&#xA;But, client side ?, you must be asking. To write text, I’m using #orgmode, with all of its facilities, and not the markdown supported by default by the platform. Then, writefreely.el takes care of exporting contents, handling the data exchange with the server through the provided api. I had to fix a couple of issues before, mostly trivial side effects. This is one of the biggest advantages of #freesoftware, having the possibility to contribute to bug fixing, improving a common. br/&#xA;As for the question on how to access the blog contents locally, I opt for a different #plaintext file by blog ticket, that I manipulate as any other #orgroam node. Orgroam allows to quickly retrieve, manipulate and insert as links previous notes. When I type the name of a non-existing note, it creates a new one for me, based on a custom template which incorporates the necessary headings, title, tags and the like. It resuls in something like: br/&#xA;&#xA;:PROPERTIES:&#xA;:ID:       ID-6dd1-45d7-a70e-ae5c99c2797a&#xA;:END:&#xA;+TITLE: on writting freely&#xA;+OPTIONS: toc:nil -:nil \n:t&#xA;+LINK: srht https://repo/pics/%s&#xA;+filetags: :tag1:tag2:&#xA;a comment&#xA;[[srht:image.png]]&#xA;Donec neque quam, dignissim in, mollis nec, sagittis eu, wisi ... !--more--&#xA;Nunc eleifend leo vitae magna.&#xA;&#xA;You’ll figure it out. br/&#xA;Remains the question of images: just simply, they are hosted on an unlisted git repository, from where they are fetched. Now, with my working environment and with a couple of keys, I may pop up a new buffer, write some content, then publish, delete or update a new article within seconds, checking the results with #eww, all without leaving #emacs. You’ll get a set of local variables append to you buffer when you publish for the first time, something like br/&#xA;&#xA;Local Variables:&#xA;writefreely-post-id: &#34;ID&#34;&#xA;writefreely-post-token: nil&#xA;End:&#xA;&#xA;which allows to retrieve the post online afterwards. br/&#xA;Put the whole under #git control, and the perfect blogging setup is ready for you to enjoy writing ! Simple, elegant and efficient. br/&#xA;Finally, I have packaged writefreely.el and sent a patch to #guix so that it will hopefully get merged upstream soon. br/]]&gt;</description>
      <content:encoded><![CDATA[<p><img src="https://git.sr.ht/~csantosb/csbwiki/blob/master/pics/writefreely.png" alt="img"> <br/>
Putting new ideas in community, exchanging opinions, replying to someone&#39;s else impressions, sharing public experiences, showing feelings about modern way of living, writing down notes on what’s going on from one’s side ... So many interesting and useful content around to share. The question is, how to do so simply and without complications ? How not to expend way too much time messing with tooling ? Is it yet possible to concentrate on what really matters, contents ? Here I summarize the way I’ve found to contribute to this blog, which fits best with my workflow.  <br/></p>

<h1 id="the-what">the what</h1>

<p>First and foremost, for the requirements. <br/>
In my case, the requisites are simple, even if hard to get when one thinks about. <br/>
I need a distracting free environment to concentrate on what really matters: the content I’m willing to share. For sure, I do need to remain within my working environment, that’s to say, <a href="https://infosec.press/csantosb/use-emacs" rel="nofollow"><a href="/csantosb/tag:emacs" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">emacs</span></a></a>. I need to switch context quickly between any current activity and writing prose when something comes up; while writing, I need to stay focus. Similarly, I want to switch back to previous context when the writing is complete. No doubt, I need to complete previous posts when I have something new to include or to correct, so I need a means of retrieving previous posts quickly. Needless to say, I need a <a href="/csantosb/tag:freesoftware" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">freesoftware</span></a> tool I may tune to my needs, fixing issues or including new features. <br/>
Last, but not least, I privilege a way to <a href="https://infosec.press/csantosb" rel="nofollow">push remotely</a> without complicated compilations of anything at all: a couple of keystrokes, and the post is sent online under its right form, including some markup and images. Updating previous versions if necessary should be that simple too, and I must be able to check the rendering with any web browser, included <a href="https://www.gnu.org/software/emacs/manual/html_mono/eww.html" rel="nofollow">eww</a> under emacs, so no javascript or fancy stuff involved. That’s it by now. <br/>
Easy, right ? <br/></p>

<h1 id="the-how">the how</h1>

<p>My current choice goes for <a href="https://github.com/dangom/writefreely.el.git" rel="nofollow">writefreely</a> as an open, decentralized and free alternative to web publishing on the web, which concentrates on providing a simple reading experience. This solution may be self-hosted, but there are also some friendly <a href="https://writefreely.org/instances" rel="nofollow">communities</a> around helping out. <a href="https://infosec.press/about" rel="nofollow">Infosec.press</a> is one of them. Blog posts show up in the <a href="/csantosb/tag:fediverse" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">fediverse</span></a> under the (platform) user account, so that they are easy to follow. Server side, this is more than what I need. <br/>
But, client side ?, you must be asking. To write text, I’m using <a href="/csantosb/tag:orgmode" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">orgmode</span></a>, with all of its facilities, and not the markdown supported by default by the platform. Then, <a href="https://github.com/dangom/writefreely.el.git" rel="nofollow">writefreely.el</a> takes care of exporting contents, handling the data exchange with the server through the provided api. I had to fix a couple of <a href="https://github.com/dangom/writefreely.el/commits/master/" rel="nofollow">issues</a> before, mostly trivial side effects. This is one of the biggest advantages of <a href="/csantosb/tag:freesoftware" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">freesoftware</span></a>, having the possibility to contribute to bug fixing, improving a common. <br/>
As for the question on how to access the blog contents locally, I opt for a different <a href="/csantosb/tag:plaintext" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">plaintext</span></a> file by blog ticket, that I manipulate as any other <a href="/csantosb/tag:orgroam" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">orgroam</span></a> node. <a href="https://www.orgroam.com/" rel="nofollow">Orgroam</a> allows to quickly retrieve, manipulate and insert as links previous notes. When I type the name of a non-existing note, it creates a new one for me, based on a custom template which incorporates the necessary headings, title, tags and the like. It resuls in something like: <br/></p>

<pre><code class="language-text">:PROPERTIES:
:ID:       ID-6dd1-45d7-a70e-ae5c99c2797a
:END:
#+TITLE: on writting freely
#+OPTIONS: toc:nil -:nil \n:t
#+LINK: srht https://repo/pics/%s
#+filetags: :tag1:tag2:
# a comment
[[srht:image.png]]
Donec neque quam, dignissim in, mollis nec, sagittis eu, wisi ... &lt;!--more--&gt;
Nunc eleifend leo vitae magna.
</code></pre>

<p>You’ll figure it out. <br/>
Remains the question of images: just simply, they are hosted on an unlisted git repository, from where they are fetched. Now, with my working environment and with a couple of keys, I may pop up a new buffer, write some content, then publish, delete or update a new article within seconds, checking the results with <a href="/csantosb/tag:eww" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">eww</span></a>, all without leaving <a href="/csantosb/tag:emacs" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">emacs</span></a>. You’ll get a set of local variables append to you buffer when you publish for the first time, something like <br/></p>

<pre><code class="language-text"># Local Variables:
# writefreely-post-id: &#34;ID&#34;
# writefreely-post-token: nil
# End:
</code></pre>

<p>which allows to retrieve the post online afterwards. <br/>
Put the whole under <a href="/csantosb/tag:git" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">git</span></a> control, and the perfect blogging setup is ready for you to enjoy writing ! Simple, elegant and efficient. <br/>
Finally, I have <a href="https://issues.guix.gnu.org/74704" rel="nofollow">packaged writefreely.el</a> and sent a patch to <a href="/csantosb/tag:guix" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">guix</span></a> so that it will hopefully get merged upstream soon. <br/></p>
]]></content:encoded>
      <guid>https://infosec.press/csantosb/on-writting-freely</guid>
      <pubDate>Sun, 08 Dec 2024 19:12:30 +0000</pubDate>
    </item>
    <item>
      <title>about</title>
      <link>https://infosec.press/csantosb/about</link>
      <description>&lt;![CDATA[---&#xA;&#xA;Curious about everything br/&#xA;#FreeSoftware and computer science #freedom as a basic right br/&#xA;Doing public #research in France br/&#xA;Using #emacs, what else ? br/&#xA;&#xA;---&#xA;&#xA;sr.ht ◦ cv-fr ◦ cv-hal ◦ orcid ◦ bibtex ◦ gitlab.com ◦ perso br/]]&gt;</description>
      <content:encoded><![CDATA[<hr>

<p>Curious about everything <br/>
<a href="/csantosb/tag:FreeSoftware" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">FreeSoftware</span></a> and computer science <a href="/csantosb/tag:freedom" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">freedom</span></a> as a basic right <br/>
Doing public <a href="/csantosb/tag:research" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">research</span></a> in France <br/>
Using <a href="/csantosb/tag:emacs" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">emacs</span></a>, what else ? <br/></p>

<hr>

<p><a href="https://sr.ht/~csantosb" rel="nofollow">sr.ht</a> ◦ <a href="https://csantosb-cv.gitlab.io/cv-fr" rel="nofollow">cv-fr</a> ◦ <a href="https://cv.hal.science/csantosb" rel="nofollow">cv-hal</a> ◦ <a href="https://orcid.org/0000-0003-3565-4234" rel="nofollow">orcid</a> ◦ <a href="https://git.sr.ht/~csantosb/referenceslibrary/blob/master/csb.bib" rel="nofollow">bibtex</a> ◦ <a href="https://gitlab.com/csantosb" rel="nofollow">gitlab.com</a> ◦ <a href="https://infosec.press/ideas/acerca-de-a-propos" rel="nofollow">perso</a> <br/></p>
]]></content:encoded>
      <guid>https://infosec.press/csantosb/about</guid>
      <pubDate>Sun, 01 Dec 2024 20:15:20 +0000</pubDate>
    </item>
    <item>
      <title>guix crash course</title>
      <link>https://infosec.press/csantosb/guix-crash-course</link>
      <description>&lt;![CDATA[img br/&#xA;Guix reveals as a practical means of handling dependencies. However, the amount of information available to start using it may appear as a bit overwhelming for a beginner, letting the feeling of a tool reserved to a reduced community or experts. Far from that. Here you’ll find everything you need to get started with guix, with a light touch on using it for #modernhw. !--more-- br/&#xA;We will concentrate in the use of #guix as an external package manager on top of a #linux distribution based on #systemd. We’ll let aside using and referring to #guixsystem as a full operating system by itself (which I never used anyway). This way, in the context of #modernhw, we may keep on using our favorite tools, environment and workflow. As an addition, we have everything that guix provides at our disposal, without affecting our local packages configuration: guix acts as an extra layer on top of our current OS, without any interference with it. You’ll have the possibility to install any guix software, remove it afterward or make use of the fancy features guix has to offer, without your host OS ever noticing what’s going on. br/&#xA;All what follows is roughly based on the guix reference manual and the guix cookbook, so refer to them for more on depth explanations. This article is strongly influenced by my personal experience as a daily driver, so next topics are necessarily biased towards my own needs. br/&#xA;There is much more to say about guix, but this is just an introductory crash course, right ? br/&#xA;&#xA;install&#xA;&#xA;First things first. You need to be root to proceed to a binary guix installation. Just download the installer, and follow the instructions. br/&#xA;After that, you’ll be using guix as a regular user, and all what follows must be run without any special rights beyond accessing to your home directory. Behind the curtains, guix computes what’s necessary through the running guix daemon, handled by your host’s systemd. br/&#xA;&#xA;packages&#xA;&#xA;Packages are built definitions. At no surprise, they are installed (or removed) with br/&#xA;&#xA;guix search synthesis&#xA;guix install yosys&#xA;guix remove python&#xA;&#xA;Definitions, in turn, are guile descriptions on how and where to obtain code source, a precise and unambiguous reference to it, how to process and how to install it, along with the necessary input dependencies, its kind, and how to use them. Definitions may be seen as customized default build templates, which avoids complicated package definitions, simplifying its design. Thus, a default build template called python-build-system exist, for example, for producing python packages. A package definition customizes the way this template is used, modifying its default package, source, etc. fields. br/&#xA;Definitions are built on isolated, minimalistic environments. Once built, packages are deposit in the guix store under /gnu/store. Each package is given a unique hash: changing the definition, or any of its inputs, produces a different package and hash. This is what usually is referred to as functional package management of #dependencies. br/&#xA;A package may have multiple outputs (out, by default, but also doc, etc.). Packages are built locally following the package definition. To avoid long run times and wasting cpu cycles, guix introduces substitutes or pre-built packages available on remote (substitute) servers. When available, substitutes are downloaded, which avoids having to built packages locally. Otherwise, your local computing resources will be put to contribution, which is far from ideal, so better configure your substitute servers before anything else (check your systemd guix-daemon file). It is possible to verify substitute availability with br/&#xA;&#xA;guix weather ghdl-clang&#xA;&#xA;  https://guix.bordeaux.inria.fr ☀&#xA;--  100.0 % des substituts sont disponibles (1 sur 1)  &lt;--&#xA;    6,2 Mio de fichiers nar (compressés)&#xA;    39,6 Mio sur le disque (décompressé)&#xA;    0,777 secondes par requête (0,8 secondes en tout)&#xA;    1,3 requêtes par seconde&#xA;&#xA;It is crucial to understand that a given package built will be identical to any other build of this same package, regardless of the host computer, which is what holds the validity of the very idea of substitutes, and guarantees #reproducibility. This holds for any guix construction, including shell containers (see below). br/&#xA;Keep that in mind. br/&#xA;&#xA;profiles and generations&#xA;&#xA;After first install, guix will create on your behalf a default profile under ~/.guix-profile. All operations (install, remove) will affect this profile, unless you decide to point somewhere else (with the modifier -p $GUIXPROFILE). br/&#xA;&#xA;guix package -p $GUIXPROFILE --list-installed&#xA;&#xA;coreutils       9.1     out     /gnu/store/fk39d3y3zyr6ajyzy8d6ghd0sj524cs5-coreutils-9.1&#xA;git             2.46.0  out     /gnu/store/wyhw9f49kvc7qvbsbfgm09lj0cpz1wlb-git-2.46.0&#xA;fw-open-logic   3.0.1   out     /gnu/store/hrgdvswmvqcyai4pqmr7df0kpyyak94j-fw-open-logic-3.0.1&#xA;osvvm-scripts   2024.09 out     /gnu/store/xhxr3y1k8838my6mfk992kn392pwszjm-osvvm-scripts-2024.09&#xA;osvvm-uart      2024.09 out     /gnu/store/x3pjf95h8p3mbcx4zxb6948xfq3y3vg8-osvvm-uart-2024.09&#xA;fd              9.0.0   out     /gnu/store/nx0hz1y3g7iyi4snyza7rl5600z73xyn-fd-9.0.0&#xA;make            4.4.1   out     /gnu/store/963iman5zw7zdf128mqhklihvjh6habm-make-4.4.1&#xA;tcllib          1.19    out     /gnu/store/443vgrmwac1mvipyhin5jblsml9lplxf-tcllib-1.19&#xA;tcl             8.6.12  out     /gnu/store/w2icygvc0h294bzak0dyfafq649sdqvn-tcl-8.6.12&#xA;ghdl-clang      4.1.0   out     /gnu/store/sy0ryysxwbkzj6gpfka20fs27knmgmkd-ghdl-clang-4.1.0&#xA;&#xA;Each profile generation will consist on a set of symbolic links pointing to /gnu/store. A new generation is produced when you install or remove something. This will only redefine your profile’s links, and so the status of the profile (and the packages you have access to). Generations are roughly the equivalent of #git commits, if this helps. They are nothing but collections of links pointing to the store, where packages are installed. Each collection defines a generation and so the current status of a guix profile. br/&#xA;You may roll back to previous generations, or move forward, but only linear generation histories are allowed. In you go back n generations, and then create a new one, your previous history is lost. br/&#xA;&#xA;guix package -p $GUIXPROFILE --list-generations&#xA;&#xA;In addition to creating links, a profile redefines the environment variables (following the profle contents), appending, prepending or replacing the current ones. This way, the user enters an augmented context, having access to the packages in the profile. br/&#xA;Note that, inside a profile, the user still have access to the external system: for example, the PATH env variable is augmented with the profile bin directory, but former binaries are still there. To get a higher degree of isolation, we need shell containers (see below). br/&#xA;&#xA;clean&#xA;&#xA;From time to time, don’t forget to clean the store, removing stuff no profile and generation is pointing to, with br/&#xA;&#xA;guix gc&#xA;&#xA;Before that, remove old generations from your profiles, unless you plan to make use of them at some point. br/&#xA;&#xA;upgrade&#xA;&#xA;Upgrade guix current profile with br/&#xA;&#xA;guix pull &amp;&amp; guix upgrade&#xA;&#xA;This will create a new generation in your default profile, including updates to all your packages in current profile. Pulling syncs local guix with remote guix repository, fetching updates locally. Upgrade will deploy these updates to your profile. br/&#xA;Remember also to br/&#xA;&#xA;sudo -i guix pull&#xA;sudo systemctl daemon-reload&#xA;sudo systemctl restart guix-daemon&#xA;&#xA;to upgrade the system daemon, so that it is never too delayed with respect to your guix in use. br/&#xA;&#xA;manifest, channels&#xA;&#xA;If not already clear from the previous, remember that it is possible to replicate environments (contexts, profiles, dependencies) using a couple of #plaintext files. br/&#xA;First, the #manifest.scm, which includes the list of packages in the environment. As an example, export your current profile with br/&#xA;&#xA;guix package -p $GUIXPROFILE --export-manifest   manifest.scm&#xA;&#xA;Put it somewhere under version control, and replicate your environment somewhere else with br/&#xA;&#xA;guix package -p $GUIXPROFILE -m manifest.scm&#xA;&#xA;That’s all it takes to get exactly the same development context in another host, for example. br/&#xA;But you’re right, I see you follow. This is not enough. You also need to freeze which guix version you’re using (guix, as any other package manager, not always installs the same version of some package). You need also a #channels.scm file. It may be produced with br/&#xA;&#xA;guix describe --format=channels -p $GUIXPROFILE   channels.scm&#xA;&#xA;and includes the list of channels in use, along with a hash to identify which version of the channels to use, among the whole history of channel revisions (the #git commit of the channel repository). Then, import it somewhere else with br/&#xA;&#xA;guix pull -C channels.scm&#xA;&#xA;examples&#xA;&#xA;Fixing your channels, its revision and the list of packages is all you need to eliminate any ambiguity, achieving #reproducibility and #determinism. Remember that this is the best advantage of guix, after all. Say you publish something (report, article, paper, blog ticket). If you provide a git repository with these two files, anyone else will be br/&#xA;able, hopefully, to replicate your asserts. br/&#xA;As a typical example, when you have a complex #vhdl design, including a large set of dependencies, you need a means to handle them. Here, we assume the #dependencies may be vhdl compilers, tcl shells, python interpreters, unit testing libraries, verification frameworks. etc. ... but also other vhdl modules, each in its own git repository. br/&#xA;At this point, you’ll need, first, to fix your channels.scm to &#34;freeze&#34; the repositories status. Here we are using, for example, the electronics, guix-science and guix channels, each in a fix release given by a commit hash. br/&#xA;&#xA;(list (channel&#xA;       (name &#39;electronics)&#xA;       (url &#34;https://git.sr.ht/~csantosb/guix.channel-electronics&#34;)&#xA;       (branch &#34;main&#34;)&#xA;       (commit&#xA;        &#34;2cad57b4bb35cc9250a7391d879345b75af4ee0a&#34;)&#xA;       (introduction&#xA;        (make-channel-introduction&#xA;         &#34;ba1a85b31202a711d3e3ed2f4adca6743e0ecce2&#34;&#xA;         (openpgp-fingerprint&#xA;          &#34;DA15 A1FC 975E 5AA4 0B07  EF76 F1B4 CAD1 F94E E99A&#34;))))&#xA;      (channel&#xA;       (name &#39;guix-science)&#xA;       (url &#34;https://codeberg.org/guix-science/guix-science.git&#34;)&#xA;       (branch &#34;master&#34;)&#xA;       (commit&#xA;        &#34;1ced1b3b913b181e274ca7ed2239d6661c5154c9&#34;)&#xA;       (introduction&#xA;        (make-channel-introduction&#xA;         &#34;b1fe5aaff3ab48e798a4cce02f0212bc91f423dc&#34;&#xA;         (openpgp-fingerprint&#xA;          &#34;CA4F 8CF4 37D7 478F DA05  5FD4 4213 7701 1A37 8446&#34;))))&#xA;      (channel&#xA;       (name &#39;guix)&#xA;       (url &#34;https://git.savannah.gnu.org/git/guix.git&#34;)&#xA;       (branch &#34;master&#34;)&#xA;       (commit&#xA;        &#34;3e2442de5268782213b04048463fcbc5d76accd7&#34;)&#xA;       (introduction&#xA;        (make-channel-introduction&#xA;         &#34;9edb3f66fd807b096b48283debdcddccfea34bad&#34;&#xA;         (openpgp-fingerprint&#xA;          &#34;BBB0 2DDF 2CEA F6A8 0D1D  E643 A2A0 6DF2 A33A 54FA&#34;)))))&#xA;&#xA;Then, you need the list of dependencies necessary to your design. These are provided in a manifest.scm file, as for example in br/&#xA;&#xA;(specifications-  manifest&#xA; (list &#34;ghdl-clang&#34;&#xA;       &#34;tcl&#34;&#xA;       &#34;tcllib&#34;&#xA;       &#34;make&#34;&#xA;       &#34;python-vunit&#34;&#xA;       &#34;osvvm-uart&#34;&#xA;       &#34;osvvm-scripts&#34;&#xA;       &#34;fw-open-logic&#34;&#xA;       &#34;git&#34;&#xA;       &#34;which&#34;&#xA;       &#34;findutils&#34;&#xA;       &#34;coreutils&#34;))&#xA;&#xA;One may include these two files in the design, in a different testing #git branch, for example. Then, all it takes to run your design in a reproducible way is cloning the design git repository, checking out the testing branch, and running #guix time machine (see next) to replicate a local profile containing all the design’s dependencies. Remember that here we include also all third party firmware modules instantiated in our design. br/&#xA;&#xA;time machine&#xA;&#xA;How guix guarantees that it is possible to reproduce a profile in the future ? The trick consist on asking current guix version to call a previous guix version (the one we define), to deploy the profile with the packages we need. br/&#xA;For example: let&#39;s ask guix-5 to make use of guix-4 to install emacs-30 package, which is only available in the guix-4 repositories, whereas guix-5 only provides emacs-32. br/&#xA;This mechanism is called time-machine. It is used as, for example: br/&#xA;&#xA;guix time-machine --channels=channels.scm -- package -p $GUIXPROFILE -m manifest.scm&#xA;&#xA;Here, up-to-date guix uses time machine to roll back to the former guix version defined in channels.scm. Then, former guix calls the package command to install under $GUIXPROFILE the list of packages defined in the manifest.scm file. br/&#xA;What’s important to understand here is that this will produce exactly the same output regardless of the host and the point in time when we run this command. The profile we produce is always the same, by design. And this is what is relevant for #modernhw. br/&#xA;&#xA;shell containers&#xA;&#xA;Guix includes a command to create independent environments from the rest of our host system. This provides an increased degree of isolation when compared to profiles, as the later lie on top of, and only augment, our current shell. Shell containers create a new, almost empty by default, minimalistic context for us to install packages. br/&#xA;&#xA;guix shell --container --link-profile --emulate-fhs coreutils which python-vunit osvvm-uart&#xA;guix shell --container --link-profile --emulate-fhs -m manifest.scm&#xA;&#xA;or, if one needs determinism br/&#xA;&#xA;guix time-machine --channels=channels.scm -- shell --container --link-profile --emulate-fhs -m manifest.scm&#xA;&#xA;The --link-profile flag will link the contents of $GUIXPROFILE under /gnu/store to ~/.guix-profile. br/&#xA;The --emulate-fs will, well, reproduce the standard file system under /, as some packages expect this layout and fail otherwise. br/&#xA;coreutils and which packages will be helpful, otherwise, not even ls command is present within the container. Minimalistic, I said. I should have use isolated instead. br/&#xA;&#xA;packs&#xA;&#xA;Great. But. What if guix is not around ? How do I use it in a cluster, or in another host where guix is not yet available ? How do I distribute my dependencies, environments, etc. to a non-yet-guix-user ? No problem, guix pack is intended to be used as a simple way of &#34;packaging&#34; guix contexts (understood as a set of packages), deploying them afterward in a target host. This is next step after profiles and shell containers. br/&#xA;Guix pack comes equipped with several different backends, producing contexts in the most habitual and useful formats. For example, the following command will pack #emacs, #ghdl and #yosys for you to use where you need it. br/&#xA;&#xA;guix pack -f docker emacs ghdl-clang yosys&#xA;&#xA;In the context of #modernhw, #docker images may be used for #ci tests, uploading the image to a remote #gitforge registry; #apptainer containers can be sent and run in a #hpc cluster; .tar.gz compresses files are a clean may of installing non-existing software in a remote machine. Furthermore, one has the possibility of packaging all the project #dependencies in a manifest.scm file, and distribute it along with the source code to anyone willing to use it. No instructions about the proper environment to run the project, no complicated installation of dependencies. Stop asking third party users in your README to handle your dependencies for you. br/&#xA;A simple docker pull pointing to a #forge image repository is enough when guix is not locally available. Long run times ? Use a #forge #ci custom runner in your own hardware with your #singularity image. Remote work to an #ssh server with obsolete software ? Pack, send and untar your favorite development tools and create a custom profile, no admin rights needed. The possibilities are endless. br/&#xA;And most important: the advantage of this approach over a classical docker or singularity files for producing the images is #reproducibility: every single time you build the image, you’ll get the exact same binary product. Use the --save-provenance flag to store in the image itself the manifest you used to create it. br/&#xA;Good luck trying to achieve the same with a docker file. br/&#xA;&#xA;importing&#xA;&#xA;Now, guix is not a universal tool for installing anything around. What about this obscure #python package no one uses but you ? You’d absolutely need this #emacs package you just found on #codeberg which guix doesn’t provide. Rust, go ... There are plenty of pieces of code around not being yet packaged along with guix. No problem. Guix incorporates a simple and elegant way of extending the amount of packages you’ll be able to install. Just import them. br/&#xA;&#xA;guix import pypi itsdangerous&#xA;guix import crate becareful&#xA;guix import gem wow&#xA;&#xA;Previous commands will issue a new package definition corresponding to a package already handled by the language own package manager. #Dependencies, you say ? Use the --recursive flag. Once you have the definition, you’ll be able to build, install and use the corresponding package. br/&#xA;Check in the documentation the surprising amount of backends available, you’ll be gratefully surprised. br/&#xA;&#xA;software heritage&#xA;&#xA;Last, but not least. br/&#xA;You have guix, its package definitions and all the fancy tools which come along. But. What if you don’t have access to the source code ? In this case, all the previous becomes meaningless: remember that guix is a fully bootstrapped distribution, being built from the very bottom up. Building a package from its source means having access to the source, which most of the time is hosted in a #gitforge. But #forges disappear, especially proprietary ones, repositories relocate or are just obsoleted and get replaced. br/&#xA;In this case, guix gets you covered by falling back to Software Heritage (#SH). This initiative, with support of the UNESCO, collects, preserves, and shares the source code of all software that is publicly available, including its full development history. The collection is trigger automatically by a crawler, manually with a browser plugin or by guix itself when developers lint package definitions. br/&#xA;If, in ten years, you try to replicate one of your papers, and you plan to recreate your environment to run your code and reproduce your plots, you won’t be bothered by nowadays python 3.10 having being obsoleted, abandon and buried in history of computers by #guile. SH keeps a copy for you to sleep better at night. br/&#xA;&#xA;channels&#xA;&#xA;Channels, as a feature to extend guix repository of definitions, deserve its own chapter. br/]]&gt;</description>
      <content:encoded><![CDATA[<p><img src="https://git.sr.ht/~csantosb/blog.csantosb/blob/master/pics/guix-crash-course.png" alt="img"> <br/>
Guix reveals as a <a href="https://infosec.press/csantosb/use-guix" rel="nofollow">practical means</a> of handling <a href="https://infosec.press/csantosb/on-dependencies" rel="nofollow">dependencies</a>. However, the amount of information available to start using it may appear as a bit overwhelming for a beginner, letting the feeling of a tool reserved to a reduced community or experts. Far from that. Here you’ll find everything you need to get started with <a href="https://guix.gnu.org/" rel="nofollow">guix</a>, with a light touch on using it for <a href="/csantosb/tag:modernhw" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">modernhw</span></a>.  <br/>
We will concentrate in the use of <a href="/csantosb/tag:guix" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">guix</span></a> as an external package manager on top of a <a href="/csantosb/tag:linux" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">linux</span></a> distribution based on <a href="/csantosb/tag:systemd" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">systemd</span></a>. We’ll let aside using and referring to <a href="/csantosb/tag:guixsystem" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">guixsystem</span></a> as a full operating system by itself (which I never used anyway). This way, in the context of <a href="/csantosb/tag:modernhw" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">modernhw</span></a>, we may keep on using our favorite tools, environment and workflow. As an addition, we have everything that guix provides at our disposal, without affecting our local packages configuration: guix acts as an extra layer on top of our current OS, without any interference with it. You’ll have the possibility to install any guix software, remove it afterward or make use of the fancy features guix has to offer, without your host OS ever noticing what’s going on. <br/>
All what follows is roughly based on the <a href="https://guix.gnu.org/manual/en/html_node/index.html" rel="nofollow">guix reference manual</a> and the <a href="https://guix.gnu.org/cookbook/en/guix-cookbook.html" rel="nofollow">guix cookbook</a>, so refer to them for more on depth explanations. This article is strongly influenced by my personal experience as a daily driver, so next topics are necessarily biased towards my own needs. <br/>
There is <a href="https://www.futurile.net/resources/guix/" rel="nofollow">much more to say</a> about guix, but this is just an introductory crash course, right ? <br/></p>

<h1 id="install">install</h1>

<p>First things first. You need to be root to proceed to a <a href="https://guix.gnu.org/manual/en/html_node/Binary-Installation.html" rel="nofollow">binary guix installation</a>. Just download the installer, and follow the instructions. <br/>
After that, you’ll be using guix as a regular user, and all what follows must be run without any special rights beyond accessing to your home directory. Behind the curtains, guix computes what’s necessary through the running guix daemon, handled by your host’s systemd. <br/></p>

<h1 id="packages">packages</h1>

<p>Packages are built definitions. At no surprise, they are installed (or removed) with <br/></p>

<pre><code class="language-sh">guix search synthesis
guix install yosys
guix remove python
</code></pre>

<p><a href="https://guix.gnu.org/cookbook/en/html_node/A-_0060_0060Hello-World_0027_0027-package.html" rel="nofollow">Definitions</a>, in turn, are <a href="https://guix.gnu.org/cookbook/en/html_node/A-Scheme-Crash-Course.html" rel="nofollow">guile</a> descriptions on how and where to obtain code source, a precise and unambiguous reference to it, how to process and how to install it, along with the necessary input dependencies, its kind, and how to use them. Definitions may be seen as customized default <a href="https://guix.gnu.org/manual/en/html_node/Build-Systems.html" rel="nofollow">build templates</a>, which avoids complicated package definitions, simplifying its design. Thus, a default build template called <code>python-build-system</code> exist, for example, for producing python packages. A package definition customizes the way this template is used, modifying its default package, source, etc. fields. <br/>
Definitions are built on isolated, minimalistic environments. Once built, packages are deposit in the guix store under <code>/gnu/store</code>. Each package is given a unique hash: changing the definition, or any of its inputs, produces a different package and hash. This is what usually is referred to as <a href="https://arxiv.org/abs/1305.4584" rel="nofollow">functional package management</a> of <a href="/csantosb/tag:dependencies" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">dependencies</span></a>. <br/>
A package may have multiple outputs (<code>out</code>, by default, but also <code>doc</code>, etc.). Packages are built locally following the package definition. To avoid long run times and wasting cpu cycles, guix introduces <a href="https://guix.gnu.org/manual/en/html_node/Substitutes.html" rel="nofollow">substitutes</a> or pre-built packages available on remote (substitute) servers. When available, substitutes are downloaded, which avoids having to built packages locally. Otherwise, your local computing resources will be put to contribution, which is far from ideal, so better configure your substitute servers before anything else (check your systemd <code>guix-daemon</code> file). It is possible to verify substitute availability with <br/></p>

<pre><code class="language-sh">guix weather ghdl-clang
</code></pre>

<pre><code class="language-sh">  https://guix.bordeaux.inria.fr ☀
--&gt; 100.0 % des substituts sont disponibles (1 sur 1)  &lt;--
    6,2 Mio de fichiers nar (compressés)
    39,6 Mio sur le disque (décompressé)
    0,777 secondes par requête (0,8 secondes en tout)
    1,3 requêtes par seconde
</code></pre>

<p>It is <strong>crucial</strong> to understand that <em>a given package built will be identical to any other build of this same package</em>, regardless of the host computer, which is what holds the validity of the very idea of substitutes, and guarantees <a href="/csantosb/tag:reproducibility" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">reproducibility</span></a>. This holds for any guix construction, including shell containers (see below). <br/>
Keep that in mind. <br/></p>

<h1 id="profiles-and-generations">profiles and generations</h1>

<p>After first install, guix will create on your behalf a default profile under <code>~/.guix-profile</code>. All operations (install, remove) will affect this profile, unless you decide to point somewhere else (with the modifier <code>-p $GUIX_PROFILE</code>). <br/></p>

<pre><code class="language-sh">guix package -p $GUIX_PROFILE --list-installed
</code></pre>

<pre><code class="language-sh">coreutils       9.1     out     /gnu/store/fk39d3y3zyr6ajyzy8d6ghd0sj524cs5-coreutils-9.1
git             2.46.0  out     /gnu/store/wyhw9f49kvc7qvbsbfgm09lj0cpz1wlb-git-2.46.0
fw-open-logic   3.0.1   out     /gnu/store/hrgdvswmvqcyai4pqmr7df0kpyyak94j-fw-open-logic-3.0.1
osvvm-scripts   2024.09 out     /gnu/store/xhxr3y1k8838my6mfk992kn392pwszjm-osvvm-scripts-2024.09
osvvm-uart      2024.09 out     /gnu/store/x3pjf95h8p3mbcx4zxb6948xfq3y3vg8-osvvm-uart-2024.09
fd              9.0.0   out     /gnu/store/nx0hz1y3g7iyi4snyza7rl5600z73xyn-fd-9.0.0
make            4.4.1   out     /gnu/store/963iman5zw7zdf128mqhklihvjh6habm-make-4.4.1
tcllib          1.19    out     /gnu/store/443vgrmwac1mvipyhin5jblsml9lplxf-tcllib-1.19
tcl             8.6.12  out     /gnu/store/w2icygvc0h294bzak0dyfafq649sdqvn-tcl-8.6.12
ghdl-clang      4.1.0   out     /gnu/store/sy0ryysxwbkzj6gpfka20fs27knmgmkd-ghdl-clang-4.1.0
</code></pre>

<p>Each profile generation will consist on a set of symbolic links pointing to <code>/gnu/store</code>. A new generation is produced when you install or remove something. This will only redefine your profile’s links, and so the status of the profile (and the packages you have access to). Generations are roughly the equivalent of <a href="/csantosb/tag:git" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">git</span></a> commits, if this helps. They are nothing but collections of links pointing to the store, where packages are installed. Each collection defines a generation and so the current status of a guix profile. <br/>
You may roll back to previous generations, or move forward, but only linear generation histories are allowed. In you go back n generations, and then create a new one, your previous history is lost. <br/></p>

<pre><code class="language-sh">guix package -p $GUIX_PROFILE --list-generations
</code></pre>

<p>In addition to creating links, a profile redefines the environment variables (following the profle contents), appending, prepending or replacing the current ones. This way, the user enters an augmented context, having access to the packages in the profile. <br/>
Note that, inside a profile, the user still have access to the external system: for example, the PATH env variable is augmented with the profile bin directory, but former binaries are still there. To get a higher degree of isolation, we need shell containers (see below). <br/></p>

<h1 id="clean">clean</h1>

<p>From time to time, don’t forget to clean the store, removing stuff no profile and generation is pointing to, with <br/></p>

<pre><code class="language-sh">guix gc
</code></pre>

<p>Before that, remove old generations from your profiles, unless you plan to make use of them at some point. <br/></p>

<h1 id="upgrade">upgrade</h1>

<p>Upgrade guix current profile with <br/></p>

<pre><code class="language-sh">guix pull &amp;&amp; guix upgrade
</code></pre>

<p>This will create a new generation in your default profile, including updates to all your packages in current profile. <code>Pulling</code> syncs local guix with remote guix repository, fetching updates locally. <code>Upgrade</code> will deploy these updates to your profile. <br/>
Remember also to <br/></p>

<pre><code class="language-sh">sudo -i guix pull
sudo systemctl daemon-reload
sudo systemctl restart guix-daemon
</code></pre>

<p>to upgrade the system daemon, so that it is never too delayed with respect to your guix in use. <br/></p>

<h1 id="manifest-channels">manifest, channels</h1>

<p>If not already clear from the previous, remember that it is possible to <a href="https://guix.gnu.org/manual/en/html_node/Replicating-Guix.html" rel="nofollow">replicate</a> environments (contexts, profiles, dependencies) using a couple of <a href="/csantosb/tag:plaintext" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">plaintext</span></a> files. <br/>
First, the <code>#manifest.scm</code>, which includes the list of packages in the environment. As an example, export your current profile with <br/></p>

<pre><code class="language-sh">guix package -p $GUIX_PROFILE --export-manifest &gt; manifest.scm
</code></pre>

<p>Put it somewhere under version control, and replicate your environment somewhere else with <br/></p>

<pre><code class="language-sh">guix package -p $GUIX_PROFILE -m manifest.scm
</code></pre>

<p>That’s all it takes to get exactly the same development context in another host, for example. <br/>
But you’re right, I see you follow. This is not enough. You also need to freeze which guix version you’re using (guix, as any other package manager, not always installs the same version of some package). You need also a <code>#channels.scm</code> file. It may be produced with <br/></p>

<pre><code class="language-sh">guix describe --format=channels -p $GUIX_PROFILE &gt; channels.scm
</code></pre>

<p>and includes the list of <a href="https://infosec.press/csantosb/guix-channels" rel="nofollow">channels</a> in use, along with a hash to identify <em>which version</em> of the channels to use, among the whole history of channel revisions (the <a href="/csantosb/tag:git" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">git</span></a> commit of the channel repository). Then, import it somewhere else with <br/></p>

<pre><code class="language-sh">guix pull -C channels.scm
</code></pre>

<h2 id="examples">examples</h2>

<p>Fixing your channels, its revision and the list of packages is all you need to eliminate any ambiguity, achieving <a href="/csantosb/tag:reproducibility" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">reproducibility</span></a> and <a href="/csantosb/tag:determinism" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">determinism</span></a>. Remember that this is the best advantage of guix, after all. Say you publish something (report, article, paper, blog ticket). If you provide a git repository with these two files, anyone else will be <br/>
able, hopefully, to replicate your asserts. <br/>
As a typical example, when you have a complex <a href="/csantosb/tag:vhdl" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">vhdl</span></a> design, including <a href="https://infosec.press/csantosb/on-dependencies" rel="nofollow">a large set of dependencies</a>, you need a means to handle them. Here, we assume the <a href="/csantosb/tag:dependencies" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">dependencies</span></a> may be vhdl compilers, tcl shells, python interpreters, unit testing libraries, verification frameworks. etc. ... but also other vhdl modules, each in its own git repository. <br/>
At this point, you’ll need, first, to fix your <code>channels.scm</code> to “freeze” the repositories status. Here we are using, for example, the <a href="https://git.sr.ht/~csantosb/guix.channel-electronics" rel="nofollow">electronics</a>, <a href="https://git.sr.ht/~csantosb/guix.channel-electronics" rel="nofollow">guix-science</a> and guix channels, each in a fix release given by a commit hash. <br/></p>

<pre><code class="language-scheme">(list (channel
       (name &#39;electronics)
       (url &#34;https://git.sr.ht/~csantosb/guix.channel-electronics&#34;)
       (branch &#34;main&#34;)
       (commit
        &#34;2cad57b4bb35cc9250a7391d879345b75af4ee0a&#34;)
       (introduction
        (make-channel-introduction
         &#34;ba1a85b31202a711d3e3ed2f4adca6743e0ecce2&#34;
         (openpgp-fingerprint
          &#34;DA15 A1FC 975E 5AA4 0B07  EF76 F1B4 CAD1 F94E E99A&#34;))))
      (channel
       (name &#39;guix-science)
       (url &#34;https://codeberg.org/guix-science/guix-science.git&#34;)
       (branch &#34;master&#34;)
       (commit
        &#34;1ced1b3b913b181e274ca7ed2239d6661c5154c9&#34;)
       (introduction
        (make-channel-introduction
         &#34;b1fe5aaff3ab48e798a4cce02f0212bc91f423dc&#34;
         (openpgp-fingerprint
          &#34;CA4F 8CF4 37D7 478F DA05  5FD4 4213 7701 1A37 8446&#34;))))
      (channel
       (name &#39;guix)
       (url &#34;https://git.savannah.gnu.org/git/guix.git&#34;)
       (branch &#34;master&#34;)
       (commit
        &#34;3e2442de5268782213b04048463fcbc5d76accd7&#34;)
       (introduction
        (make-channel-introduction
         &#34;9edb3f66fd807b096b48283debdcddccfea34bad&#34;
         (openpgp-fingerprint
          &#34;BBB0 2DDF 2CEA F6A8 0D1D  E643 A2A0 6DF2 A33A 54FA&#34;)))))

</code></pre>

<p>Then, you need the list of dependencies necessary to your design. These are provided in a <code>manifest.scm</code> file, as for example in <br/></p>

<pre><code class="language-scheme">(specifications-&gt;manifest
 (list &#34;ghdl-clang&#34;
       &#34;tcl&#34;
       &#34;tcllib&#34;
       &#34;make&#34;
       &#34;python-vunit&#34;
       &#34;osvvm-uart&#34;
       &#34;osvvm-scripts&#34;
       &#34;fw-open-logic&#34;
       &#34;git&#34;
       &#34;which&#34;
       &#34;findutils&#34;
       &#34;coreutils&#34;))
</code></pre>

<p>One may include these two files in the design, in a different <code>testing</code> <a href="/csantosb/tag:git" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">git</span></a> branch, for example. Then, all it takes to run your design in a reproducible way is cloning the design git repository, checking out the <code>testing</code> branch, and running <a href="/csantosb/tag:guix" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">guix</span></a> time machine (see next) to replicate a local profile containing all the design’s dependencies. Remember that here we include also all third party firmware modules instantiated in our design. <br/></p>

<h1 id="time-machine">time machine</h1>

<p>How guix guarantees that it is possible to reproduce a profile in the future ? The trick consist on asking current guix version to call a previous guix version (the one we define), to deploy the profile with the packages we need. <br/>
For example: let&#39;s ask guix-5 to make use of guix-4 to install emacs-30 package, which is only available in the guix-4 repositories, whereas guix-5 only provides emacs-32. <br/>
This mechanism is called time-machine. It is used as, for example: <br/></p>

<pre><code class="language-sh">guix time-machine --channels=channels.scm -- package -p $GUIX_PROFILE -m manifest.scm
</code></pre>

<p>Here, up-to-date guix uses time machine to roll back to the former guix version defined in <code>channels.scm</code>. Then, former guix calls the <code>package</code> command to install under <code>$GUIX_PROFILE</code> the list of packages defined in the <code>manifest.scm</code> file. <br/>
What’s important to understand here is that this will produce exactly the same output regardless of the host and the point in time when we run this command. The profile we produce is always the same, by design. And <em>this is what is relevant for <a href="/csantosb/tag:modernhw" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">modernhw</span></a></em>. <br/></p>

<h1 id="shell-containers">shell containers</h1>

<p>Guix includes a command to create independent environments from the rest of our host system. This provides an increased degree of isolation when compared to profiles, as the later lie on top of, and only augment, our current shell. Shell containers create a new, almost empty by default, minimalistic context for us to install packages. <br/></p>

<pre><code class="language-sh">guix shell --container --link-profile --emulate-fhs coreutils which python-vunit osvvm-uart
guix shell --container --link-profile --emulate-fhs -m manifest.scm
</code></pre>

<p>or, if one needs determinism <br/></p>

<pre><code class="language-sh">guix time-machine --channels=channels.scm -- shell --container --link-profile --emulate-fhs -m manifest.scm
</code></pre>

<p>The <code>--link-profile</code> flag will link the contents of <code>$GUIX_PROFILE</code> under <code>/gnu/store</code> to <code>~/.guix-profile</code>. <br/>
The <code>--emulate-fs</code> will, well, reproduce the standard file system under <code>/</code>, as some packages expect this layout and fail otherwise. <br/>
<code>coreutils</code> and <code>which</code> packages will be helpful, otherwise, not even <code>ls</code> command is present within the container. Minimalistic, I said. I should have use isolated instead. <br/></p>

<h1 id="packs">packs</h1>

<p>Great. But. What if guix is not around ? How do I use it in a cluster, or in another host where guix is not yet available ? How do I distribute my dependencies, environments, etc. to a non-yet-guix-user ? No problem, <code>guix pack</code> is intended to be used as a <a href="https://guix.gnu.org/manual/en/html_node/Invoking-guix-pack.html" rel="nofollow">simple way</a> of “packaging” guix contexts (understood as a set of packages), deploying them afterward in a target host. This is next step after profiles and shell containers. <br/>
Guix pack comes equipped with several different backends, producing contexts in the most habitual and useful formats. For example, the following command will pack <a href="/csantosb/tag:emacs" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">emacs</span></a>, <a href="/csantosb/tag:ghdl" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">ghdl</span></a> and <a href="/csantosb/tag:yosys" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">yosys</span></a> for you to use where you need it. <br/></p>

<pre><code class="language-sh">guix pack -f docker emacs ghdl-clang yosys
</code></pre>

<p>In the context of <a href="/csantosb/tag:modernhw" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">modernhw</span></a>, <a href="/csantosb/tag:docker" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">docker</span></a> images may be used for <a href="/csantosb/tag:ci" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">ci</span></a> tests, uploading the image to a remote <a href="/csantosb/tag:gitforge" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">gitforge</span></a> registry; <a href="/csantosb/tag:apptainer" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">apptainer</span></a> containers can be sent and run in a <a href="/csantosb/tag:hpc" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">hpc</span></a> cluster; .tar.gz compresses files are a clean may of installing non-existing software in a remote machine. Furthermore, one has the possibility of packaging all the project <a href="/csantosb/tag:dependencies" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">dependencies</span></a> in a <code>manifest.scm</code> file, and distribute it along with the source code to anyone willing to use it. No instructions about the proper environment to run the project, no complicated installation of dependencies. <em>Stop asking third party users in your README to handle <strong>your dependencies</strong> for you</em>. <br/>
A simple <code>docker pull</code> pointing to a <a href="/csantosb/tag:forge" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">forge</span></a> image repository is enough when guix is not locally available. Long run times ? Use a <a href="/csantosb/tag:forge" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">forge</span></a> <a href="/csantosb/tag:ci" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">ci</span></a> custom runner in your own hardware with your <a href="/csantosb/tag:singularity" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">singularity</span></a> image. Remote work to an <a href="/csantosb/tag:ssh" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">ssh</span></a> server with obsolete software ? Pack, send and untar your favorite development tools and create a custom profile, no admin rights needed. The possibilities are endless. <br/>
And most important: the advantage of this approach over a classical docker or singularity files for producing the images is <a href="/csantosb/tag:reproducibility" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">reproducibility</span></a>: every single time you build the image, you’ll get the exact same binary product. Use the <code>--save-provenance</code> flag to store in the image itself the manifest you used to create it. <br/>
Good luck trying to achieve the same with a docker file. <br/></p>

<h1 id="importing">importing</h1>

<p>Now, guix is not a universal tool for installing anything around. What about this obscure <a href="/csantosb/tag:python" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">python</span></a> package no one uses but you ? You’d absolutely need this <a href="/csantosb/tag:emacs" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">emacs</span></a> package you just found on <a href="/csantosb/tag:codeberg" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">codeberg</span></a> which guix doesn’t provide. Rust, go ... There are plenty of pieces of code around not being yet packaged along with guix. No problem. Guix incorporates a simple and elegant way of extending the amount of packages you’ll be able to install. Just <a href="https://guix.gnu.org/manual/en/html_node/Invoking-guix-import.html" rel="nofollow">import them</a>. <br/></p>

<pre><code class="language-sh">guix import pypi itsdangerous
guix import crate becareful
guix import gem wow
</code></pre>

<p>Previous commands will issue a new package definition corresponding to a package already handled by the language own package manager. <a href="/csantosb/tag:Dependencies" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Dependencies</span></a>, you say ? Use the <code>--recursive</code> flag. Once you have the definition, you’ll be able to build, install and use the corresponding package. <br/>
Check in the <a href="https://guix.gnu.org/manual/en/html_node/Invoking-guix-import.html" rel="nofollow">documentation</a> the surprising amount of backends available, you’ll be gratefully surprised. <br/></p>

<h1 id="software-heritage">software heritage</h1>

<p>Last, but not least. <br/>
You have guix, its package definitions and all the fancy tools which come along. But. What if you don’t have access to the source code ? In this case, all the previous becomes meaningless: remember that guix is a fully bootstrapped distribution, <a href="https://infosec.press/csantosb/use-guix" rel="nofollow">being built from the very bottom up</a>. Building a package from its source means having access to the source, which most of the time is hosted in a <a href="/csantosb/tag:gitforge" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">gitforge</span></a>. But <a href="/csantosb/tag:forges" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">forges</span></a> disappear, especially proprietary ones, repositories relocate or are just obsoleted and get replaced. <br/>
In this case, guix gets you covered by falling back to <a href="https://www.softwareheritage.org/2019/04/18/software-heritage-and-gnu-guix-join-forces-to-enable-long-term-reproducibility/" rel="nofollow">Software Heritage</a> (<a href="/csantosb/tag:SH" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">SH</span></a>). This initiative, <a href="https://www.unesco.org/en/articles/celebrating-software-source-code-digital-heritage" rel="nofollow">with support of the UNESCO</a>, collects, preserves, and shares the source code of all software that is publicly available, including its full development history. The collection is trigger automatically by a crawler, manually with a <a href="https://www.softwareheritage.org/browser-extensions/" rel="nofollow">browser plugin</a> or by guix itself when developers lint package definitions. <br/>
If, in ten years, you try to replicate one of your papers, and you plan to recreate your environment to run your code and reproduce your plots, you won’t be bothered by nowadays python 3.10 having being obsoleted, abandon and buried in history of computers by <a href="/csantosb/tag:guile" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">guile</span></a>. SH keeps a copy for you to sleep better at night. <br/></p>

<h1 id="channels">channels</h1>

<p><a href="https://guix.gnu.org/manual/en/html_node/Channels.html" rel="nofollow">Channels</a>, as a feature to extend guix repository of definitions, deserve <a href="https://infosec.press/csantosb/guix-channels" rel="nofollow">its own chapter</a>. <br/></p>
]]></content:encoded>
      <guid>https://infosec.press/csantosb/guix-crash-course</guid>
      <pubDate>Fri, 29 Nov 2024 15:25:48 +0000</pubDate>
    </item>
    <item>
      <title>git</title>
      <link>https://infosec.press/csantosb/git-ytbn</link>
      <description>&lt;![CDATA[img br/&#xA;Once upon a time, in digital electronics design, we were used to moving huge zip files around including project data, code and all ancillary stuff along with it. We were doing backups, snapshots and versioning our code with help of compressed files. That’s the way it was, I knew that time, and you, young reader, would not believe me if I told you about the whole picture. This is not acceptable anymore. !--more-- br/&#xA;Today we have (well, we already did 20 years ago, but, you know, we were electronic engineers, not coding experts after all) tools to handle the situation. We have control version, we have git, and this more than we need to follow changes in our code (and our documentation, bibliography, etc.). Sure, we need a bit of discipline to use it in meaningful way, writing clear commit messages, committing correctly, creating clean histories, using the right branching model and learning how to use #git in a collaborative way. Following best practices is something that, as for today, should be accessible to any engineer, provided he is using the right tools. br/&#xA;The point here is how to interface git. In my experience, most hardware engineers (but not only) just do basic clone, push and pull, creating linear histories. Simply put, they use git as a backup system, with huge unrelated commits. They use git because they must use git, as anyone else is doing, but without any of the associated benefits. No history read, no diffs, no topic branches, no rebasing, no merging, no nothing. The reason is they’re using the command line interface (#cli) to git. Using git in the command line is fine, provided you’re fluent with clis, with a good shell and its plugins, and you have a very good long term memory. No one remembers how to interactively rebase 10 last commits on top of another branch, squashing history. Full stop. And no one will commit every 30 seconds if it takes one minute. Forget about. This brings to the clone/pull/push/that’s it step slope most people is faced to when they use git. And, unfortunately, this is the end of using git proper. br/&#xA;Now, what to do about ? #modernhw requires using a GUI to manipulate your git repositories. This will provide you with a lot of benefits, among them, a clear overview of where you are in your git history, your current status, and most importantly, where you’re going from this point. Which GUI to use ? Don’t expect an answer from me. The one you feel more comfortable with is the right choice. No matter what, provided it is #freesoftware. Spend as many time as you need mastering its usage, you’ll be rewarded afterward. br/&#xA;Personally, as I’m using #emacs, my not that original choice goes to using #magit. Magit is a front end application to the command line git, closely embedded within the rest of my workflow. As usual, once one gets used to its way of doing things, it’s really fast to perform any git operation in a few seconds. Within a few keystrokes, it is possible to get the status, log, remotes, branches and doing the difference between to different versions. It gives access to complete much more sophisticated manipulations in less time that it takes to tell about. Try to achieve the same using the command line (you will, but it will take ages). The key here is the time it takes: if you need longer to git than what it takes to think about, you’re using git the wrong way. You’ve been advised. br/]]&gt;</description>
      <content:encoded><![CDATA[<p><img src="https://git.sr.ht/~csantosb/csbwiki/blob/master/pics/git.png" alt="img"> <br/>
Once upon a time, in digital electronics design, we were used to moving huge zip files around including project data, code and all ancillary stuff along with it. We were doing backups, snapshots and versioning our code with help of compressed files. That’s the way it was, I knew that time, and you, young reader, would not believe me if I told you about the whole picture. This is not acceptable anymore.  <br/>
Today we have (well, we already did 20 years ago, but, you know, we were electronic engineers, not coding experts after all) tools to handle the situation. We have control version, we have <a href="https://git-scm.com/" rel="nofollow">git</a>, and this more than we need to follow changes in our code (and our documentation, bibliography, etc.). Sure, we need a bit of discipline to use it in meaningful way, writing clear commit messages, committing correctly, creating clean histories, using the right branching model and learning how to use <a href="/csantosb/tag:git" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">git</span></a> in a collaborative way. Following <a href="https://l2it.pages.in2p3.fr/cad/git-best-practices/" rel="nofollow">best practices</a> is something that, as for today, should be accessible to any engineer, provided he is using the right tools. <br/>
The point here is how to interface git. In my experience, most hardware engineers (but not only) just do basic clone, push and pull, creating linear histories. Simply put, they use git as a backup system, with huge unrelated commits. They use git because they must use git, as anyone else is doing, but without any of the associated benefits. No history read, no diffs, no topic branches, no rebasing, no merging, no nothing. The reason is they’re using the command line interface (<a href="/csantosb/tag:cli" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">cli</span></a>) to git. Using git in the command line is fine, provided you’re fluent with clis, with a good shell and its plugins, and you have a very good long term memory. No one remembers how to interactively rebase 10 last commits on top of another branch, squashing history. Full stop. And no one will commit every 30 seconds if it takes one minute. Forget about. This brings to the clone/pull/push/that’s it step slope most people is faced to when they use git. And, unfortunately, this is the end of using git proper. <br/>
Now, what to do about ? <a href="/csantosb/tag:modernhw" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">modernhw</span></a> requires using a GUI to manipulate your git repositories. This will provide you with a lot of benefits, among them, a clear overview of where you are in your git history, your current status, and most importantly, where you’re going from this point. Which GUI to use ? Don’t expect an answer from me. The one you feel more comfortable with is the right choice. No matter what, provided it is <a href="/csantosb/tag:freesoftware" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">freesoftware</span></a>. Spend as many time as you need mastering its usage, you’ll be rewarded afterward. <br/>
Personally, as I’m using <a href="/csantosb/tag:emacs" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">emacs</span></a>, my not that original choice goes to using <a href="/csantosb/tag:magit" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">magit</span></a>. <a href="https://magit.vc/" rel="nofollow">Magit</a> is a front end application to the command line git, closely embedded within the rest of my workflow. As usual, once one gets used to its way of doing things, it’s really fast to perform any git operation in a few seconds. Within a few keystrokes, it is possible to get the status, log, remotes, branches and doing the difference between to different versions. It gives access to complete much more sophisticated manipulations in less time that it takes to tell about. Try to achieve the same using the command line (you will, but it will take ages). The key here is the time it takes: if you need longer to git than what it takes to think about, you’re using git the wrong way. You’ve been advised. <br/></p>
]]></content:encoded>
      <guid>https://infosec.press/csantosb/git-ytbn</guid>
      <pubDate>Tue, 31 Jan 2023 23:00:00 +0000</pubDate>
    </item>
    <item>
      <title>guix channels</title>
      <link>https://infosec.press/csantosb/guix-channels</link>
      <description>&lt;![CDATA[img br/&#xA;guix includes the concept of channels, or git repositories of package definitions. This gives a chance for anyone to complete the collection of packages provided by the distribution, in case this is not enough. Keep reading for an intro on how to create your own channels, or how to use the most popular third party guix channels around. !--more-- br/&#xA;Guix itself only provides #freesoftware and #reproductible packages (no binary pre compiled blobs, then), which should be enough to most needs. Unfortunately, this is not always the case. Sometimes one needs to package #nonfree software including binary files to make work a graphic or network card, sometimes the source code of the compiler necessary to produce a package got lost somewhere in a dusty office, and cannot be found other than in a pre compiled form, impossible to bootstrap from its root. br/&#xA;Additionally, guix is not perfect (but getting closer). Even if becoming better thanks to contributions from the community, there are rough edges an lots of issues. One of the most frequent complaints is the time it takes for submitted patches to be review and accepted, if ever. This inconvenient is usually circunvented by creating a personal collection of package definitions. br/&#xA;In such situations, as in many others, package definitions may be written with help of the community (or using the guix packager !) and used normally, even if they have little chance to reach one day the main upstream guix repository (none in the case of nonfree stuff).  Where these definitions live ? In topic channels. Users have the possibility to develop their own channels and use custom packages, extending guix, while submitting patches upstream in parallel. Once the patch is merged, it may be removed from the channel. br/&#xA;&#xA;usual suspects&#xA;&#xA;Other than guix channel itself, you may have a feeling of what a guix channel looks like taking a look at the guix-science organization. In there, you’ll find collections of package definitions intended to be used in a context of specific research domains, both in its free and nonfree forms. For one reason or another, they have not their place in the main guix repository, and they live their life in here. Interesting enough, guix-past channel brings old-fashioned software to the present, which reveals useful to reproduce results older than guix itself. Another interesting examples are guixrus, by the ~whereiseveryone collective, providing packages not yet fully tested, nightly releases or alpha quality software; or the guix-hpc channel, with packages related to high performance computing; also guix-bioc, containing bioconductor packages, etc. You get the idea. br/&#xA;To include additional channels, other than the default ones, in your ~/.config/guix/channels.scm file, follow the documentation, and check with guix describe: you’ll get a list of all the channels in use next time you do a guix pull. At this point, you’ll have plenty of new packages to install at your hands ! Just remember the discussion about substitutes: some channels provide substitute servers, some not. This might be an issue, or not, depending of the computing resources necessary to build certain packages. br/&#xA;&#xA;your first personal channel&#xA;&#xA;Guix channels are simple to create and use. Just put your #guile modules, containing your package definitions, in a git repository. To use them, complete the default guix load path as in br/&#xA;&#xA;guix install -L ~/guix-channel PACKAGE&#xA;&#xA;You may opt to include this local channel into your ~/.config/guix/channels.scm file, or include the -L flag in your commands. As an alternative, guix searches for package definitions in the $GUIXPACKAGEPATH, so you may put your channel path in this variable. Remember that guix builds packages by compiling source code: no substitute server will do the job for you in this case, so plan accordingly with your local resources and patience. br/&#xA;&#xA;electronics channel&#xA;&#xA;This is about #modernhw after all, so let’s see an example more on detail, my own guix-electronics channel which complements the ./gnu/packages/electronics.scm guix module. This is the channel I’m using daily, where I include all the packages I need and doesn’t yet exist upstream. When they get merged somewhere else, I remove them from here. In the meantime, I’m a happy user of my custom packages. br/&#xA;I classify all my package definitions in #guile modules under ./electronics/packages/MODULE.scm. This is the reason why the compilers module, for example, starts by br/&#xA;&#xA;(define-module (electronics packages compilers)&#xA;&#xA;Then, proceed as usual (check the guix repo itself for inspiration), putting your packages below br/&#xA;&#xA;(define-public mypackage&#xA;  (package&#xA;    (name &#34;mypackage&#34;)&#xA;    ...&#xA;    ))&#xA;&#xA;I create a git repo, commit my changes and push it online to a #gitforge. br/&#xA;I need a .guix-channel file with the url of my channel and a version number. If the code in the channel depends on other channels other than main guix channel, one needs to specify this information in this file too.  In this case, for example, several of the package definitions include a dependency on ghdl-clang, provided by guix-science channel, so I need to declare it in here too. br/&#xA;It is also necessary a .guix-authorizations file, with the (GPG key) list of developers with right to push to this channel. This is how guix authenticates channels. Finally, it is important to create a readme file or similar where introduce the channel (first commit, signing key fingerprint). That’s it. Include the channel introduction into your ~/.config/guix/channels.scm file, and you’ll be pulling from your online guix channel. br/&#xA;&#xA;contributing&#xA;&#xA;The advantage of using a custom channel is to benefit from an increased degree of freedom when using guix, without being dependent of someone’s else time availability to consider your particular needs. Remember, guix is a huge project which follows closely the #freesoftware paradigm, and collaboration works in two directions. You take advantage of other developers contributions to guix, while you participate yourself to improving guix repositories with your package definitions, once they have been tested. br/&#xA;Take for example the list of packages in my electronics channel. I have included here utilities for #vhdl code editing under #emacs, specific to the electronic digital design field, which are not yet available in guix upstream channel. There is also a cosimulation library, #cocotb, which allows coupling #python and #ghdl to simulate a design. I have submitted a patch to include this in guix itself, similarly to python-vunit; once merged, I’ll remove them from here. br/&#xA;Some packages, like open fpga loader are now part of guix. Some others, like the gnat ada compiler and ghdl-clang stable have been merged already on guix-science, as gnat package is obtained from binaries (and so ghdl-clang is also impacted, from guix perspective). I include here a more recent ghdl-clang, non yet released, as it includes some fixes and improvements I am interested in, without having to wait until guix incorporates a new release. br/&#xA;Catch the idea ? br/&#xA;Contributing your code to guix comes to sending #email with your patches attached, it’s that simple. Dont be intimidated by the workflow (this is used by the linux project, for example). Once your patches are submitted, a review of your code folllows, see details. Some tools, like mumi, are helpful to that purpose. br/&#xA;These simple steps will allow you to start contributing to guix: br/&#xA;&#xA;git clone guix itselft br/&#xA;add and commit your changes, watch the commit message br/&#xA;don’t forget to use guix lint/style/refresh -l to check your code br/&#xA;use git send-email to create and send a patch br/&#xA;cosider reviews, if any, updating your patch accordingly with git ammend br/&#xA;resend a new patch including a patch version (v1, v2 ...) br/&#xA;&#xA;Interested ? Consult the doc for details, you’ll learn a lot about how to contribute to a common good and collaboration with other people. br/]]&gt;</description>
      <content:encoded><![CDATA[<p><img src="https://git.sr.ht/~csantosb/csbwiki/blob/master/pics/guix-crash-course.png" alt="img"> <br/>
<a href="/csantosb/tag:guix" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">guix</span></a> includes the concept of <a href="https://guix.gnu.org/manual/en/html_node/Channels.html" rel="nofollow">channels</a>, or git repositories of package definitions. This gives a chance for anyone to complete the collection of <a href="https://packages.guix.gnu.org/" rel="nofollow">packages</a> provided by the distribution, in case this is not enough. Keep reading for an intro on how to create your own channels, or how to use the most popular third party guix channels around.  <br/>
Guix itself only provides <a href="/csantosb/tag:freesoftware" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">freesoftware</span></a> and <a href="/csantosb/tag:reproductible" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">reproductible</span></a> packages (no binary pre compiled blobs, then), which should be enough to most needs. Unfortunately, this is not always the case. Sometimes one needs to package <a href="/csantosb/tag:nonfree" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">nonfree</span></a> software including binary files to make work a graphic or network card, sometimes the source code of the compiler necessary to produce a package got lost somewhere in a dusty office, and cannot be found other than in a pre compiled form, impossible to bootstrap from its root. <br/>
Additionally, guix is not perfect (but <a href="https://infosec.press/csantosb/guix-crash-course" rel="nofollow">getting closer</a>). Even if becoming better thanks to contributions from the <a href="https://guix.gnu.org/en/contact/" rel="nofollow">community</a>, there are rough edges an <a href="https://issues.guix.gnu.org/" rel="nofollow">lots of issues</a>. One of the most frequent complaints is the time it takes for submitted patches to be review and accepted, if ever. This inconvenient is usually circunvented by creating a personal collection of package definitions. <br/>
In such situations, as in many others, package definitions may be written with help of the community (or using the <a href="https://guix-hpc.gitlabpages.inria.fr/guix-packager/" rel="nofollow">guix packager</a> !) and used normally, even if they have little chance to reach one day the main upstream guix repository (none in the case of nonfree stuff).  Where these definitions live ? In topic channels. Users have the possibility to develop their own channels and use custom packages, extending guix, while <a href="https://guix.gnu.org/manual/en/html_node/Submitting-Patches.html" rel="nofollow">submitting patches upstream</a> in parallel. Once the patch is merged, it may be removed from the channel. <br/></p>

<h1 id="usual-suspects">usual suspects</h1>

<p>Other than <a href="https://hpc.guix.info/channel/guix" rel="nofollow">guix channel</a> itself, you may have a feeling of what a guix channel looks like taking a look at the <a href="https://codeberg.org/guix-science" rel="nofollow">guix-science</a> organization. In there, you’ll find collections of package definitions intended to be used in a context of specific research domains, both in its <a href="https://codeberg.org/guix-science/guix-science" rel="nofollow">free</a> and <a href="https://codeberg.org/guix-science/guix-science-nonfree" rel="nofollow">nonfree</a> forms. For one reason or another, they have not their place in the main guix repository, and they live their life in here. Interesting enough, <a href="https://codeberg.org/guix-science/guix-past" rel="nofollow">guix-past</a> channel brings old-fashioned software to the present, which reveals useful to reproduce results older than guix itself. Another interesting examples are <a href="https://sr.ht/~whereiseveryone/guixrus/" rel="nofollow">guixrus</a>, by the <a href="https://sr.ht/~whereiseveryone/" rel="nofollow">~whereiseveryone</a> collective, providing packages not yet fully tested, nightly releases or alpha quality software; or the <a href="https://hpc.guix.info/channel/guix-hpc" rel="nofollow">guix-hpc</a> channel, with packages related to high performance computing; also <a href="https://hpc.guix.info/channel/guix-bioc" rel="nofollow">guix-bioc</a>, containing bioconductor packages, etc. You get the idea. <br/>
To include additional channels, other than the default ones, in your <code>~/.config/guix/channels.scm</code> file, follow the <a href="https://guix.gnu.org/manual/en/html_node/Specifying-Additional-Channels.html" rel="nofollow">documentation</a>, and check with <code>guix describe</code>: you’ll get a list of all the channels in use next time you do a <code>guix pull</code>. At this point, you’ll have plenty of new packages to install at your hands ! Just remember the <a href="https://infosec.press/csantosb/guix-crash-course#packages" rel="nofollow">discussion</a> about substitutes: some channels provide substitute servers, some not. This might be an issue, or not, depending of the computing resources necessary to build certain packages. <br/></p>

<h1 id="your-first-personal-channel">your first personal channel</h1>

<p>Guix channels are <a href="https://guix.gnu.org/cookbook/en/html_node/Channels.html" rel="nofollow">simple to create</a> and use. Just put your <a href="/csantosb/tag:guile" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">guile</span></a> modules, containing your package definitions, in a git repository. To use them, complete the default guix load path as in <br/></p>

<pre><code class="language-sh">guix install -L ~/guix-channel PACKAGE
</code></pre>

<p>You may opt to include this local channel into your <code>~/.config/guix/channels.scm</code> file, or include the <code>-L</code> flag in your commands. As an alternative, guix searches for package definitions in the <code>$GUIX_PACKAGE_PATH</code>, so you may put your channel path in this variable. Remember that guix builds packages by compiling source code: no substitute server will do the job for you in this case, so plan accordingly with your local resources and patience. <br/></p>

<h1 id="electronics-channel">electronics channel</h1>

<p>This is about <a href="/csantosb/tag:modernhw" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">modernhw</span></a> after all, so let’s see an example more on detail, my own <a href="https://git.sr.ht/~csantosb/guix.channel-electronics" rel="nofollow">guix-electronics</a> channel which complements the <a href="https://codeberg.org/guix/guix/src/master/gnu/packages/electronics.scm" rel="nofollow">./gnu/packages/electronics.scm</a> guix module. This is the channel I’m using daily, where I include all the packages I need and doesn’t yet exist upstream. When they <a href="https://codeberg.org/csantosb/guix-science/commit/d33b748" rel="nofollow">get merged somewhere else</a>, I remove them from here. In the meantime, I’m a happy user of my custom packages. <br/>
I classify all my package definitions in <a href="/csantosb/tag:guile" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">guile</span></a> modules under <code>./electronics/packages/MODULE.scm</code>. This is the reason why the compilers module, for example, <a href="https://git.sr.ht/~csantosb/guix.channel-electronics/tree/main/electronics/packages/compilers.scm#L20" rel="nofollow">starts by</a> <br/></p>

<pre><code class="language-scheme">(define-module (electronics packages compilers)
</code></pre>

<p>Then, proceed as usual (check the guix repo itself for inspiration), putting your packages below <br/></p>

<pre><code class="language-scheme">(define-public mypackage
  (package
    (name &#34;mypackage&#34;)
    ...
    ))
</code></pre>

<p>I create a git repo, commit my changes and push it online to a <a href="/csantosb/tag:gitforge" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">gitforge</span></a>. <br/>
I need a <code>.guix-channel</code> <a href="https://git.sr.ht/~csantosb/guix.channel-electronics/tree/main/.guix-channel" rel="nofollow">file</a> with the url of my channel and a version number. If the code in the channel <a href="https://guix.gnu.org/manual/en/html_node/Declaring-Channel-Dependencies.html" rel="nofollow">depends on other channels</a> other than main guix channel, one needs to specify this information in this file too.  In this case, for example, several of the package definitions include a dependency on <code>ghdl-clang</code>, provided by <code>guix-science</code> channel, so I need to declare it in here too. <br/>
It is also necessary a <code>.guix-authorizations</code> <a href="https://git.sr.ht/~csantosb/guix.channel-electronics/tree/main/.guix-authorizations" rel="nofollow">file</a>, with the (GPG key) list of developers <a href="https://guix.gnu.org/manual/en/html_node/Specifying-Channel-Authorizations.html" rel="nofollow">with right to push to this channel</a>. This is how guix <a href="https://guix.gnu.org/manual/en/html_node/Channel-Authentication.html" rel="nofollow">authenticates</a> channels. Finally, it is important to create a <a href="https://git.sr.ht/~csantosb/guix.channel-electronics/tree/main/readme.org#L50" rel="nofollow">readme</a> file or similar where introduce the channel (first commit, signing key fingerprint). That’s it. Include the channel introduction into your <code>~/.config/guix/channels.scm</code> file, and you’ll be pulling from your online guix channel. <br/></p>

<h1 id="contributing">contributing</h1>

<p>The advantage of using a custom channel is to benefit from an increased degree of freedom when using guix, without being dependent of someone’s else time availability to consider your particular needs. Remember, guix is a huge project which follows closely the <a href="/csantosb/tag:freesoftware" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">freesoftware</span></a> paradigm, and collaboration works in two directions. You take advantage of other developers contributions to guix, while you participate yourself to improving guix repositories with your package definitions, once they have been tested. <br/>
Take for example the list of <a href="https://gitlab.com/csantosb/guix/channel-electronics/-/blob/main/packages.org" rel="nofollow">packages</a> in my electronics channel. I have included here utilities for <a href="/csantosb/tag:vhdl" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">vhdl</span></a> code editing under <a href="/csantosb/tag:emacs" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">emacs</span></a>, specific to the electronic digital design field, which are not yet available in guix upstream channel. There is also a cosimulation library, <a href="/csantosb/tag:cocotb" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">cocotb</span></a>, which allows coupling <a href="/csantosb/tag:python" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">python</span></a> and <a href="/csantosb/tag:ghdl" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">ghdl</span></a> to simulate a design. I have submitted a <a href="https://issues.guix.gnu.org/68153" rel="nofollow">patch</a> to include this in guix itself, similarly to <a href="https://issues.guix.gnu.org/74242" rel="nofollow">python-vunit</a>; once merged, I’ll remove them from here. <br/>
Some packages, like <a href="https://git.savannah.gnu.org/cgit/guix.git/commit/?id=9fb7333fc9" rel="nofollow">open fpga loader</a> are now part of guix. Some others, like the <a href="https://codeberg.org/guix-science/guix-science/pulls/46" rel="nofollow">gnat ada compiler</a> and <code>ghdl-clang</code> stable have been merged already on <code>guix-science</code>, as <code>gnat</code> package is obtained from binaries (and so <code>ghdl-clang</code> is also impacted, from guix perspective). I include here a more recent <code>ghdl-clang</code>, non yet released, as it includes some fixes and improvements I am interested in, without having to wait until guix incorporates a new release. <br/>
Catch the idea ? <br/>
<a href="https://guix.gnu.org/manual/en/html_node/Contributing.html" rel="nofollow">Contributing</a> your code to guix comes to <a href="https://git-send-email.io/" rel="nofollow">sending <a href="/csantosb/tag:email" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">email</span></a></a> <a href="https://www.futurile.net/2022/03/07/git-patches-email-workflow/" rel="nofollow">with your patches</a> attached, it’s that simple. Dont be intimidated by the workflow (this is used by the linux project, for example). Once your patches are submitted, a review of your code folllows, see <a href="https://libreplanet.org/wiki?title=Group:Guix/PatchReviewSessions2024" rel="nofollow">details</a>. Some tools, like <a href="https://www.youtube.com/watch?v=8m8igXrKaqU" rel="nofollow">mumi</a>, are helpful to that purpose. <br/>
These simple steps will allow you to start contributing to guix: <br/></p>
<ul><li>git clone guix itselft <br/></li>
<li>add and commit your changes, watch the commit message <br/></li>
<li>don’t forget to use <code>guix lint/style/refresh -l</code> to check your code <br/></li>
<li>use <code>git send-email</code> to create and send a patch <br/></li>
<li>cosider reviews, if any, updating your patch accordingly with <code>git ammend</code> <br/></li>
<li>resend a new patch including a patch version (v1, v2 ...) <br/></li></ul>

<p>Interested ? Consult <a href="https://guix.gnu.org/manual/en/html_node/Contributing.html" rel="nofollow">the doc</a> for details, you’ll learn a lot about how to contribute to a common good and collaboration with other people. <br/></p>
]]></content:encoded>
      <guid>https://infosec.press/csantosb/guix-channels</guid>
      <pubDate>Tue, 31 Jan 2023 23:00:00 +0000</pubDate>
    </item>
    <item>
      <title>on dependencies</title>
      <link>https://infosec.press/csantosb/on-dependencies</link>
      <description>&lt;![CDATA[img br/&#xA;Digital hardware design implies dealing with a lot of scripts, configurations, packages, project files, documentation, specifications, bibliographies, data sheets, software, etc. and, of course, a lot of code. Each one comes with its own version history. This is not a problem, as we have #git. But when it comes to #dependencies between different sets, how do we handle the complexity ? !--more-- br/&#xA;Dependencies create a graph between each of its components (nodes). This way, documentation refers to a package, which complies with some scripts, related to project files for a given software. This forms a tree of dependencies, closely related, including duplicated dependencies, as one document may correspond to different pieces of code, forming a loop. And yet, this is not the whole picture. br/&#xA;Each node in the graph incorporates its own history of revisions: a given version of the documentation refers to a particular version of a firmware module, which links to a specific version of a data sheet, sending the user to a certain version of a bibliographic reference. This happens with the whole graph and is usually referred to as dependency hell. The complexity comes from the fact that, when one upgrades a node (to a more recent version), its new dependencies (new versions) are pulled along with it. But, in the most general case, those are also necessary for some other node in the graph, which prevents the upgrade from happening, unless more than one version of the node exists at some point in time. The mess arises. br/&#xA;Classical examples are software package managers, python being its most relevant example (specially due to the amount of dependency managers which coexist). Another good example is operating systems: when one decides to upgrade #librewolf web browser, all the necessary dynamic library dependencies of the new release must be pulled too; some of them maybe happens to be necessary for #emacs, which breaks. Package managers need to keep track of the whole history of graph of dependencies and deal with upgrades, software install and removal so as to keep a coherence between the whole system. Hell in heaven. OS must be seen as a set of nodes in a dependency graph moving forward in time, with obsoleted old releases impossible to reach anymore. br/&#xA;As engineers, this rings a bell. What happens when we upgrade proprietary software to support new hardware (Vivado, looking at you now) ?. A new software release implies new versions of IP cores, sometimes incompatible with previous versions, with different versions of documentation, sometimes incorporating its own set of regressions. #Tcl scripts may break, too, or require an upgrade of interpreters. The hell goes for long ... How do we check that our code performs correctly after an upgrade ? How to ensure that no side effects come with it ? Is it possible to be sure that data sheets are still relevant ? Is this paper compatible with the new upgrade ? Can we automatize all of that, or do we need to proceed by hand ? I guess you catch the idea. br/&#xA;modernhw makes it mandatory to use a tool to deal with dependencies. And a very good one, if you want my opinion, including all the necessary scripting capabilities and flexibility we need to cope with our scripts, configurations, packages, project files, documentation, specifications, bibliographies, data sheets, software, etc. and, of course, a lot of code. br/&#xA;Do we have such a tool ? Sure. Its name is #guix. br/]]&gt;</description>
      <content:encoded><![CDATA[<p><img src="https://git.sr.ht/~csantosb/csbwiki/blob/master/pics/dependencies.png" alt="img"> <br/>
Digital hardware design implies dealing with a lot of scripts, configurations, packages, project files, documentation, specifications, bibliographies, data sheets, software, etc. and, of course, a lot of code. Each one comes with its own version history. This is not a problem, as we have <a href="/csantosb/tag:git" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">git</span></a>. But when it comes to <a href="/csantosb/tag:dependencies" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">dependencies</span></a> between different sets, <a href="https://csantosb.gitlab.io/ip/talks/hdl-lib_what_is_needed/" rel="nofollow">how do we handle the complexity</a> ?  <br/>
Dependencies create a graph between each of its components (nodes). This way, documentation refers to a package, which complies with some scripts, related to project files for a given software. This forms a tree of dependencies, closely related, including duplicated dependencies, as one document may correspond to different pieces of code, forming a loop. And yet, this is not the whole picture. <br/>
Each node in the graph incorporates its own history of revisions: a given version of the documentation refers to a particular version of a firmware module, which links to a specific version of a data sheet, sending the user to a certain version of a bibliographic reference. This happens with the whole graph and is usually referred to as <a href="https://en.wikipedia.org/wiki/Dependency_hell" rel="nofollow">dependency hell.</a> The complexity comes from the fact that, when one upgrades a node (to a more recent version), its new dependencies (new versions) are pulled along with it. But, in the most general case, those are also necessary for some other node in the graph, which prevents the upgrade from happening, unless more than one version of the node exists at some point in time. The mess arises. <br/>
Classical examples are software package managers, <a href="https://medium.com/knerd/the-nine-circles-of-python-dependency-hell-481d53e3e025" rel="nofollow">python</a> being its most relevant example (specially due to the amount of dependency managers which coexist). Another good example is operating systems: when one decides to upgrade <a href="/csantosb/tag:librewolf" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">librewolf</span></a> web browser, all the necessary dynamic library dependencies of the new release must be pulled too; some of them maybe happens to be necessary for <a href="/csantosb/tag:emacs" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">emacs</span></a>, which breaks. Package managers need to keep track of the whole history of graph of dependencies and deal with upgrades, software install and removal so as to keep a coherence between the whole system. Hell in heaven. OS must be seen as a set of nodes in a dependency graph moving forward in time, with obsoleted old releases impossible to reach anymore. <br/>
As engineers, this rings a bell. What happens when we upgrade proprietary software to support new hardware (<a href="https://www.amd.com/es/products/software/adaptive-socs-and-fpgas/vivado.html" rel="nofollow">Vivado</a>, looking at you now) ?. A new software release implies new versions of IP cores, sometimes incompatible with previous versions, with different versions of documentation, sometimes incorporating its own set of regressions. <a href="/csantosb/tag:Tcl" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Tcl</span></a> scripts may break, too, or require an upgrade of interpreters. The hell goes for long ... How do we check that our code performs correctly after an upgrade ? How to ensure that no side effects come with it ? Is it possible to be sure that data sheets are still relevant ? Is this paper compatible with the new upgrade ? Can we automatize all of that, or do we need to proceed by hand ? I guess you catch the idea. <br/>
<a href="/csantosb/tag:modernhw" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">modernhw</span></a> makes it mandatory to use a tool to deal with dependencies. And a very good one, if you want my opinion, including all the necessary scripting capabilities and flexibility we need to cope with our scripts, configurations, packages, project files, documentation, specifications, bibliographies, data sheets, software, etc. and, of course, a lot of code. <br/>
Do we have such a tool ? Sure. Its name is <a href="/csantosb/tag:guix" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">guix</span></a>. <br/></p>
]]></content:encoded>
      <guid>https://infosec.press/csantosb/on-dependencies</guid>
      <pubDate>Tue, 31 Jan 2023 23:00:00 +0000</pubDate>
    </item>
    <item>
      <title>emacs</title>
      <link>https://infosec.press/csantosb/use-emacs</link>
      <description>&lt;![CDATA[img br/&#xA;#modernhw, and in particular digital electronics design implies, for the most of it, writing #plaintext files. Creating code, scripts, configurations, documentation, emails, taking notes, handling bibliographic references, etc., all of these tasks involve writing in plain text files. Whether these files are created or modified, editing plain text is a must. An, when it comes to editing text, it is really worth investing some time on learning a bit more than the basics of a good text editor. !--more-- br/&#xA;At that point, once one decides to opt for a good tool, it takes the best of them all. In my case, I decided to start a long journey towards mastering emacs, even if GNU #emacs is much more than a text editor: it is a full customizable environment, and is #freesoftware. Emacs has been around longer than me, and benefits from the accumulated experience of all those having used it well before I discovered its existence. Inside of it one will have access to a plethora of existing applications, make use of killer tools as #magit and #orgroam, handle email with #mu4e, browse the web with #eww, manipulate windows with #exwm, run terminals, compile, develop non-existing utilities, modify emacs’s default behavior, change options, default bindings, etc. It is closer to a customizable working environmetn (a full OS some claim !) that you’ll take the time to build, than just a text editor. br/&#xA;Orgmode deserves a special chapter in here: #orgmode brings plain text editing to next level of productivity.  Check the quickstart if you’re not familiar with it. Don’t feel overwhelmed by the its large list of features: links, tables, markup, attachments, agenda, tags, export, publishing ... the list is endless. If you ever feel like tempted to use it, proceed step by step. As with emacs, just pick some appealing feature you think you’ need, and start making use of it. The more you practice, the more you’ll feel more comfortable with it. br/&#xA;You’ll manage, with time and some experience, to build a working environment suited to your particular and special needs, to a point you never imagined it was possible. And most important: you’ll be able to make it evolve with your own needs. It takes time, a lot of it, and the learning curve is quite step, so this is probably not the best choice for everyone. However, once you really learn how to use it (and get used to forget about your mouse !), the benefits in productivity are really impressive. You’ll never look backwards. br/&#xA;If you ever opt to follow the same path as I did, start by the tutorial, and read the documentation. Then, just use it, little by little, no hurries. You’ll be learning something new about emacs everyday during the next 20 years anyway. br/]]&gt;</description>
      <content:encoded><![CDATA[<p><img src="https://git.sr.ht/~csantosb/csbwiki/blob/master/pics/emacslogo.png" alt="img"> <br/>
<a href="/csantosb/tag:modernhw" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">modernhw</span></a>, and in particular digital electronics design implies, for the most of it, writing <a href="/csantosb/tag:plaintext" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">plaintext</span></a> files. Creating code, scripts, configurations, documentation, emails, taking notes, handling bibliographic references, etc., all of these tasks involve writing in plain text files. Whether these files are created or modified, editing plain text is a must. An, when it comes to editing text, it is really worth investing some time on learning a bit more than the basics of a good text editor.  <br/>
At that point, once one decides to opt for a good tool, it takes the best of them all. In my case, I decided to start a long journey towards <a href="https://www.masteringemacs.org/" rel="nofollow">mastering emacs</a>, even if GNU <a href="/csantosb/tag:emacs" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">emacs</span></a> is much more than a text editor: it is a full customizable environment, and is <a href="/csantosb/tag:freesoftware" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">freesoftware</span></a>. Emacs has been around longer than me, and benefits from the accumulated experience of all those having used it well before I discovered its existence. Inside of it one will have access to a plethora of existing applications, make use of killer tools as <a href="/csantosb/tag:magit" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">magit</span></a> and <a href="/csantosb/tag:orgroam" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">orgroam</span></a>, handle email with <a href="/csantosb/tag:mu4e" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">mu4e</span></a>, browse the web with <a href="/csantosb/tag:eww" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">eww</span></a>, manipulate windows with <a href="/csantosb/tag:exwm" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">exwm</span></a>, run terminals, compile, develop non-existing utilities, modify emacs’s default behavior, change options, default bindings, etc. It is closer to a customizable working environmetn (a full OS some claim !) that you’ll take the time to build, than just a text editor. <br/>
<a href="https://orgmode.org/" rel="nofollow">Orgmode</a> deserves a special chapter in here: <a href="/csantosb/tag:orgmode" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">orgmode</span></a> brings plain text editing to next level of productivity.  Check the <a href="https://orgmode.org/quickstart.html" rel="nofollow">quickstart</a> if you’re not familiar with it. Don’t feel overwhelmed by the its large list of features: links, tables, markup, attachments, agenda, tags, export, publishing ... the list is endless. If you ever feel like tempted to use it, proceed step by step. As with emacs, just pick some appealing feature you think you’ need, and start making use of it. The more you practice, the more you’ll feel more comfortable with it. <br/>
You’ll manage, with time and some experience, to build a working environment suited to your particular and special needs, to a point you never imagined it was possible. And most important: you’ll be able to make it evolve with your own needs. It takes time, a lot of it, and the learning curve is quite step, so this is probably not the best choice for everyone. However, once you really learn how to use it (and get used to forget about your mouse !), the benefits in productivity are really impressive. You’ll never look backwards. <br/>
If you ever opt to follow the same path as I did, start by the tutorial, and read the documentation. Then, just use it, little by little, no hurries. You’ll be learning something new about emacs everyday during the next 20 years anyway. <br/></p>
]]></content:encoded>
      <guid>https://infosec.press/csantosb/use-emacs</guid>
      <pubDate>Tue, 31 Jan 2023 23:00:00 +0000</pubDate>
    </item>
  </channel>
</rss>