fix Including a derivation using callPackage
The example didn't use pkgs.
This commit is contained in:
parent
94a409450a
commit
0ccfebf9f2
@ -433,7 +433,7 @@ Let's split the package definition from the environment definition.
|
|||||||
We first create a function that builds `toolz` in `~/path/to/toolz/release.nix`
|
We first create a function that builds `toolz` in `~/path/to/toolz/release.nix`
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
{ lib, pkgs, buildPythonPackage }:
|
{ lib, buildPythonPackage }:
|
||||||
|
|
||||||
buildPythonPackage rec {
|
buildPythonPackage rec {
|
||||||
pname = "toolz";
|
pname = "toolz";
|
||||||
@ -453,18 +453,17 @@ buildPythonPackage rec {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
It takes two arguments, `pkgs` and `buildPythonPackage`.
|
It takes an argument `buildPythonPackage`.
|
||||||
We now call this function using `callPackage` in the definition of our environment
|
We now call this function using `callPackage` in the definition of our environment
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
with import <nixpkgs> {};
|
with import <nixpkgs> {};
|
||||||
|
|
||||||
( let
|
( let
|
||||||
toolz = pkgs.callPackage /path/to/toolz/release.nix {
|
toolz = callPackage /path/to/toolz/release.nix {
|
||||||
pkgs = pkgs;
|
buildPythonPackage = python35Packages.buildPythonPackage;
|
||||||
buildPythonPackage = pkgs.python35Packages.buildPythonPackage;
|
|
||||||
};
|
};
|
||||||
in pkgs.python35.withPackages (ps: [ ps.numpy toolz ])
|
in python35.withPackages (ps: [ ps.numpy toolz ])
|
||||||
).env
|
).env
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user