On Thu, Oct 26, 2017 at 11:46:52PM +0200, Ricardo Wurmus wrote: > Hi, > > this blog post contains many great examples of how to deploy Guix > applications without root access: > > > http://guix-hpc.bordeaux.inria.fr/blog/2017/10/using-guix-without-being-root/ > > I think that all of these methods should be wrapped up by Guix itself, > so that none of this has to be done manually. I’d also like to include > Pjotr’s hack in this, which involves rewriting /gnu/store references. > It’s icky but effective and one of the reasons why Conda is so popular > (they rewrite references in their binaries as well, but less principled > than, say, grafts). > > How about an extension of “guix pack” that will rewrite the /gnu/store > references to a user-provided directory before bundling things up in a > tarball? I’d *really* like to be able to just use the tarball bundle > “guix pack” produces by default, but currently deploying it requires > root access or proot shenanigans at runtime. > > How about making manual hacking with unshare and chroot obsolete by > including a simple executable in the pack that handles this rewriting > for the user…? With that we would be one step closer to the user > experience of Docker — without having a runtime dependency on Docker.
I wrote a fast executable in D that does that https://gitlab.com/pjotrp/guix-relocate/blob/master/src/main.d It is part of my installer which I wrote in Ruby (sorry, I know ;) https://gitlab.com/pjotrp/gnu-install-bin/blob/master/bin/gnu-install-bin Note it first uses Nix's patchelf and then the D program - I could have linked the two, but did not bother. The logic is here: https://gitlab.com/pjotrp/gnu-install-bin/blob/master/lib/installer.rb I remember sweating over this in a dark hotel in Zanzibar last winter. There was a heat wave and the airco was ineffective. It was a fun thing to do, even so. Pj