[Nix-dev] per project env conf

Aaron Levin vilevin at gmail.com
Mon Mar 2 15:58:25 CET 2015


Is there a non-python-specific version that does something similar to
`buildPythonPackage`? I use `myEnvFun` fairly extensively and have not
found a better replacement. I've seen Brian McKenna use `runCommand "dummy"
{ .. }` (see:
https://github.com/puffnfresh/bam-idris-blog/blob/master/shell.nix#L4) but
this doesn't seem ideal and it's unclear if this feature is less or more
documented than `myEnvFun`.

thanks.

On Mon, Mar 2, 2015 at 5:14 AM, Domen Kožar <domen at dev.si> wrote:

> 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
>
> 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
>>
>>
>
> _______________________________________________
> nix-dev mailing list
> nix-dev at lists.science.uu.nl
> http://lists.science.uu.nl/mailman/listinfo/nix-dev
>
>


-- 
Aaron Levin / Weird Canada
www.aaronlevin.ca / www.weirdcanada.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.science.uu.nl/pipermail/nix-dev/attachments/20150302/839e252d/attachment.html 


More information about the nix-dev mailing list