From 118fe7ba67e9a5b53cacee960d3fd87a0894390d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Thu, 30 Nov 2023 14:48:17 +0100 Subject: [PATCH] feat(templates): use poetry2nix for template --- templates/python/.envrc | 5 ----- templates/python/shell.nix | 11 ++++++++++- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/templates/python/.envrc b/templates/python/.envrc index 8fa86e1..1d953f4 100644 --- a/templates/python/.envrc +++ b/templates/python/.envrc @@ -1,6 +1 @@ use nix -export PYTHONPATH="$(pwd)/src:$PYTHONPATH" -if [ ! -z $NIX_LD ]; then - export LD_LIBRARY_PATH=$NIX_LD_LIBRARY_PATH -fi -layout poetry diff --git a/templates/python/shell.nix b/templates/python/shell.nix index 6196009..65e0220 100644 --- a/templates/python/shell.nix +++ b/templates/python/shell.nix @@ -1,5 +1,14 @@ { pkgs ? import { } }: +let + poetry2nix = import (fetchTarball "https://github.com/nix-community/poetry2nix/archive/master.tar.gz") { }; + project = + poetry2nix.mkPoetryApplication { + projectDir = ./.; + preferWheels = true; + }; +in pkgs.mkShell { - buildInputs = with pkgs; [ python3 poetry ]; + inputsFrom = [ project ]; + packages = [ pkgs.poetry ]; }