mirror of
https://github.com/vale981/poetry2nix
synced 2025-03-04 16:51:40 -05:00
Add example showing how to use overrideScope' as a nixpkgs overlay
This commit is contained in:
parent
e195d917f9
commit
e5ddd73773
1 changed files with 29 additions and 0 deletions
29
README.md
29
README.md
|
@ -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:
|
||||
|
|
Loading…
Add table
Reference in a new issue