devShells and poetry2nix

Has anyone used devShells with poetry2nix? I’m comfortable enough with devshells for non-python development. I’m comfortable enough that I could even use plain old poetry in a devShell, but that will use poetry virtualenvs. If I want to use poetry2nix, however, I’m running into problems because the devShell wants pyproject.toml and poetry.lock to live alongside the devshell, but the poetry tool wants them to live with the source

.envrc:

nix_direnv_watch_file ~/src/nix-config/dev-shells/python_pyramid/default.nix
use flake ~/src/nix-config#python_pyramid

devshell in python_pyramid/default.nix:

{ pkgs ? import <nixpkgs> {} }:
let
  pythonEnv = pkgs.poetry2nix.mkPoetryEnv {
    projectDir = ./.;
  };
in pkgs.mkShell {
  buildInputs = [
    pkgs.poetry
    pythonEnv
  ];
}

The error I get:

$ poetry build
Building writers_blocks (0.1.0)
  - Building sdist

'/home/douglas/src/nix-config/dev-shells/python_pyramid/pyproject.toml' is not in the subpath of '/home/douglas/src/writers_blocks' OR one path is relative and the other is absolute.