News for hackers. Stuff that matters.
Re:Ruby on Guix by 1_player on Monday August 31, 2015 @09:07AM (#10146608)
Can guix be used somewhat like virtualenv?

I'm not sure I want to install guix on my main Archlinux box, as I don't want conflicts with the existing libraries and applications, but I would very much play with it if it were possible to do something like this:

    guix virtualenv myapp
    cd myapp
    guix activate
    guix install postgres # installs a local postgres installation available only on this "environment"
    guix environment -l myapp.scm # install app dependencies
    <do work>
    guix deactivate
This would be a killer feature for me and I would ditch virtualenv, pip, npm, perhaps Docker in a heartbeat.
Re:Ruby on Guix by rekado on Monday August 31, 2015 @09:17AM (#10146638)
> I'm not sure I want to install guix on my main Archlinux box, as I don't want conflicts with the existing libraries and applications

That's the beauty of functional package management: no global state is modified. Whatever Guix does is restricted to its own namespace, e.g. the /gnu directory. Every package that is built or installed ends up there and is completely isolated from the rest of the system.

To actually use the software you use a link to a profile (which is located in the "local state" directory of Guix).

You can install packages into separate profiles with Guix:

    guix package -p /path/to/dev/profile -i postgresql
Or you can just run a shell in a volatile environment as specified in `myapp.scm`

    guix environment -l myapp.scm
To exit this environment, just exit the shell.

In summary: it can already be used just like you want, but it's much less verbose :)

Re:Ruby on Guix by davexunit on Monday August 31, 2015 @09:20AM (#10146654)
Yes, the 'guix environment' tool is like a language-agnostic virtualenv. Guix does not use or interfere with any components from the host distro, so you can install Guix on top of Arch Linux without fear. We have a binary installation method[0] that isn't too difficult that you can try out. I use Guix on top of an Ubuntu host at work.

For your PostgreSQL example, you'd still need to do things like initialize the DB cluster and start the daemon on your own (the GuixSD distro has a system service for this[1]), but to spawn a shell with the postgres daemon and client programs available you would run:

    guix environment --ad-hoc postgresql
Exiting the sub-shell would do essentially what you had in mind with 'guix deactivate': Make postgresql available for garbage collection (via 'guix gc') if/when nothing else is using it.

[0] https://gnu.org/software/guix/manual/html_node/Binary-Instal...

[1] https://gnu.org/software/guix/manual/html_node/Database-Serv...

Re:Ruby on Guix by 1_player on Monday August 31, 2015 @10:06AM (#10146833)
The point was to install the deps into my project tree, instead of putting everything into /gnu, but to think of it that's not actually much of a problem, it's just personal preference/bikeshedding.

I'm installing it and see how it goes, thanks.

Re:Ruby on Guix by rekado on Monday August 31, 2015 @10:12AM (#10146852)
"Installing" a package with Guix really just means that it is referenced through a link. /gnu is just a cache for "evaluated" package recipes. You could create a profile that contains your symlinks to the items in the store wherever you want, including the currenty directory.

    guix package -p $(pwd)/.guix-profile -i what ever you want
Programmes in this profile can then be executed like so:

    ./.guix-profile/bin/what
But that's not necessary when you could just use `guix environment` and enter a shell where everything is already hooked up.
Re:Ruby on Guix by rokgarbas on Tuesday September 01, 2015 @04:13AM (#10151263)
nix has tools to convert gemfile into nix expressions http://lists.science.uu.nl/pipermail/nix-dev/2015-January/01...