Message ID | 20200731144929.703345-1-othacehe@gnu.org |
---|---|
State | Accepted |
Headers | show |
Series | Add image-type support. | expand |
Context | Check | Description |
---|---|---|
cbaines/comparison | success | View comparision |
cbaines/git branch | success | View Git branch |
cbaines/applying patch | success | View Laminar job |
cbaines/comparison | success | View comparision |
cbaines/git branch | success | View Git branch |
cbaines/applying patch | success | View Laminar job |
Mathieu Othacehe <m.othacehe@gmail.com> skribis: > * gnu/image.scm (<image-type>): New record, > (image-type, image-type?, image-type-name, > image-type-constructor, os->image): new procedures. [...] > +(define-record-type* <image-type> > + image-type make-image-type > + image-type? > + (name image-type-name) ;string It’s subjective, but I’d make it a symbol, like we do for service types for instance. Ludo’.
diff --git a/gnu/image.scm b/gnu/image.scm index dc66f2c533..6f8f4828ac 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) ;string + (constructor image-type-constructor)) ;<operating-system> -> <image> + + +;;; +;;; Image creation. +;;; + +(define* (os->image os #:key type) + (let ((constructor (image-type-constructor type))) + (constructor os)))