2022-06-21 03:34:24 +00:00
|
|
|
{
|
|
|
|
description = "Python project flake";
|
2024-06-05 17:53:27 +00:00
|
|
|
inputs = {
|
|
|
|
nixpkgs.url = "github:NixOS/nixpkgs";
|
|
|
|
poetry2nix.url = "github:nix-community/poetry2nix";
|
|
|
|
};
|
2024-04-20 13:42:06 +00:00
|
|
|
outputs =
|
2024-06-05 17:53:27 +00:00
|
|
|
{ nixpkgs, poetry2nix, ... }:
|
|
|
|
let
|
|
|
|
projectDir = ./.;
|
|
|
|
supportedSystems = [
|
|
|
|
"x86_64-linux"
|
|
|
|
"x86_64-darwin"
|
|
|
|
"aarch64-linux"
|
|
|
|
"aarch64-darwin"
|
|
|
|
];
|
|
|
|
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
|
|
|
|
in
|
2024-04-20 13:42:06 +00:00
|
|
|
{
|
2024-06-05 17:53:27 +00:00
|
|
|
packages = forAllSystems (
|
|
|
|
system:
|
|
|
|
let
|
|
|
|
pkgs = import nixpkgs {
|
|
|
|
inherit system;
|
|
|
|
overlays = [ poetry2nix.overlays.default ];
|
|
|
|
};
|
|
|
|
in
|
|
|
|
{
|
|
|
|
default = pkgs.poetry2nix.mkPoetryApplication { inherit projectDir; };
|
|
|
|
}
|
|
|
|
);
|
|
|
|
devShells = forAllSystems (
|
|
|
|
system:
|
|
|
|
let
|
|
|
|
pkgs = import nixpkgs {
|
|
|
|
inherit system;
|
|
|
|
overlays = [ poetry2nix.overlays.default ];
|
|
|
|
};
|
|
|
|
in
|
|
|
|
{
|
|
|
|
default = pkgs.mkShell {
|
|
|
|
buildInputs = [
|
|
|
|
(pkgs.poetry2nix.mkPoetryEnv { inherit projectDir; })
|
|
|
|
pkgs.poetry
|
|
|
|
];
|
|
|
|
};
|
|
|
|
}
|
|
|
|
);
|
|
|
|
};
|
2022-06-21 03:34:24 +00:00
|
|
|
}
|