From: Ian Eure <ian@retrospec.tv>
To: Giovanni Biscuolo <g@xelera.eu>
Cc: Csepp <raingloom@riseup.net>, help-guix@gnu.org, guix-devel@gnu.org
Subject: Re: Guix System automated installation
Date: Tue, 27 Feb 2024 12:37:06 -0800 [thread overview]
Message-ID: <87v869bob5.fsf@meson> (raw)
In-Reply-To: <87cysj5pdl.fsf@xelera.eu>
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.
next prev parent reply other threads:[~2024-02-27 21:16 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-03 0:01 GuixSD automated installation Ian Eure
2024-01-03 3:39 ` Csepp
2024-02-26 13:25 ` Guix System " Giovanni Biscuolo
2024-02-27 20:37 ` Ian Eure [this message]
2024-02-28 7:33 ` declarative partition and format with Guix (was Re: Guix System automated installation) Giovanni Biscuolo
2024-02-28 9:53 ` Giovanni Biscuolo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87v869bob5.fsf@meson \
--to=ian@retrospec.tv \
--cc=g@xelera.eu \
--cc=guix-devel@gnu.org \
--cc=help-guix@gnu.org \
--cc=raingloom@riseup.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.