[Nix-dev] nix-shell with system pkgs

yacine.hmito yacine.hmito at gmail.com
Tue Jan 26 18:03:16 CET 2016


    
Thanks for the answer.
What I am trying to achieve is using nix-shell from a custom derivation. Not a specific one (your solution is on point for that) but any derivation in a set.
I achieved this as I explain in the first message. The problem is that the way I did it, derivations cannot depend on each other. I don't understand why.


Sent from my Samsung device

-------- Original message --------
From: Colin Putney <colin at wiresong.com> 
Date: 26/01/2016  17:55  (GMT+01:00) 
To: Yacine Hmito <yacine.hmito at gmail.com> 
Cc: nix-dev <nix-dev at lists.science.uu.nl> 
Subject: Re: [Nix-dev] nix-shell with system pkgs 



On Mon, Jan 25, 2016 at 3:15 PM, Yacine Hmito <yacine.hmito at gmail.com> wrote:
 So, after this lengthy introduction, these are my questions:

- Is it possible for nix-shell to use pkgs as configured by the systeminstead of evaluating '<nixpkgs>'? Would pointing toward the system's .drv filehelp? If so, how should I proceed?- If it is not possible (yet ? :P), can someone explain to me why myotherpkgcan't find its dependency? This really doesn't make sense to me.
Thanks to anyone who'll be kind enough to answer, and to anyone how has madethis awesome OS.
I'm not sure I understood what you're trying to accomplish, but it sounds like you ought to be able to just do something like this:
Have nixpkgs in your NIX_PATH point to the unstable channel. Something like 
NIX_PATH=nixpkgs=$HOME/.nix-defexpr/channels/nixpkgs-unstable
Then import that in your mypkg.nix file:
let   pkgs = import <nixpkgs> {};   other = pkgs.callPackage ./myotherpkg.nix {};in pkgs.stdenv.mkDerivation {...}

Finally, invoke your shell using your derivation directly:
> nix-shell mypkg.nix
Hope this helps!
-Colin



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.science.uu.nl/pipermail/nix-dev/attachments/20160126/3b6749cf/attachment.html 


More information about the nix-dev mailing list