[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Persistent environment variable
From: |
Wojtek Kosior |
Subject: |
Re: Persistent environment variable |
Date: |
Mon, 5 Dec 2022 22:23:39 +0100 |
> Hi List
>
> Is there a possibility to set an environment variable in a package
> recipe which is persistent after the build of the package? So if you
> would install the package the environment variable is present then.
> Or is this an anti pattern?
>
> Thanks for any inputs.
>
> Cheers,
> Reza
>
For exporting various kinds of *search paths* in environment variables,
there's a special facility described here[1].
Alternatively, if in your use case it is sufficient to have the
variable always passed to some Guix-created executable, you might want
to look at the `wrap-program` function from `(guix build utils)`. You
can look at how it is used by existing packages. For things like this I
usually use a command like
grep -RE 'wrap-prog' -A10 -B2
~/.config/guix/current/share/guile/site/3.0/gnu/packages | less
Unfortunately, I don't feel competent enough to say whether something
is an anti-pattern. If any of those 2 solutions fits your needs, that's
great. If not, I hope someone else will help you out :)
Wojtek
[1] https://guix.gnu.org/manual/devel/en/html_node/Search-Paths.html
-- (sig_start)
website: https://koszko.org/koszko.html
PGP: https://koszko.org/key.gpg
fingerprint: E972 7060 E3C5 637C 8A4F 4B42 4BC5 221C 5A79 FD1A
Meet Kraków saints! #14: saint Jan Kanty
Poznaj świętych krakowskich! #14: święty Jan Kanty
https://pl.wikipedia.org/wiki/Jan_Kanty
-- (sig_end)
On Mon, 5 Dec 2022 21:38:14 +0100
Reza Housseini <reza.housseini@gmail.com> wrote:
> Hi List
>
> Is there a possibility to set an environment variable in a package
> recipe which is persistent after the build of the package? So if you
> would install the package the environment variable is present then.
> Or is this an anti pattern?
>
> Thanks for any inputs.
>
> Cheers,
> Reza
>
pgpJyWXAgZOsd.pgp
Description: OpenPGP digital signature