宋文武 <[email protected]> skribis:

> On 2015-11-20 22:12, [email protected] wrote:
>> 宋文武 <[email protected]> skribis:
>>
>> [...]
>>
>>> +  (define (module-path module)
>>> +    (list "  ModulePath \"" module "/lib/xorg/modules\"\n"))
>>
>> [...]
>>
>>> +" (apply string-append (map module-path modules)) "
>>
>> As with NixOS, the solution is to move these computations to the “build
>> side” (info "(guix) G-Expressions").
>>
>> So you could do something like:
>>
>>   (define build
>>     #~(call-with-output-file #$output
>>         (lambda (port)
>>           (for-each emit-driver-stanza '#$@xorg-modules))))
>>
>>   (gexp->derivation "xorg.conf" build)
>>
>> Does that make sense?
> Oh, yes!  I get what I want by replace mixed-text-file with
> gexp->derivation.

You can also use ‘computed-file’, which is the non-monadic equivalent.

Ludo’.

Reply via email to