Merge remote-tracking branch 'typetetris/fix-flake'

This commit is contained in:
adisbladis 2020-11-26 13:49:55 +01:00
commit eb4f5d024f
No known key found for this signature in database
GPG key ID: 110BFAD44C6249B7
2 changed files with 27 additions and 23 deletions

View file

@ -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:

View file

@ -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;
}
);
};
}