mirror of
https://github.com/vale981/poetry2nix
synced 2025-03-04 16:51:40 -05:00

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.
37 lines
961 B
Nix
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
|
|
);
|
|
};
|
|
}
|