Here is a trivial solution to the problem of writing a script on Guix.
#!/run/current-system/profile/bin/env -S guile -s
coding: utf-8
!#
(display "Hello, world!\n")
Notice that the path /run/current-system/profile/bin/env
will not exist in other GNU systems such as Ubuntu or Debian. So, how would we take advantage of UNIX's exec
system call without editing the script on other systems?
If you want to keep the script as it is, on the other system (e.g. Debian, Ubuntu, etc.) make env
available at the same location (you may need sudo)
mkdir -p /run/current-system/profile/bin
ln -s /usr/bin/env /run/current-system/profile/bin