How to debug an overridden dependency when using flakes?

Is there a way to step through an overridden package’s phases when using flakes? I know you can step through an existing flake’s phases by using nix develop <flake>#<output>. Is there a way to do this for a dependency of the current flake?

As an example:

# flake.nix
  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs/unstable";
    utils = {
      url = "github:numtide/flake-utils";
      inputs.nixpkgs.follows = "nixpkgs";

  outputs = {
  }: let
    out = system: let
      pkgs = import nixpkgs { inherit system; };
      inherit (pkgs) poetry2nix;
      python = pkgs.python39;
      pythonEnv = poetry2nix.mkPoetryEnv {
        inherit python;
        projectDir = ./.;
        preferWheels = true;
        overrides = poetry2nix.overrides.withDefaults (pyfinal: pyprev: {
          soundfile = pyprev.soundfile.overridePythonAttrs (old: {
            postPatch = "(do some stuff)";
    in {
      devShell = pkgs.mkShell {
        buildInputs = [pythonEnv];
    with utils.lib; eachSystem defaultSystems out;

Imagine the soundfile package is having some issues in this flake, and I want to see what my override is doing. I would like to step through the packages phases with my override applied and inspect the directory contents at each phase?

I thought maybe I could set python.pkgs.soundfile as a flake output called soundfile and run nix develop .#soundfile on it, but I get:

error: flake output attribute 'soundfile' is not a derivation

Is there a good way to do this?

Thank you!

I found out that you can develop stored derivation like this:
nix develop /nix/store/nqa4b0229rznr59pncm4n2pkhr9bnc7r-python3.10-annotated-types-0.6.0.drv