guix-commits
[Top][All Lists]
Advanced

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

02/05: image: Add image-type support.


From: guix-commits
Subject: 02/05: image: Add image-type support.
Date: Wed, 30 Sep 2020 05:38:29 -0400 (EDT)

mothacehe pushed a commit to branch master
in repository guix.

commit 99d036ce8402326352c8aa181d89c6d0c7ce85a8
Author: Mathieu Othacehe <m.othacehe@gmail.com>
AuthorDate: Fri Jul 31 16:49:27 2020 +0200

    image: Add image-type support.
    
    * gnu/image.scm (<image-type>): New record,
    (image-type, image-type?, image-type-name,
    image-type-constructor, os->image): new procedures.
    
    Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
---
 gnu/image.scm | 29 ++++++++++++++++++++++++++++-
 1 file changed, 28 insertions(+), 1 deletion(-)

diff --git a/gnu/image.scm b/gnu/image.scm
index dc66f2c..a60d83b 100644
--- a/gnu/image.scm
+++ b/gnu/image.scm
@@ -39,7 +39,14 @@
             image-partitions
             image-compression?
             image-volatile-root?
-            image-substitutable?))
+            image-substitutable?
+
+            image-type
+            image-type?
+            image-type-name
+            image-type-constructor
+
+            os->image))
 
 
 ;;;
@@ -84,3 +91,23 @@
                       (default #t))
   (substitutable?     image-substitutable? ;boolean
                       (default #t)))
+
+
+;;;
+;;; Image type.
+;;;
+
+(define-record-type* <image-type>
+  image-type make-image-type
+  image-type?
+  (name           image-type-name) ;symbol
+  (constructor    image-type-constructor)) ;<operating-system> -> <image>
+
+
+;;;
+;;; Image creation.
+;;;
+
+(define* (os->image os #:key type)
+  (let ((constructor (image-type-constructor type)))
+    (constructor os)))



reply via email to

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