summaryrefslogtreecommitdiff
path: root/guix/search-paths.scm
diff options
context:
space:
mode:
Diffstat (limited to 'guix/search-paths.scm')
-rw-r--r--guix/search-paths.scm15
1 files changed, 13 insertions, 2 deletions
diff --git a/guix/search-paths.scm b/guix/search-paths.scm
index 89af1e1492..ee7e9a131f 100644
--- a/guix/search-paths.scm
+++ b/guix/search-paths.scm
@@ -36,7 +36,8 @@
search-path-specification->sexp
sexp->search-path-specification
evaluate-search-paths
- environment-variable-definition))
+ environment-variable-definition
+ search-path-definition))
;;; Commentary:
;;;
@@ -160,7 +161,7 @@ report only settings not already effective."
#:key
(kind 'exact)
(separator ":"))
- "Return a the definition of VARIABLE to VALUE in Bash syntax:
+ "Return a the definition of VARIABLE to VALUE in Bash syntax.
KIND can be either 'exact (return the definition of VARIABLE=VALUE),
'prefix (return the definition where VALUE is added as a prefix to VARIABLE's
@@ -178,4 +179,14 @@ prefix/suffix."
(format #f "export ~a=\"$~a${~a:+~a}~a\""
variable variable variable separator value))))
+(define* (search-path-definition search-path value
+ #:key (kind 'exact))
+ "Similar to 'environment-variable-definition', but applied to a
+<search-path-specification>."
+ (match search-path
+ (($ <search-path-specification> variable _ separator)
+ (environment-variable-definition variable value
+ #:kind kind
+ #:separator separator))))
+
;;; search-paths.scm ends here