dannym pushed a commit to branch wip-installer-2
in repository guix.
commit 4cfb89841beb309d57daf367299c8346979b48e3
Author: John Darrington <[email protected]>
Date: Thu Dec 22 19:14:24 2016 +0100
installer: Add completion predicate for disk task.
* gnu/system/installer/new.scm (size-of-largest-disk): New procedure, and
use it to make completion predicate for disk task.
---
gnu/system/installer/new.scm | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/gnu/system/installer/new.scm b/gnu/system/installer/new.scm
index 5d37e58..aa393b8 100644
--- a/gnu/system/installer/new.scm
+++ b/gnu/system/installer/new.scm
@@ -39,6 +39,7 @@
(ice-9 format)
(ice-9 match)
(ice-9 pretty-print)
+ (srfi srfi-1)
(srfi srfi-9))
@@ -56,11 +57,15 @@
(define timezone-menu-title (N_ "Set the time zone"))
(define hostname-menu-title (N_ "Set the host name"))
+(define (size-of-largest-disk)
+ (fold (lambda (disk prev) (max (disk-size disk) prev))
+ 0 (volumes)))
+
(define main-options
`(
(disk . ,(make-task partition-menu-title
'()
- (lambda () #f)
+ (lambda () (< 12000 (size-of-largest-disk)))
(lambda (page)
(make-disk-page
page