Hartmut Goebel <[email protected]> skribis:

> Am 08.12.2016 um 20:56 schrieb Leo Famulari:
>>> Here is the service-definition I use:
>>>
>>>              (nginx-service #:vhost-list
>>>                (list (nginx-vhost-configuration     
>>>                       (root (string-append nginx "/share/nginx/html"))
>> I believe that file-append is intended for this use case.
>
> Maybe, but I can't get it to work. This minimal system declarision fails
> with "In procedure string-append: Wrong type (expecting string):
> #<<file-append> base: #<package [email protected] gnu/packages/web.scm:126
> 2a236c0> suffix: ("/")>"
>
> (use-modules (gnu))
> (use-service-modules networking web)
> (define NGINX (file-append nginx "/"))
> (define TEST (string-append NGINX ""))

The result of ‘file-append’ is not a string, but ‘string-append’ expects
two strings, hence the error.

‘file-append’ returns a “string-valued gexp”.  This is to say that, in a
staging context, it will produce a string.  For example:

  (scheme-file "foo" #~(foo bar #$(file-append nginx "/foo/bar")))

leads to a file “foo” containing:

  (foo bar "/gnu/store/…-nginx-1.2.3/foo/bar")

HTH!

Ludo’.

Reply via email to