GNU bug report logs -
#45957
[PATCH] * doc/guix-cookbook.texi (Guix System Image API): new section
Previous Next
Reported by: Joshua Branson <jbranso <at> dismail.de>
Date: Mon, 18 Jan 2021 16:40:01 UTC
Severity: normal
Tags: patch
Done: Mathieu Othacehe <othacehe <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Hello Joshua,
Thanks for this new revision! It's really nice to follow your live
coding sessions. I think it can be very valuable for newcomers willing
to dive into Guix internals.
> +This record also contains the operating-system to instantiate. The
> +@code{format} field defines the image type and can be @code{disk-image},
^
efi-raw
> +@code{compressed-qcow2} or @code{iso9660}. In the future, it could be
^
qcow2
The supported image types list is now longer, so you could add "for
instance". We could also specify that "raw" designates disk-image that
can be copied as is on the installation media.
> +@file{gnu/guix/guix-src/gnu/system/images/novena.scm}
You mean @file{gnu/system/images/novena.scm}, right?
> + - pinebook-pro-raw
> + - pine64-raw
> + - novena-raw
> + - hurd-raw
> + - hurd-qcow2
> + - qcow2
> + - uncompressed-iso9660
> + - raw
> + - arm64-raw
> + - arm32-raw
> + - iso9660
Since recently "raw" has been renamed "efi-raw".
> +@lisp
> +(use-modules
> + (srfi srfi-9)
> + (srfi srfi-9 gnu)
> + (gnu services linux)
> + (gnu system images pine64))
> +
> +(define my-pine64-barebones-os
> + (set-fields pine64-barebones-os
> + ((operating-system-timezone) "America/Indiana/Indianapolis")
> + ((operating-system-user-services)
> + (cons*
> + (service earlyoom-service-type
> + (earlyoom-configuration
> + (prefer-regexp "icecat|chromium|firefox")))
> + (operating-system-user-services pine64-barebones-os)))))
Nice example. However, we generally prefer using inheritance. That would
give:
--8<---------------cut here---------------start------------->8---
(use-modules (gnu system)
(gnu services linux)
(gnu system images pine64))
(let ((base-os pine64-barebones-os))
(operating-system
(inherit base-os)
(timezone "America/Indiana/Indianapolis")
(services
(cons*
(service earlyoom-service-type
(earlyoom-configuration
(prefer-regexp "icecat|chromium|firefox")))
(operating-system-user-services base-os)))))
--8<---------------cut here---------------end--------------->8---
WDYT?
Thanks,
Mathieu
This bug report was last modified 4 years and 121 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.