Dev Shell with Poetry2Nix Flake

I’d like to create a development shell using a flake (see below). Unfortunately, as constructed the flake results in the following error. Help understanding and resolving this error is appreciated.

error: opening file ‘/nix/store/5h8xxrd8i6w2plh4jfcz87s2ap8wzrnq-source/poetry.lock’: No such file or directory
realpath: /Users/danke/Projects/app/.direnv/flake-profile.8331: No such file or directory

{
  description = "Development shell.";

  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
    poetry2nix = {
      url = "github:nix-community/poetry2nix";
      inputs.nixpkgs.follows = "nixpkgs";
    };
  };

  outputs = { self, nixpkgs, poetry2nix, ... } @ inputs:
    let
      system = "aarch64-darwin";
      pkgs = import nixpkgs {
        inherit system;
      };
      inherit (poetry2nix.lib.mkPoetry2Nix { inherit pkgs; }) mkPoetryEnv;
      pythonEnv = mkPoetryEnv {
        python = pkgs.python311;
        projectDir = ./.;
      };
    in
    {
      devShells.${system}.default = pkgs.mkShell {
        packages = with pkgs; [
          ansible_2_14
          awscli2
          nodejs_18
          nodePackages.prettier
          poetry
          pythonEnv
          terraform
          terraform-ls
        ];
      };
    };
}

Did you add poetry.lock file to git?

:man_facepalming: No, I hadn’t.

Adding the poetry.lock file to git resolved the issue. For my understanding, is that a flake requirement? Thanks.