mirror of
https://github.com/nmasur/dotfiles
synced 2025-07-06 23:40:15 +00:00
add poetry template
This commit is contained in:
27
templates/poetry/flake.nix
Normal file
27
templates/poetry/flake.nix
Normal file
@ -0,0 +1,27 @@
|
||||
{
|
||||
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";
|
||||
|
||||
outputs = { self, nixpkgs, flake-utils, poetry2nix }:
|
||||
flake-utils.lib.eachDefaultSystem (system:
|
||||
let
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
overlays = [ poetry2nix.overlay ];
|
||||
};
|
||||
projectDir = ./.;
|
||||
|
||||
in {
|
||||
defaultPackage =
|
||||
pkgs.poetry2nix.mkPoetryApplication { inherit projectDir; };
|
||||
devShells.default = pkgs.mkShell {
|
||||
buildInputs = [
|
||||
(pkgs.poetry2nix.mkPoetryEnv { inherit projectDir; })
|
||||
pkgs.poetry
|
||||
];
|
||||
};
|
||||
});
|
||||
}
|
Reference in New Issue
Block a user