diff options
Diffstat (limited to 'doc/guix.texi')
-rw-r--r-- | doc/guix.texi | 61 |
1 files changed, 32 insertions, 29 deletions
diff --git a/doc/guix.texi b/doc/guix.texi index 1739f3268d..7febee48ac 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -2194,8 +2194,8 @@ scheme@@(guile-user)> Note that non-monadic values cannot be returned in the @code{store-monad} REPL. -The main syntactic forms to deal with monads in general are described -below. +The main syntactic forms to deal with monads in general are provided by +the @code{(guix monads)} module and are described below. @deffn {Scheme Syntax} with-monad @var{monad} @var{body} ... Evaluate any @code{>>=} or @code{return} forms in @var{body} as being @@ -2235,8 +2235,8 @@ monadic expressions are ignored. In that sense, it is analogous to @code{begin}, but applied to monadic expressions. @end deffn -The interface to the store monad provided by @code{(guix monads)} is as -follows. +The main interface to the store monad, provided by the @code{(guix +store)} module, is as follows. @defvr {Scheme Variable} %store-monad The store monad. Values in the store monad encapsulate accesses to the @@ -2255,31 +2255,6 @@ Return as a monadic value the absolute file name in the store of the file containing @var{text}, a string. @end deffn -@deffn {Monadic Procedure} text-file* @var{name} @var{text} @dots{} -Return as a monadic value a derivation that builds a text file -containing all of @var{text}. @var{text} may list, in addition to -strings, packages, derivations, and store file names; the resulting -store file holds references to all these. - -This variant should be preferred over @code{text-file} anytime the file -to create will reference items from the store. This is typically the -case when building a configuration file that embeds store file names, -like this: - -@example -(define (profile.sh) - ;; Return the name of a shell script in the store that - ;; initializes the 'PATH' environment variable. - (text-file* "profile.sh" - "export PATH=" coreutils "/bin:" - grep "/bin:" sed "/bin\n")) -@end example - -In this example, the resulting @file{/gnu/store/@dots{}-profile.sh} file -will references @var{coreutils}, @var{grep}, and @var{sed}, thereby -preventing them from being garbage-collected during its lifetime. -@end deffn - @deffn {Monadic Procedure} interned-file @var{file} [@var{name}] @ [#:recursive? #t] Return the name of @var{file} once interned in the store. Use @@ -2303,6 +2278,9 @@ The example below adds a file to the store, under two different names: @end deffn +The @code{(guix packages)} module exports the following package-related +monadic procedures: + @deffn {Monadic Procedure} package-file @var{package} [@var{file}] @ [#:system (%current-system)] [#:target #f] @ [#:output "out"] Return as a monadic @@ -2563,6 +2541,31 @@ The resulting file holds references to all the dependencies of @var{exp} or a subset thereof. @end deffn +@deffn {Monadic Procedure} text-file* @var{name} @var{text} @dots{} +Return as a monadic value a derivation that builds a text file +containing all of @var{text}. @var{text} may list, in addition to +strings, packages, derivations, and store file names; the resulting +store file holds references to all these. + +This variant should be preferred over @code{text-file} anytime the file +to create will reference items from the store. This is typically the +case when building a configuration file that embeds store file names, +like this: + +@example +(define (profile.sh) + ;; Return the name of a shell script in the store that + ;; initializes the 'PATH' environment variable. + (text-file* "profile.sh" + "export PATH=" coreutils "/bin:" + grep "/bin:" sed "/bin\n")) +@end example + +In this example, the resulting @file{/gnu/store/@dots{}-profile.sh} file +will references @var{coreutils}, @var{grep}, and @var{sed}, thereby +preventing them from being garbage-collected during its lifetime. +@end deffn + Of course, in addition to gexps embedded in ``host'' code, there are also modules containing build tools. To make it clear that they are meant to be used in the build stratum, these modules are kept in the |