On 11-09-2022 13:47, Maxime Devos wrote:
> 
> and in the build phase, do two separate cases: when compiling natively, 
> use the ipfs from #$output as you're doing, when cross-compiling, use 
> the ipfs from $PATH:
> 
>    (with-output-to-file (string-append completiondir "/ipfs")
>      (invoke #$(if (%current-target-system)
>                    "ipfs"
>                    #~(string-append #$output "/bin/ipfs"))
>              "commands" "completion" "bash"))
> 

Oops that incorrect, with-output-to-file is not a macro but a procedure 
accepting a thunk, try

(with-output-to-file [...]
   (lambda ()
     (invoke ...)))

instead.