dotfiles/templates/poetry/flake.nix

51 lines
1.2 KiB
Nix
Raw Normal View History

2022-06-21 03:34:24 +00:00
{
description = "Python project flake";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs";
poetry2nix.url = "github:nix-community/poetry2nix";
};
2024-04-20 13:42:06 +00:00
outputs =
{ 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
{
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
}