Add example showing how to use overrideScope' as a nixpkgs overlay

This commit is contained in:
adisbladis 2020-07-21 21:18:29 +02:00
parent e195d917f9
commit e5ddd73773
No known key found for this signature in database
GPG key ID: 110BFAD44C6249B7

View file

@ -178,6 +178,35 @@ p2nix.mkPoetryApplication {
}
```
or as a [nixpkgs overlay](https://nixos.org/nixpkgs/manual/#chap-overlays):
```nix
let
pkgs = import <nixpkgs> {
overlays = [
# self & super refers to nixpkgs
(self: super: {
# p2self & p2super refers to poetry2nix
poetry2nix = super.poetry2nix.overrideScope' (p2nixself: p2nixsuper: {
# pyself & pysuper refers to python packages
defaultPoetryOverrides = p2nixsuper.defaultPoetryOverrides.extend (pyself: pysuper: {
my-custom-pkg = super.my-custom-pkg.overridePythonAttrs (oldAttrs: { });
});
});
})
];
};
in pkgs.poetry2nix.mkPoetryApplication {
projectDir = ./.;
}
```
## Contributing
Contributions to this project are welcome in the form of GitHub PRs. Please consider the following before creating PRs: