mirror of
https://github.com/vale981/poetry2nix
synced 2025-03-04 16:51:40 -05:00
Merge remote-tracking branch 'typetetris/fix-flake'
This commit is contained in:
commit
eb4f5d024f
2 changed files with 27 additions and 23 deletions
26
README.md
26
README.md
|
@ -207,6 +207,32 @@ in pkgs.poetry2nix.mkPoetryApplication {
|
|||
}
|
||||
```
|
||||
|
||||
## Using the flake
|
||||
|
||||
For the experimental flakes functionality we provide poetry2nix as a flake providing an overlay
|
||||
to use with [nixpkgs](https://nixos.org/nixpkgs/manual).
|
||||
|
||||
#### Example
|
||||
|
||||
```nix
|
||||
{
|
||||
description = "Your flake using poetry2nix";
|
||||
|
||||
inputs.nixpkgs.url = "github:NixOS/nixpkgs";
|
||||
inputs.utils.url = "github:numtide/flake-utils";
|
||||
inputs.poetry2nix-src.url = "github:nix-community/poetry2nix";
|
||||
|
||||
outputs = {nixpkgs, utils, poetry2nix-src, self}: utils.lib.eachDefaultSystem (system: let
|
||||
|
||||
pkgs = import nixpkgs { inherit system; overlays = [ poetry2nix-src.overlay ]; };
|
||||
|
||||
in
|
||||
{
|
||||
# use pkgs.poetry2nix here.
|
||||
});
|
||||
}
|
||||
```
|
||||
|
||||
## Contributing
|
||||
|
||||
Contributions to this project are welcome in the form of GitHub PRs. Please consider the following before creating PRs:
|
||||
|
|
24
flake.nix
24
flake.nix
|
@ -1,30 +1,8 @@
|
|||
{
|
||||
description = "Poetry2nix flake";
|
||||
|
||||
outputs = { self, nixpkgs }:
|
||||
let
|
||||
# TODO: There must be a better way to provide arch-agnostic flakes..
|
||||
systems = [ "x86_64-linux" "i686-linux" "x86_64-darwin" "aarch64-linux" ];
|
||||
forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f system);
|
||||
# Memoize nixpkgs for different platforms for efficiency.
|
||||
nixpkgsFor = forAllSystems (
|
||||
system:
|
||||
import nixpkgs {
|
||||
inherit system;
|
||||
overlays = [ self.overlay ];
|
||||
}
|
||||
);
|
||||
in
|
||||
outputs = { self }:
|
||||
{
|
||||
|
||||
overlay = import ./overlay.nix;
|
||||
|
||||
# TODO: I feel like `packages` is the wrong place for the poetry2nix attr
|
||||
packages = forAllSystems (
|
||||
system: {
|
||||
inherit (nixpkgsFor.${system}) poetry poetry2nix;
|
||||
}
|
||||
);
|
||||
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue