poetry2nix/flake.nix
Matthieu Coudron 797970c69d feat: can now call 'nix run' on it
For instance nix run poetry#. -- lock -v or something similar.
you can override the nixpkgs input if you dont want to redownload
it, or just lock everything.
2020-12-30 16:02:00 +01:00

37 lines
961 B
Nix

{
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
{
overlay = import ./overlay.nix;
packages = forAllSystems (system: {
inherit (nixpkgsFor.${system}) poetry;
}
);
apps = forAllSystems (system: {
poetry = {
type = "app";
program = self.packages."${system}".poetry + "/bin/poetry";
};
});
defaultApp = forAllSystems (system:
self.apps."${system}".poetry
);
};
}