On 2023-08-30 17:00:07 +0200, Jakub Skokan wrote:
Ahoj,
(English below)
TL;DR ve VPS lze nově používat distribuci Guix.
GNU Guix System [1] je linuxová distribuce založená na správci balíčků Guix. Funguje to velice podobně jako NixOS [2] a Nix, až na to, že Guix a celý systém se konfiguruje pomocí Guile Scheme. Ve Scheme jsou opravdu veškeré součásti systému, včetně init systému Shepherd [3].
Na rozdíl od klasických distribucí se Guix a NixOS konfigurují deklarativně: v konfiguračním souboru nadefinujeme kompletní podobu výsledného systému, tj. jaké má obsahovat uživatele/skupiny, služby a jejich nastavení. Ať už se jedná o aktualizaci nebo rollback, mezi různými verzemi systému se lze snadno přepínat buď za běhu, nebo při bootu v zavaděči, resp. u nás ve Start Menu [4]. Guix oproti NixOS obsahuje jen Free Software.
Protože ve vpsFree používáme NixOS [5] skoro na všechno, zajímalo mě taky, jak je na tom Guix. Bohužel Scheme pořádně neznám a ani mě to moc neláká -- je tam příliš mnoho závorek :) Před rokem se jeden člen snažil [6] šablonu pro Guix vytvořit, ale sám jsem neviděl cestu, jak na to. Až před pár dny jsem narazil na blog [7], který obsahoval potřebné informace. Hlavní problém byl, že ve VPS nemáme zavaděč a taky se nepřipojuje kořenový souborový systém -- je připojen už před spuštěním /sbin/init ve VPS. V konfiguraci však zavaděč i kořenový systém být musí, jinak se systém nesestaví.
Nakonec to není žádná věda: jako zařízení pro zavaděč stačí /dev/null [8] a volba --no-bootloader, s kořenovým systémem je to podobné [9].
Pokud by někdo měl zájem to vyzkoušet, VPS s Guixem si můžete vytvořit na node1.stg (staging). Jinde zatím nebude fungovat integrace pro nastavení sítě. Více informací viz KB:
Comments regarding the "known issues" section:
guix system reconfigure requires –allow-downgrades, why? Something is fishy with the channels.
Guix after fresh install is a bit funny sometimes. If one runs `guix pull' before trying the reconfigure, the --allow-downgrades is no longer necessary.
I did however run into different issue:
/ssh:root@37.205.14.33:/etc/config $ guix system reconfigure --no-bootloader system.scm The following derivation will be built: /gnu/store/fb4i299scqpgczwgphjmh85k0z0qgmwc-grub.cfg.drv
building /gnu/store/fb4i299scqpgczwgphjmh85k0z0qgmwc-grub.cfg.drv... /gnu/store/255b46p2w1b06shnh4wjfz2fzs7r3p8h-system /gnu/store/9nlha7hybazc09bqgrxplq5w480r02pp-grub.cfg
activating system... making '/gnu/store/255b46p2w1b06shnh4wjfz2fzs7r3p8h-system' the current system... setting up setuid programs in '/run/setuid-programs'... populating /etc from /gnu/store/xz25p33mwywcwv4xnpg2jkr39hci71hg-etc... shepherd: Starting service host-name... shepherd: Service host-name started. shepherd: Service host-name running with value #<unspecified>. shepherd: Service host-name has been started. shepherd: Starting service user-homes... shepherd: Service user-homes has been started. shepherd: Starting service sysctl... shepherd: Service sysctl could not be started. shepherd: Starting service vpsadminos-networking... guix system: warning: exception caught while executing 'start' on service 'vpsadminos-networking': Throw to key `%exception' with args `("#<&invoke-error program: "/gnu/store/m6c5hgqg569mbcjjbp8l8m7q82ascpdl-bash-5.1.16/bin/bash" arguments: ("/ifcfg.add") exit-status: 2 term-signal: #f stop-signal: #f>")'. guix system: warning: some services could not be upgraded hint: To allow changes to all the system services to take effect, you will need to reboot.
There is /ifcfg.del, however (@ (vpsadminos) vpsadminos-networking) does not use it as #:stop, and even if it did, I do not think that (#:one-shot?) services do invoke #:stop. I will send a patch for this in due time (turning the service into "sleep inf", so that #:stop will start to work).
halt (graceful shutdown) has been observed to sometimes hang, please report in case it's still a problem.
This is sadly sometimes problem on actual physical machines as well, so it might not be an issue with the template itself. Just FYI.
cgroups v1 are not mounted. cgroups do not seem to be needed by the base system, contact us in case it's a problem for some service or submit a patch to the template.
The only high-profile package that explicitly depends on the cgroup v1 is currently docker afaik, which in a world where podman exists is not that important. I plan to try to produce a patch moving guix to v2, which should solve this issue.
Jsou tam ještě nějaké nedostatky, které už nejspíš řešit nebudu, aspoň ne teď.
One more thing I noticed is that host-name setting from vpsadmin is not propagated into the /etc/config/config.scm, hardly a deal breaker. Are there more that you know about that are not documented?
Základ včetně integrace do vpsAdminu a Start Menu je zdá se funkční.
I agree, based on some toying around it seems to work fine, thanks again for making it happen. :)
Sami pro Guix využití nemáme, dělal jsem to spíš ze zajímavosti. Jestli Guix někdo použijete, budeme rádi za zpětnou vazbu.
ENGLISH:
TL;DR VPS can now use Guix distribution.
GNU Guix System [1] is a linux distribution based on Guix package manager. It is very similar to NixOS [2] and Nix, except that Guix is configured using Guile Scheme. Indeed, most of the system components including the init system Shepherd [3] are written in Scheme.
Unlike other well-known linux distributions, Guix and NixOS are configured declaratively: users/groups and all services with their settings that should a part of the target system are defined in a config file. It is possible to switch between different system configurations, be it an upgrade or downgrade. System versions can be switched at runtime or from the bootloader -- in our case, from the Start Menu [10]. Unlike NixOS, Guix contains only Free Software, as it is a part of the GNU project.
At vpsFree.cz, we use NixOS [5] almost everywhere. I was thus interested to see the state Guix is in. Unfortunately, I'm not familiar with Scheme, there are far too many parentheses! A year ago, one of our members tried to create [6] template for Guix, but we haven't been able to make it work. A few days ago, I've discovered a blogpost [7] that helped me understand the missing pieces. Our main issue was that inside the VPS, there's no bootloader and no need to mount the root file system, as it is mounted even before its /sbin/init is started. Guix configuration however requires them to be configured.
In the end it's pretty straightforward. /dev/null is used [8] as a device for the bootloader together with option --no-bootloader. Mounting of the root file system can be bypassed in a similar way [9].
If someone would like to give it a go, you can create VPS with Guix on node1.stg (staging). For more information, see KB:
https://kb.vpsfree.org/manuals/distributions/guix
There are several known issues, but the base system appears to be operational. Network configuration is integrated with vpsAdmin and the Start Menu can be used to run older system generations. As we do not have any actual use for Guix ourselves, I'm going to leave it as it is for now. We'll be glad for any feedback if you'll run anything on Guix.
[3] https://kb.vpsfree.cz/navody/vps/start_menu
[4] https://www.gnu.org/software/shepherd/
[5] https://github.com/vpsfreecz/vpsfree-cz-configuration
[6] https://github.com/vpsfreecz/vpsadminos-image-build-scripts/pull/47
[7] https://www.thedroneely.com/posts/guix-in-a-linux-container/
[8] https://github.com/vpsfreecz/vpsadminos/blob/14ac41e78566cdddc28fa40e2d79756...
[9] https://github.com/vpsfreecz/vpsadminos/blob/14ac41e78566cdddc28fa40e2d79756...
[10] https://kb.vpsfree.org/manuals/vps/start_menu
Jakub _______________________________________________ Community-list mailing list -- community-list@lists.vpsfree.cz To unsubscribe send an email to community-list-leave@lists.vpsfree.cz