summaryrefslogtreecommitdiff
path: root/gnu/image.scm
diff options
context:
space:
mode:
authorMathieu Othacehe <m.othacehe@gmail.com>2020-07-31 16:49:27 +0200
committerMathieu Othacehe <othacehe@gnu.org>2020-09-30 10:47:59 +0200
commit99d036ce8402326352c8aa181d89c6d0c7ce85a8 (patch)
tree0cf737c8f626b24522b1c13a517fa431b5f72b78 /gnu/image.scm
parent2f1f7b6667e9130654987942a63fd95c8b1788be (diff)
downloadguix-patches-99d036ce8402326352c8aa181d89c6d0c7ce85a8.tar
guix-patches-99d036ce8402326352c8aa181d89c6d0c7ce85a8.tar.gz
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>
Diffstat (limited to 'gnu/image.scm')
-rw-r--r--gnu/image.scm29
1 files changed, 28 insertions, 1 deletions
diff --git a/gnu/image.scm b/gnu/image.scm
index dc66f2c533..a60d83b175 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)))