gnu: system: image: Reduce subprocedure indentation.

* gnu/system/image.scm (system-disk-image): Reduce indentation.

Change-Id: I9cf59d3a61d0c6e7e90009e62661f74f774f090a
This commit is contained in:
Herman Rimm 2024-09-23 11:13:08 +02:00 committed by Ryan Schanzenbacher
parent 689cca0c75
commit a95413d299
Signed by: ryan77627
GPG key ID: 81B0E222A3E2308E

View file

@ -448,20 +448,18 @@ (define (partition->gpt-type partition)
(format #f (G_ "unsupported partition type: ~a") (format #f (G_ "unsupported partition type: ~a")
file-system))))))))) file-system)))))))))
(define (partition-image partition) (define (image-builder partition)
;; Return as a file-like object, an image of the given PARTITION. A "A directory, filled by calling the PARTITION initializer
;; directory, filled by calling the PARTITION initializer procedure, is procedure, is first created within the store. Then, an image of this
;; first created within the store. Then, an image of this directory is directory is created using tools such as 'mke2fs' or 'mkdosfs',
;; created using tools such as 'mke2fs' or 'mkdosfs', depending on the depending on the partition file-system type."
;; partition file-system type. (let ((os (image-operating-system image))
(let* ((os (image-operating-system image))
(schema (local-file (search-path %load-path (schema (local-file (search-path %load-path
"guix/store/schema.sql"))) "guix/store/schema.sql")))
(graph (match inputs (graph (match inputs
(((names . _) ...) (((names . _) ...)
names))) names)))
(type (partition-file-system partition)) (type (partition-file-system partition)))
(image-builder
(with-imported-modules* (with-imported-modules*
(let ((initializer (or #$(partition-initializer partition) (let ((initializer (or #$(partition-initializer partition)
initialize-root-partition)) initialize-root-partition))
@ -492,19 +490,24 @@ (define (partition-image partition)
#:deduplicate? #f #:deduplicate? #f
#:copy-closures? copy-closures? #:copy-closures? copy-closures?
#:system-directory #$os) #:system-directory #$os)
;; no point installing a bootloader if we don't populate store ;; There's no point installing a bootloader if we do not
;; populate the store.
(when copy-closures? (when copy-closures?
;; root-offset isn't necessary - we override 'root ;; Root-offset isn't necessary: we override 'root.
#$(bootloader-configurations->gexp bootloader-config bootmeta #$(bootloader-configurations->gexp
bootloader-config bootmeta
#:overrides (targets partition))) #:overrides (targets partition)))
(make-partition-image #$(partition->gexp partition) (make-partition-image #$(partition->gexp partition)
#$output #$output
image-root))))) image-root)))))
(computed-file "partition.img" image-builder
(define (partition-image partition)
"Return as a file-like object, an image of the given PARTITION."
(computed-file "partition.img" (image-builder partition)
;; Allow offloading so that this I/O-intensive process ;; Allow offloading so that this I/O-intensive process
;; doesn't run on the build farm's head node. ;; doesn't run on the build farm's head node.
#:local-build? #f #:local-build? #f
#:options `(#:references-graphs ,inputs)))) #:options `(#:references-graphs ,inputs)))
(define (gpt-image? image) (define (gpt-image? image)
(eq? 'gpt (image-partition-table-type image))) (eq? 'gpt (image-partition-table-type image)))