all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* share guix and its store between distributions
@ 2023-10-05 15:03 Emmanuel Beffara
  2023-10-05 15:42 ` Felix Lechner via
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Emmanuel Beffara @ 2023-10-05 15:03 UTC (permalink / raw)
  To: help-guix

Hello Guix,

Is there a way to share Guix and its store between several distributions?

My situation is that I have a Guix system installed as my main system, but I
would like to install another distribution on the same machine (a current
Debian, specifically) and use Guix as a package manager there, in order to
benefit from its ability to create reproducible environments. 

Of course, it works to have the other distribution completely independent,
with its own Guix store. The only thing is to handle Grub correctly to give
access to both distros. But it feels like a significant waste of resources,
since I will end up having many things in both stores.

Moreover, ideally I would like to share home directories between the two
distributions, by mounting the same partition as /home, and still be able to
use `guix home` and `guix shell` in both distributions. By some minimal
tuning, I can make it so that users have the same UIDs and GIDs in both
distributions. But I imagine that using Guix in both distributions can become
problematic if they don't share the store and the state in `/var/guix`, for
instance if they don't share GC roots.

Is there a proper way to make that work? Or is it a bad idea?

-- 
Emmanuel


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: share guix and its store between distributions
  2023-10-05 15:03 share guix and its store between distributions Emmanuel Beffara
@ 2023-10-05 15:42 ` Felix Lechner via
  2023-10-05 16:11 ` Daniel Littlewood
  2023-10-08  7:03 ` Efraim Flashner
  2 siblings, 0 replies; 8+ messages in thread
From: Felix Lechner via @ 2023-10-05 15:42 UTC (permalink / raw)
  To: Emmanuel Beffara, help-guix

Hi Emmanual,

On Thu, Oct 05 2023, Emmanuel Beffara wrote:

> Is there a proper way to make that work? Or is it a bad idea?

I used Debian for twenty-five years and switched to GNU Guix eighteen
months ago. I see no reason to run both, but I also like being at the
frontier. Why do you need Debian?

Kind regards
Felix


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: share guix and its store between distributions
  2023-10-05 15:03 share guix and its store between distributions Emmanuel Beffara
  2023-10-05 15:42 ` Felix Lechner via
@ 2023-10-05 16:11 ` Daniel Littlewood
  2023-10-08  7:03 ` Efraim Flashner
  2 siblings, 0 replies; 8+ messages in thread
From: Daniel Littlewood @ 2023-10-05 16:11 UTC (permalink / raw)
  To: Emmanuel Beffara; +Cc: help-guix

Hi Emmanuel,

Do you expect to share exactly the same packages in Debian vs guix, or
just an overlapping subset?

I assume that if the packages are the same, and they're building the
same versions, then the hash identifying them should be the same, and
guix should refrain from rebuilding the package (and simply set up the
link to the store). If they aren't the same, then you have to make
sure the system A does not clean up any packages used by system B and
not system A. I guess this is why you mention GC roots. My gut feeling
is that that will be a lot more complicated, because you have to trick
guix into getting its garbage collection "wrong".

Perhaps you could keep the two stores separate, but mount them as a
union file system? So system A would mount system B's store into its
own, read-only. System B would be able to build additional packages
not found in A, but could not clean up system A's packages. I don't
know how guix would react to such a permission error. I think it
expects to be the only master of the store.

All the best,
Dan

On Thu, Oct 5, 2023 at 4:04 PM Emmanuel Beffara <manu@beffara.org> wrote:
>
> Hello Guix,
>
> Is there a way to share Guix and its store between several distributions?
>
> My situation is that I have a Guix system installed as my main system, but I
> would like to install another distribution on the same machine (a current
> Debian, specifically) and use Guix as a package manager there, in order to
> benefit from its ability to create reproducible environments.
>
> Of course, it works to have the other distribution completely independent,
> with its own Guix store. The only thing is to handle Grub correctly to give
> access to both distros. But it feels like a significant waste of resources,
> since I will end up having many things in both stores.
>
> Moreover, ideally I would like to share home directories between the two
> distributions, by mounting the same partition as /home, and still be able to
> use `guix home` and `guix shell` in both distributions. By some minimal
> tuning, I can make it so that users have the same UIDs and GIDs in both
> distributions. But I imagine that using Guix in both distributions can become
> problematic if they don't share the store and the state in `/var/guix`, for
> instance if they don't share GC roots.
>
> Is there a proper way to make that work? Or is it a bad idea?
>
> --
> Emmanuel
>


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: share guix and its store between distributions
  2023-10-05 15:03 share guix and its store between distributions Emmanuel Beffara
  2023-10-05 15:42 ` Felix Lechner via
  2023-10-05 16:11 ` Daniel Littlewood
@ 2023-10-08  7:03 ` Efraim Flashner
  2023-10-09  8:43   ` Emmanuel Beffara
  2 siblings, 1 reply; 8+ messages in thread
From: Efraim Flashner @ 2023-10-08  7:03 UTC (permalink / raw)
  To: Emmanuel Beffara; +Cc: help-guix

[-- Attachment #1: Type: text/plain, Size: 2011 bytes --]

On Thu, Oct 05, 2023 at 05:03:49PM +0200, Emmanuel Beffara wrote:
> Hello Guix,
> 
> Is there a way to share Guix and its store between several distributions?
> 
> My situation is that I have a Guix system installed as my main system, but I
> would like to install another distribution on the same machine (a current
> Debian, specifically) and use Guix as a package manager there, in order to
> benefit from its ability to create reproducible environments. 
> 
> Of course, it works to have the other distribution completely independent,
> with its own Guix store. The only thing is to handle Grub correctly to give
> access to both distros. But it feels like a significant waste of resources,
> since I will end up having many things in both stores.
> 
> Moreover, ideally I would like to share home directories between the two
> distributions, by mounting the same partition as /home, and still be able to
> use `guix home` and `guix shell` in both distributions. By some minimal
> tuning, I can make it so that users have the same UIDs and GIDs in both
> distributions. But I imagine that using Guix in both distributions can become
> problematic if they don't share the store and the state in `/var/guix`, for
> instance if they don't share GC roots.
> 
> Is there a proper way to make that work? Or is it a bad idea?

It looks like you already have the right idea. You'd have to share /gnu
and /var/guix between the two distributions, as well as have the same
UID (and possibly GID) for the users. You would also have to tell Guix's
grub to also add an entry for Debian.

I don't know if you'd end up having issues with graphical programs from
Guix overriding environment variables for Debian or if there might be
issues with guix-home with a foreign distro.

-- 
Efraim Flashner   <efraim@flashner.co.il>   רנשלפ םירפא
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: share guix and its store between distributions
  2023-10-08  7:03 ` Efraim Flashner
@ 2023-10-09  8:43   ` Emmanuel Beffara
  2023-10-11 12:45     ` Simon Tournier
  0 siblings, 1 reply; 8+ messages in thread
From: Emmanuel Beffara @ 2023-10-09  8:43 UTC (permalink / raw)
  To: Efraim Flashner; +Cc: help-guix

Hello,

Thanks for the feedback.

De Efraim Flashner le 08/10/2023 à 09:03:
> > Is there a way to share Guix and its store between several distributions?
> > [...]
> 
> It looks like you already have the right idea. You'd have to share /gnu
> and /var/guix between the two distributions, as well as have the same
> UID (and possibly GID) for the users.

If I know for sure that there is no state anywhere else than that, then it
looks fine. I was worried that running Guix's daemon and command would leave
things inconsistent otherwise.

> You would also have to tell Guix's grub to also add an entry for Debian.

I already do that by adding a menu-entry by hand. It works because Debian
stores its kernel and initrd in a predictable place. I just have to refrain
Debian from updating grub itself, otherwise the entries for Guix system
disappear. I guess this kind of problem occurs whenever one tries to set up
multiboot with a single Grub for several distributions, anyway.

> I don't know if you'd end up having issues with graphical programs from
> Guix overriding environment variables for Debian or if there might be
> issues with guix-home with a foreign distro.

So far there have been some issues with programs from my home Guix profile
behaving differently when run from Debian. I still have to explore a bit to
diagnose this.

As for other replies I got:

From Felix Lechner:
> I used Debian for twenty-five years and switched to GNU Guix eighteen months
> ago. I see no reason to run both, but I also like being at the frontier. Why
> do you need Debian?

I intend to keep Guix as my regular system as it has provided me some benefits
already. But some tools that I have to use occasionally are not (yet)
available in Guix and might be available in Debian or provided as binaries
that often rely implicitly on FHS (I try to use Flatpak or Guix containers
for those, but even that is not enough on some rare occasions).

Also, some services behave differently between distributions and support for
some hardware also varies (for instance I have a USB-C dock that fully works
on Debian and only partially on Guix). For such cases, having two systems to
compare can be instructive and beneficial for both.

From Daniel Littlewood:
> Do you expect to share exactly the same packages in Debian vs guix, or
> just an overlapping subset?

More like an overlapping subset. In Debian would like to use Debian-provided
packages as much as possible and only rely on Guix for custom packages I made
or reproducible environments.

> I assume that if the packages are the same, and they're building the
> same versions, then the hash identifying them should be the same, and
> guix should refrain from rebuilding the package (and simply set up the
> link to the store). If they aren't the same, then you have to make
> sure the system A does not clean up any packages used by system B and
> not system A. I guess this is why you mention GC roots. My gut feeling
> is that that will be a lot more complicated, because you have to trick
> guix into getting its garbage collection "wrong".

Indeed that is the kind of problem I would like to avoid, hence the idea of
sharing Guix's state bewteen systems. I would certainly like to avoid
"tricks" to make things work.

-- 
Emmanuel


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: share guix and its store between distributions
  2023-10-09  8:43   ` Emmanuel Beffara
@ 2023-10-11 12:45     ` Simon Tournier
  2023-10-11 15:56       ` Emmanuel Beffara
  0 siblings, 1 reply; 8+ messages in thread
From: Simon Tournier @ 2023-10-11 12:45 UTC (permalink / raw)
  To: Emmanuel Beffara, Efraim Flashner; +Cc: help-guix

Hi,

On Mon, 09 Oct 2023 at 10:43, Emmanuel Beffara <manu@beffara.org> wrote:

>> > Is there a way to share Guix and its store between several distributions?
>> > [...]
>> 
>> It looks like you already have the right idea. You'd have to share /gnu
>> and /var/guix between the two distributions, as well as have the same
>> UID (and possibly GID) for the users.
>
> If I know for sure that there is no state anywhere else than that, then it
> looks fine. I was worried that running Guix's daemon and command would leave
> things inconsistent otherwise.

Just to mention that I do not know what happens with the store database
if you run concurrently two guix-daemon.

For your use-case, it should be ok, though. :-)  Since you will run only
one guix-daemon at one time.

Cheers,
simon




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: share guix and its store between distributions
  2023-10-11 12:45     ` Simon Tournier
@ 2023-10-11 15:56       ` Emmanuel Beffara
  2023-10-11 20:14         ` Simon Tournier
  0 siblings, 1 reply; 8+ messages in thread
From: Emmanuel Beffara @ 2023-10-11 15:56 UTC (permalink / raw)
  To: Simon Tournier; +Cc: Efraim Flashner, help-guix

De Simon Tournier le 11/10/2023 à 14:45:
> Just to mention that I do not know what happens with the store database
> if you run concurrently two guix-daemon.
> 
> For your use-case, it should be ok, though. :-)  Since you will run only
> one guix-daemon at one time.

Indeed, I am not bold enough to run two guix daemons at the same time !

For now, sharing /gnu and /var/guix, things seem to be working. I can use
`guix shell` for custom environments and can do `guix home reconfigure` to
manage a home profile and things seems to work.

Some guix packages behave differently between Guix system and Debian, I will
investigate those on occasion. For instance, the bower mail reader from Guix
has some issues with Unicode when run in Debian and I don't understand why
yet.

-- 
Emmanuel


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: share guix and its store between distributions
  2023-10-11 15:56       ` Emmanuel Beffara
@ 2023-10-11 20:14         ` Simon Tournier
  0 siblings, 0 replies; 8+ messages in thread
From: Simon Tournier @ 2023-10-11 20:14 UTC (permalink / raw)
  To: Emmanuel Beffara; +Cc: Efraim Flashner, help-guix

Hi,

On Wed, 11 Oct 2023 at 17:56, Emmanuel Beffara <manu@beffara.org> wrote:

> Some guix packages behave differently between Guix system and Debian, I will
> investigate those on occasion. For instance, the bower mail reader from Guix
> has some issues with Unicode when run in Debian and I don't understand why
> yet.

Yes, on Debian it fails for me too,

    $ guix shell --pure bower gnupg --  bower

Well, it is about an environment variable.  For instance, this works for
me:

--8<---------------cut here---------------start------------->8---
$ env | grep -E '^(LANG|_)'
LANG=en_GB.UTF-8
_=/usr/bin/env

$ guix shell --pure bower gnupg  -E TERM -E LANG -E _ --  bower
--8<---------------cut here---------------end--------------->8---

And then it fails with --container.  Hum, I do not know.


Cheers,
simon


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-10-12  8:08 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-05 15:03 share guix and its store between distributions Emmanuel Beffara
2023-10-05 15:42 ` Felix Lechner via
2023-10-05 16:11 ` Daniel Littlewood
2023-10-08  7:03 ` Efraim Flashner
2023-10-09  8:43   ` Emmanuel Beffara
2023-10-11 12:45     ` Simon Tournier
2023-10-11 15:56       ` Emmanuel Beffara
2023-10-11 20:14         ` Simon Tournier

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.