[Nix-dev] Using python27 impurely on nixos

Domen Kožar domen at dev.si
Fri Jul 18 14:25:54 CEST 2014


Given default.nix:

  with import <nixpkgs> {};
  with pkgs.python27Packages;

  buildPythonPackage {
    name = "some-env";
    buildInputs = [   git
       libxml2
       libxslt
       libzip
       python27Full
       python27Packages.virtualenv
       stdenv
       zlib ];
    src = null;
  }

You can then run `nix-shell` and have environment ready.

PS: if you're using update unstable channel


On Fri, Jul 18, 2014 at 11:33 AM, Cillian de Róiste <
cillian.deroiste at gmail.com> wrote:

> On Fri, Jul 18, 2014 at 8:23 AM, Cody Goodman
> <codygman.consulting at gmail.com> wrote:
> > I have a python project for the first time since I started using
> > nixos. I would like to simply use this example:
> >
> >
> >
> https://nixos.org/wiki/Howto_develop_software_on_nixos#Example_4:_Python_Web_Development_Nixos_Container
> >
> >    environment = {
> >      systemPackages = with pkgs; [
> >        git
> >        libxml2
> >        libxslt
> >        libzip
> >        python27Full
> >        python27Packages.virtualenv
> >        stdenv
> >        zlib
> >      ];
> >
> >      pathsToLink = [ "/include" ];
> >
> >      shellInit =
> >        # help pip to find libz.so when building lxml
> >        export LIBRARY_PATH=/var/run/current-system/sw/lib
> >        # ditto for header files, e.g. sqlite
> >        export C_INCLUDE_PATH=/var/run/current-system/sw/include
> >      ;
> >    };
> >
> > However I'm not sure where to put this code. It also seems like a few
> > lines are missing at the top. Should this be named? I have no idea how
> > to use this to get an impure pip-installable environment. Can anyone
> > help?
>
> There are a few different ways to use containers:
> http://nixos.org/nixos/manual/#ch-containers so you should be able to
> plug this in to the relevant environment section.
>
> I use this configuration myself regularly, so let me know if you run
> into trouble.
>
> Good luck!
> Cillian
>
> --
> NixOS: The Purely Functional Linux Distribution
> http://nixos.org
> _______________________________________________
> nix-dev mailing list
> nix-dev at lists.science.uu.nl
> http://lists.science.uu.nl/mailman/listinfo/nix-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.science.uu.nl/pipermail/nix-dev/attachments/20140718/0645ecbb/attachment.html 


More information about the nix-dev mailing list