Hi Marek,

On Fri, Feb 07 2025, Roman Riabenko via wrote:

> Hello, Marek.
>
> On Thu, 06 Feb 2025 12:38:38 +0100
> Marek Paśnikowski <ma...@marekpasnikowski.pl> wrote:
>
>> In return I would like to ask, how should I go about making the 
>> `#!/bin/bash` line
>> of the bash script dynamic and responsive to the updates of Bash in Guix?
>
> I can comment on this one. That line, which is often referred to as a
> shebang, requires a full path to bash. However, a generic approach for
> determining it also works on a Guix System.
>
> ```
> $ type bash
> bash is /run/current-system/profile/bin/bash
> ```
>
> That path is a symlink to the current version of bash in the system.
> You can verify it if you wish.
>
> ```
> $ ls -l /run/current-system/profile/bin/bash
> lrwxrwxrwx 1 root root 64 Jan  1 1970 /run/current-system/profile/bin/bash
> -> /gnu/store/cdwviyfnsfv7k57qrwmym0mrynjixc1i-bash-5.1.16/bin/bash
> ```
>
> The environment is using a symlink, so the script may use the same 
> with the shebang `#!/run/current-system/profile/bin/bash`.

Roman gave you a nice solution (and I have not used Jekyll) but that
only works when the program is in your root profile.  It may be okay for
Bash.

The generalized solution has three alternatives: (1) place your script
in the store with mixed-text-file; (2) use string-append like here [a]
when packaging or (3) use file-append like anywhere in this file [b]
when staying in your system configuration.

Kind regards
Felix

[a] 
https://codeberg.org/lechner/juix/src/commit/a91283dca5e6188adce948d7ab6375a346cb5e78/juix/deploy/guile-pam.scm#L97
[b] 
https://codeberg.org/lechner/system-config/src/branch/history/host/wallace-server/operating-system.scm

Reply via email to