unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Mathieu Othacehe <othacehe@gnu.org>
To: Joshua Branson <jbranso@dismail.de>
Cc: 45957@debbugs.gnu.org
Subject: [bug#45957] [PATCH] * doc/guix-cookbook.texi (Guix System Image API): new section
Date: Thu, 21 Jan 2021 12:14:01 +0100	[thread overview]
Message-ID: <87o8hiilty.fsf@gnu.org> (raw)
In-Reply-To: <20210120171254.3403-1-jbranso@dismail.de> (Joshua Branson's message of "Wed, 20 Jan 2021 12:12:54 -0500")


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




  reply	other threads:[~2021-01-21 11:17 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <87h7nepe4v.fsf@gnu.org>
2021-01-18 16:38 ` [PATCH] * doc/guix-cookbook.texi (Guix System Image API): new section jbranso--- via
2021-01-18 17:53   ` [bug#45957] (no subject) guix-patches--- via
2021-01-20 13:06     ` Mathieu Othacehe
2021-01-20 17:12       ` [bug#45957] [PATCH] * doc/guix-cookbook.texi (Guix System Image API): new section guix-patches--- via
2021-01-21 11:14         ` Mathieu Othacehe [this message]
2021-01-21 12:22           ` [bug#45957] learning git-send-email is interesting guix-patches--- via
2021-01-21 12:22           ` [bug#45957] [PATCH] * doc/guix-cookbook.texi (Guix System Image API): new section guix-patches--- via
2021-01-21 13:41             ` bug#45957: " Mathieu Othacehe
2021-01-20 17:17       ` [bug#45957] (no subject) guix-patches--- via
2021-01-21 12:33     ` [bug#45957] thanks guix-patches--- via

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

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87o8hiilty.fsf@gnu.org \
    --to=othacehe@gnu.org \
    --cc=45957@debbugs.gnu.org \
    --cc=jbranso@dismail.de \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).