Re: share guix and its store between distributions

2023-10-12 Thread Simon Tournier
Hi,

On Wed, 11 Oct 2023 at 17:56, Emmanuel Beffara  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



Re: share guix and its store between distributions

2023-10-11 Thread Emmanuel Beffara
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



Re: share guix and its store between distributions

2023-10-11 Thread Simon Tournier
Hi,

On Mon, 09 Oct 2023 at 10:43, Emmanuel Beffara  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





Re: share guix and its store between distributions

2023-10-09 Thread Emmanuel Beffara
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



Re: share guix and its store between distributions

2023-10-08 Thread Efraim Flashner
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  רנשלפ םירפא
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted


signature.asc
Description: PGP signature


Re: share guix and its store between distributions

2023-10-05 Thread Daniel Littlewood
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  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
>



Re: share guix and its store between distributions

2023-10-05 Thread Felix Lechner via
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



share guix and its store between distributions

2023-10-05 Thread Emmanuel Beffara
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