dotfiles/templates/poetry/flake.nix

35 lines
805 B
Nix
Raw Normal View History

2022-06-21 03:34:24 +00:00
{
description = "Python project flake";
inputs.flake-utils.url = "github:numtide/flake-utils";
inputs.nixpkgs.url = "github:NixOS/nixpkgs";
inputs.poetry2nix.url = "github:nix-community/poetry2nix";
2024-04-20 13:42:06 +00:00
outputs =
{
self,
nixpkgs,
flake-utils,
poetry2nix,
}:
flake-utils.lib.eachDefaultSystem (
system:
2022-06-21 03:34:24 +00:00
let
pkgs = import nixpkgs {
inherit system;
overlays = [ poetry2nix.overlay ];
};
projectDir = ./.;
2024-04-20 13:42:06 +00:00
in
{
defaultPackage = pkgs.poetry2nix.mkPoetryApplication { inherit projectDir; };
2022-06-21 03:34:24 +00:00
devShells.default = pkgs.mkShell {
buildInputs = [
(pkgs.poetry2nix.mkPoetryEnv { inherit projectDir; })
pkgs.poetry
];
};
2024-04-20 13:42:06 +00:00
}
);
2022-06-21 03:34:24 +00:00
}