diff options
author | worldofpeace <worldofpeace@users.noreply.github.com> | 2019-03-24 05:33:07 -0400 |
---|---|---|
committer | worldofpeace <worldofpeace@users.noreply.github.com> | 2019-03-24 05:33:07 -0400 |
commit | 0ccfebf9f26f87b13e933c67e74cf4895cfa2fdf (patch) | |
tree | 6f637a6af7027ec79371c68644f121824f5ca74e /doc | |
parent | 94a409450a1773d12b44e0bec40fbd099f9fb883 (diff) |
fix Including a derivation using callPackage
The example didn't use pkgs.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/languages-frameworks/python.section.md | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/doc/languages-frameworks/python.section.md b/doc/languages-frameworks/python.section.md index 25b2b728bdf9f..9d49eb9e17ad9 100644 --- a/doc/languages-frameworks/python.section.md +++ b/doc/languages-frameworks/python.section.md @@ -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` ```nix -{ lib, pkgs, buildPythonPackage }: +{ lib, buildPythonPackage }: buildPythonPackage rec { 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 ```nix with import <nixpkgs> {}; ( let - toolz = pkgs.callPackage /path/to/toolz/release.nix { - pkgs = pkgs; - buildPythonPackage = pkgs.python35Packages.buildPythonPackage; + toolz = callPackage /path/to/toolz/release.nix { + buildPythonPackage = python35Packages.buildPythonPackage; }; - in pkgs.python35.withPackages (ps: [ ps.numpy toolz ]) + in python35.withPackages (ps: [ ps.numpy toolz ]) ).env ``` |