aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2018-09-05 10:35:43 +0200
committerLudovic Courtès <ludo@gnu.org>2018-09-05 12:01:48 +0200
commit030f1367f055720034cb178e50fd5d4c6ff371b1 (patch)
treeceadc57d04ec3aa49f536f5243b95209fb56177b
parent4fd2622df8615ce3e4d081124bee824315f00f85 (diff)
downloadguix-030f1367f055720034cb178e50fd5d4c6ff371b1.tar.gz
guix-030f1367f055720034cb178e50fd5d4c6ff371b1.zip
channels: Add 'latest-channel-derivation' convenience procedure.
* guix/channels.scm (latest-channel-derivations): Remove. (latest-channel-instances*, latest-channel-derivation): New procedures.
-rw-r--r--guix/channels.scm21
1 files changed, 12 insertions, 9 deletions
diff --git a/guix/channels.scm b/guix/channels.scm
index ec3e05eaf5..794383fe22 100644
--- a/guix/channels.scm
+++ b/guix/channels.scm
@@ -48,7 +48,7 @@
latest-channel-instances
channel-instance-derivations
- latest-channel-derivations
+ latest-channel-derivation
channel-instances->manifest))
;;; Commentary:
@@ -216,14 +216,6 @@ INSTANCES."
(list core))))
instances)))
-(define latest-channel-derivations
- (let ((latest-channel-instances (store-lift latest-channel-instances)))
- (lambda (channels)
- "Return, as a monadic value, the list of derivations for the latest
-instances of CHANNELS."
- (mlet %store-monad ((instances (latest-channel-instances channels)))
- (channel-instance-derivations instances)))))
-
(define (whole-package-for-legacy name modules)
"Return a full-blown Guix package for MODULES, a derivation that builds Guix
modules in the old ~/.config/guix/latest style."
@@ -290,3 +282,14 @@ channel instances."
(entries (mapm %store-monad instance->entry
(zip instances derivations))))
(return (manifest entries))))
+
+(define latest-channel-instances*
+ (store-lift latest-channel-instances))
+
+(define* (latest-channel-derivation #:optional (channels %default-channels))
+ "Return as a monadic value the derivation that builds the profile for the
+latest instances of CHANNELS."
+ (mlet* %store-monad ((instances ((store-lift latest-channel-instances)
+ channels))
+ (manifest (channel-instances->manifest instances)))
+ (profile-derivation manifest)))