[Nix-dev] per project env conf
Domen Kožar
domen at dev.si
Tue Mar 3 10:49:10 CET 2015
That snippet is not from Development section, see
http://nixos.org/nixpkgs/manual/#python-development
On Tue, Mar 3, 2015 at 10:45 AM, Catonano <catonano at gmail.com> wrote:
> Domen,
>
> 2015-03-02 11:14 GMT+01:00 Domen Kožar <domen at dev.si>:
>
>> Please don't use myEnvFun, it's not documented and superseeded by
>> nix-shell.
>>
>> See Development/Python section in nixpkgs manual:
>> http://nixos.org/nixpkgs/manual/#python
>>
>
> I appreciate your concern.
>
> I tried wit this (copied from the link you suggested and adjusted for xlrd)
>
>
> with import <nixpkgs> {};
>
> python.buildEnv.override {
> extraLibs = [ pkgs.pythonPackages.xlrd ];
> ignoreCollisions = true;
> }
>
>
> and I get
>
> $ nix-shell
> error: undefined variable ‘python’ at
> "/home/catonano/Taranto/openpuglia/openArpa/default.nix":4:7
>
>
>
> On Mon, Mar 2, 2015 at 9:58 AM, Kirill Elagin <kirelagin at gmail.com> wrote:
>>
>>> I think I figured it out. Here are the steps to get stable nixpkgs:
>>>
>>> ~~~~
>>> $ nix-channel --remove nixos
>>> $ nix-channel --remove nixpkgs
>>> $ nix-channel --add https://nixos.org/channels/nixos-14.12 nixos
>>> $ nix-channel --update
>>> $ ln -s ~/.nix-defexpr/channels/nixos/nixpkgs ~/.nix-defexpr/nixpkgs
>>> $ export NIX_PATH=nixpkgs=$HOME/.nix-defexpr/nixpkgs
>>> ~~~~
>>>
>>> And the last step is to put the last line (`export
>>> NIX_PATH=nixpkgs=$HOME/.nix-defexpr/nixpkgs`) into `~/.profile` or
>>> something like that.
>>>
>>> After this your original `shell.nix` should work without modifications I
>>> suggested in my previous message.
>>>
>>> On Mon, Mar 2, 2015 at 11:29 AM Kirill Elagin <kirelagin at gmail.com>
>>> wrote:
>>>
>>>> That’s because you now have the `nixos` expression instead of `nixpkgs`
>>>> but it is still misleadingly called `nixpkgs`.
>>>> I suggested this to you somewhere mid-February just as the quickest
>>>> solution to get stable nixpkgs because you wanted sass and there were some
>>>> Ruby-related changes going on in master.
>>>>
>>>> Again, the quickest solution now is to replace the first line with:
>>>>
>>>> ~~~~
>>>> let pkgs = (import <nixpkgs> {}).pkgs;
>>>> ~~~~
>>>>
>>>> But it’s probably better to figure things out.
>>>> First of all, it might be the case that Ruby things on master
>>>> stabilised and you’ll be able to switch back to unstable and get sass
>>>> working. I have no idea, as I don’t use Ruby, we need an advise from
>>>> someone who knows what’s going on with Ruby in nixpkgs.
>>>> Another posibility is to be honest and rename the stable nixos channel
>>>> to `nixos` and then set `$NIX_PATH` to
>>>> `nixpkgs=$HOME/.nix-defexpr/channels/nixos/nixpkgs`. There might be a
>>>> better way to do this with `~/.nix-defexpr` but I actually still have no
>>>> idea how it works, so we need someone else’s advice here again.
>>>>
>>>>
>>>> On Sun, Mar 1, 2015 at 5:12 PM Catonano <catonano at gmail.com> wrote:
>>>>
>>>>> 2015-01-15 15:16 GMT+01:00 Luca Bruno <lethalman88 at gmail.com>:
>>>>>
>>>>>> let pkgs = import <nixpkgs> {};
>>>>>> in pkgs.myEnvFun {
>>>>>> name = "openArpa-env";
>>>>>> buildInputs = with pkgs.python27Packages; [
>>>>>> python
>>>>>> xlrd
>>>>>>
>>>>>> ];
>>>>>> };
>>>>>>
>>>>>> Then nix-shell.
>>>>>>
>>>>>
>>>>> This worked. Now I'm back to this little project, as I have to process
>>>>> a new batch of files and the thing doesn't work anymore
>>>>>
>>>>> $ nix-shell
>>>>> error: attribute ‘myEnvFun’ missing, at "/home/catonano/Taranto/
>>>>> openpuglia/openArpa/default.nix":2:4
>>>>>
>>>>> I migh have installed nix-packages from scratch since then, I'm not
>>>>> sure
>>>>>
>>>>> Now it's
>>>>>
>>>>> $ nix-env --version
>>>>> nix-env (Nix) 1.8
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> nix-dev mailing list
>>>>> nix-dev at lists.science.uu.nl
>>>>> http://lists.science.uu.nl/mailman/listinfo/nix-dev
>>>>>
>>>>
>>> _______________________________________________
>>> 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/20150303/e1e14bd5/attachment-0001.html
More information about the nix-dev
mailing list