{
  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
    systems.url = "github:nix-systems/default";
    devenv.url = "github:cachix/devenv";
    nixpkgs-python = {
      url = "github:cachix/nixpkgs-python";
      inputs.nixpkgs.follows = "nixpkgs";
    };
  };

  outputs = {
    self,
    nixpkgs,
    devenv,
    systems,
    ...
  } @ inputs: let
    forEachSystem = nixpkgs.lib.genAttrs (import systems);
  in {
    # packages = forEachSystem (system: {
    #   default =
    #     nixpkgs.legacyPackages.${system}.poetry2nix.mkPoetryApplication
    #     {
    #       projectDir = self;
    #       preferWheels = true;
    #     };
    # });

    devShells =
      forEachSystem
      (system: let
        pkgs = nixpkgs.legacyPackages.${system};
      in {
        default = devenv.lib.mkShell {
          inherit inputs pkgs;

          modules = [
            {
              packages = with pkgs; [pre-commit poethepoet stdenv.cc.cc.lib];

              languages.python = {
                enable = true;
                poetry = {
                  enable = true;
                  install.enable = true;
                  install.groups = ["dev" "analysis" "tests"];
                };
                version = "3.11";
              };
            }
          ];
        };
      });
  };

  nixConfig = {
    extra-trusted-public-keys = "devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw=";
    extra-substituters = "https://devenv.cachix.org";
  };
}
