[Nix-dev] Using python27 impurely on nixos

Cody Goodman codygman.consulting at gmail.com
Sat Jul 19 02:05:53 CEST 2014


Cillian, I'll have to checkout containers later. They seem like a
better solution for what I'm doing.

Domen, that worked for me after using a couple shellHook's. I created
an entry on the "Developing software with nix" wiki:

https://nixos.org/wiki/Howto_develop_software_on_nixos#Example_5:_A_simple_impure_environment_to_use_virtualenv.2Fpip_with_nix-shell

On Fri, Jul 18, 2014 at 7:25 AM, Domen Kožar <domen at dev.si> wrote:
> 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
>
>


More information about the nix-dev mailing list