doc/python: simplify packageOverrides example

This commit is contained in:
Doron Behar
2026-04-29 08:55:46 +03:00
parent bfa489d718
commit f8f04a972e
+17 -23
View File
@@ -293,29 +293,23 @@ the overrides for packages in the package set.
```nix
with import <nixpkgs> { };
(
let
python =
let
packageOverrides = self: super: {
pandas = super.pandas.overridePythonAttrs (old: rec {
version = "0.19.1";
src = fetchPypi {
pname = "pandas";
inherit version;
hash = "sha256-JQn+rtpy/OA2deLszSKEuxyttqBzcAil50H+JDHUdCE=";
};
});
};
in
pkgs.python3.override {
inherit packageOverrides;
self = python;
};
in
python.withPackages (ps: [ ps.blaze ])
).env
let
python = pkgs.python3.override {
packageOverrides = self: super: {
pandas = super.pandas.overridePythonAttrs (
finalAttrs: prevAttrs: {
version = "0.19.1";
src = fetchPypi {
pname = "pandas";
inherit (finalAttrs) version;
hash = "sha256-JQn+rtpy/OA2deLszSKEuxyttqBzcAil50H+JDHUdCE=";
};
}
);
};
};
in
(python.withPackages (ps: [ ps.blaze ])).env
```
The next example shows a non trivial overriding of the `blas` implementation to