[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: foreign-distro?
From: |
Julien Lepiller |
Subject: |
Re: foreign-distro? |
Date: |
Sun, 20 Nov 2022 23:08:33 +0100 |
Le Sun, 20 Nov 2022 14:54:40 -0600,
jgart <jgart@dismail.de> a écrit :
> Does Guix have a declarative Guix API way of knowing if it is
> installing a package into foreign distro versus Guix System?
>
> I'm thinking of a function like `foreign-distro?`:
>
> ```
> (define-public peek
> (package
> (name "peek")
> ...
> (inputs
> `(,@(if (foreign-distro?) `(("ffmpeg" ,ffmpeg)) '())))
> ```
>
> The above includes ffmpeg in the inputs only if installing peek on a
> foreign distro. It could additionally patch the ffmpeg executable in
> a peek package phases if foreign-distro? returns #t.
>
> WDYT
>
Guix doesn't have a notion of foreign distro, it's all in your head,
and there's no difference between Guix System and other distros in the
Guix package manager's point of view :)
To be more specific, Guix only knows what you current system is (that's
captured by %current-system). It's probably x86_64-linux right know. As
you can see, there's no place in there to tell it whether you're on a
foreign distro or not.
Lastly, I don't think I would want to differentiate the two cases,
especially since it would mean that somehow Guix packages depend on
something external. There's this idea that Guix packages should somehow
be self-sufficient.