help-guix
[Top][All Lists]
Advanced

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

Re: Guix System automated installation


From: Ian Eure
Subject: Re: Guix System automated installation
Date: Tue, 27 Feb 2024 12:37:06 -0800
User-agent: mu4e 1.8.13; emacs 28.2

Hi Giovanni,

Giovanni Biscuolo <g@xelera.eu> writes:

[[PGP Signed Part:Undecided]]
Hello Ian,

I'm a little late to this discussion, sorry.

I'm adding guix-devel since it would be nice if some Guix developer have
something to add on this matter, for this reason I'm leaving all
previous messages intact

Csepp <raingloom@riseup.net> writes:

Ian Eure <ian@retrospec.tv> writes:

Hello,

On Debian, you can create a preseed file containing answers to all the questions you’re prompted for during installation, and build a new install image which includes it. When booted, this installer skips any steps which have been preconfigured, which allows for either fully automated installation, or partly automated (prompt for hostname and root password, but otherwise automatic).

Does Guix have a way to do something like this? The declarative config is more or less the equivalent of the Debian preseed file, but I don’t see anything that
lets you build an image that’ll install a configuration.

When using the guided installation (info "(guix) Guided Graphical Installation"), right before the actual installation on target (guix system init...) you can edit the operating-system configuration file:
isn't it something similar to what you are looking for?

Please consider that a preseed file is very limited compared to a full-fledged operating-system declaration since the latter contains the declaration for *all* OS configuration, not just the installed packages.


I appreciate where you’re coming from, I also like the one-file system configuration, but this is inaccurate. Guix’s operating-system doesn’t encompass the full scope of configuration necessary to install and run an OS; Debian’s preseed has significantly more functionality than just specifying the installed packages. Right now, Debian’s system allows you to do things which Guix does not.

Preseed files contain values that get set in debconf, Debian’s system-wide configuration mechanism, so they can both configure the resulting system as well as the install process itself. This means you can use a preseed file to tell the installer to partition disks, set up LUKS-encrypted volumes (and specify one or more passwords for them), format those with filesystems, install the set of packages you want, and configure them -- though debconf’s package configuration is more limited, generally, than Guix provides[1]. With Debian, I can create a custom installer image with a preseed file, boot it, and without touching a single other thing, it’ll install and configure the target machine, and reboot into it. That boot-and-it-just-works experience is what I want from Guix.

For things that can’t be declared in operating-system, like disk partitioning and filesystem layout, the installer performs those tasks imperatively, then generates a system config with those device files and/or UUIDs populated, then initializes the system. There’s no facility for specifying disk partitioning or *creating* filesystems in the system config -- it can only be pointed at ones which have been created already.


guix system image is maybe closer, but it doesn’t automate everything that the
installer does.
But the installer can be used as a Scheme library, at least in theory. The way I would approach the problem is by creating a Shepherd service that runs at boot
from the live booted ISO.

I would really Love So Much™ to avoid writing imperative bash scripts and just write Scheme code to be able to do a "full automatic" Guix
System install, using a workflow like this one:

1. guix system prepare --include preseed.scm disk-layout.scm /mnt

where disk-layout.scm is a declarative gexp used to partition, format
and mount all needed filesystems

the resulting config.scm would be an operating-system declaration with
included the contents of preseed.scm (packages and services
declarations)

2. guix system init config.scm /mnt (already working now)

...unfortunately I'm (still?!?) not able to contribute such code :-(


I don’t think there’s any need for a preseed.scm file, and I’m not sure what would be in that, but I think this is close to the right track. Either operating-system should be extended to support things like disk partitioning, and effect those changes at reconfigure time (with suitable safeguards to avoid wrecking existing installs), or the operating-system config could get embedded in another struct which contains that, similar to the (image ...) config for `guix system image'. I think there are some interesting possibilities here: you could change your partition layout and have Guix resize them / create new ones for you.

 — Ian

[1]: A workaround for this is to create packages which configure the system how you want, then include them on the installer image / list them in the packages to be installed. Not ideal, but you can.



reply via email to

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