feat(templates): use poetry2nix for template

This commit is contained in:
Moritz Böhme 2023-11-30 14:48:17 +01:00
parent 70e95a1ea4
commit 118fe7ba67
2 changed files with 10 additions and 6 deletions

View file

@ -1,6 +1 @@
use nix use nix
export PYTHONPATH="$(pwd)/src:$PYTHONPATH"
if [ ! -z $NIX_LD ]; then
export LD_LIBRARY_PATH=$NIX_LD_LIBRARY_PATH
fi
layout poetry

View file

@ -1,5 +1,14 @@
{ pkgs ? import <nixpkgs> { } }: { pkgs ? import <nixpkgs> { } }:
let
poetry2nix = import (fetchTarball "https://github.com/nix-community/poetry2nix/archive/master.tar.gz") { };
project =
poetry2nix.mkPoetryApplication {
projectDir = ./.;
preferWheels = true;
};
in
pkgs.mkShell { pkgs.mkShell {
buildInputs = with pkgs; [ python3 poetry ]; inputsFrom = [ project ];
packages = [ pkgs.poetry ];
} }