summary refs log tree commit diff
path: root/gnu/image.scm
diff options
context:
space:
mode:
authorGuillaume Le Vaillant <glv@posteo.net>2020-10-05 14:17:25 +0200
committerGuillaume Le Vaillant <glv@posteo.net>2020-10-05 14:17:25 +0200
commit87c079d9b55afda249ddc1b11798a62547a2cbb6 (patch)
treea7a0dbcfd8c3fb8935e00cc44f8b514fa790975b /gnu/image.scm
parentde96ed11efdfb450ca45952aceda656a78d981c4 (diff)
parent3699ed63501a28629956ca60e198f5fafa57ad4e (diff)
downloadguix-87c079d9b55afda249ddc1b11798a62547a2cbb6.tar.gz
Merge branch 'master' into staging
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)))