Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 9c0577447cdb
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 5518ccfa7e83
Choose a head ref
  • 2 commits
  • 1 file changed
  • 2 contributors

Commits on Jun 10, 2017

  1. Copy the full SHA
    7116da8 View commit details
  2. Merge pull request #26501 from knedlsepp/add-python-overlay-example

    Python docs: Add example for overlays
    Mic92 authored Jun 10, 2017
    Copy the full SHA
    5518ccf View commit details
Showing with 22 additions and 0 deletions.
  1. +22 −0 doc/languages-frameworks/python.md
22 changes: 22 additions & 0 deletions doc/languages-frameworks/python.md
Original file line number Diff line number Diff line change
@@ -923,6 +923,28 @@ If you need to change a package's attribute(s) from `configuration.nix` you coul

If you are using the `bepasty-server` package somewhere, for example in `systemPackages` or indirectly from `services.bepasty`, then a `nixos-rebuild switch` will rebuild the system but with the `bepasty-server` package using a different `src` attribute. This way one can modify `python` based software/libraries easily. Using `self` and `super` one can also alter dependencies (`buildInputs`) between the old state (`self`) and new state (`super`).

### How to override a Python package using overlays?

To alter a python package using overlays, you would use the following approach:

```nix
self: super:
rec {
python = super.python.override {
packageOverrides = python-self: python-super: {
bepasty-server = python-super.bepasty-server.overrideAttrs ( oldAttrs: {
src = self.pkgs.fetchgit {
url = "https://github.com/bepasty/bepasty-server";
sha256 = "9ziqshmsf0rjvdhhca55sm0x8jz76fsf2q4rwh4m6lpcf8wr0nps";
rev = "e2516e8cf4f2afb5185337073607eb9e84a61d2d";
};
});
};
};
pythonPackages = python.pkgs;
}
```

## Contributing

### Contributing guidelines