guix-devel
[Top][All Lists]
Advanced

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

Guix System automated installation


From: Giovanni Biscuolo
Subject: Guix System automated installation
Date: Mon, 26 Feb 2024 14:25:26 +0100

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.

Alternatively, you can use the (info "(guix) Manual Installation") and
copy a pre-configured (preseed? :-) ) operating-system file, but you
have to be very careful (see (info "(guix) Proceeding with the
Installation").

>> I see there’s `guix deploy’, but that requires an already-installed GuixSD to
>> work, which isn’t helpful for getting it installed in the first place.
>>
>> Thanks,
>>
>>  — Ian

I'm also interested in a way to fully automate the installation [1] of
Guix System hosts and I've developed a small bash script to help me (see
below).

The idea is to use the script to install a very basic Guix System on the
machine and then use "guix deploy" (or deploy "manually") for a
full-fledged configuration.

My initial motivation was (and sill is the main) to allow me to install
Guix Systems on rented hosts (dedicates or VPS) provided by vendors that
do not have Guix System in the list of operating systems users can
install on their machines: in this case users can boot machines in
rescue mode (AFAIU all hosters provide a rescue system) and insall Guix
System in a similar way as described in (info "(guix-cookbook) Running
Guix on a Linode Server") or (info "(guix-cookbook) Running Guix on a
Kimsufi Server")

You can find the script here:
https://gitlab.com/softwareworkers/swws/-/blob/master/infrastructure/hosts/cornouiller/bootstrap-guix.sh?ref_type=heads
(that is the last "version" I used, for now I write a script for every
machine I need... I still have to make this script generic putting all 
needed config variables in an external file)

Please consider it's still in early development, although I've already
tested it both locally and with real rented machines, both bare metal
and VPS.

After some tests I realized that with few tests I could use such a
script both on a rescue system and when installing using the Guix
Installer ISO, selecting a full manual installation, see (info
"(guix) Manual Installation"), and then running the script.

> 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 :-(


Happy hacking! Gio'



[1] that means: with almost zero needed intervention by the user... the
user just needs to _design_ the installation.

-- 
Giovanni Biscuolo

Xelera IT Infrastructures

Attachment: signature.asc
Description: PGP signature


reply via email to

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