Your code is ok but the nixpkgs rev 4ecab32 is the initial release of nixos 23.05 from 2023.05
Use the latest commit from https://status.nixos.org/ or archive/nixos-23.05 if rev pinning isn’t necessary
The other issue is that poetry2nix master is supposed to be used with nixos-unstable because the overrides target nixos-unstable poetry2nix/overrides/default.nix at fe0dcb4c9b44162a385f1170895fe6a392ed71b5 · nix-community/poetry2nix · GitHub
but poetry2nix seems to be broken with new nixpkgs right now so see Segmentation fault · Issue #1291 · nix-community/poetry2nix · GitHub, the latest good nixpkgs commit is 3476a10478587dec90acb14ec6bde0966c545cc0