{inputs, ...}: {
  imports = [
    inputs.git-hooks-nix.flakeModule
  ];

  perSystem = {
    config,
    pkgs,
    ...
  }: {
    pre-commit = {
      check.enable = true;
      settings.hooks = {
        alejandra.enable = true;
        nil.enable = true;
        shellcheck.enable = true;
        prettier.enable = true;
        ruff.enable = true;
        ruff-format.enable = true;
        shfmt.enable = true;
        deadnix = {
          enable = true;
          args = ["-e"];
        };
        statix = {
          enable = true;
          args = ["fix"];
        };
      };
    };

    devShells = {
      default = let
        inherit (config) pre-commit;
      in
        pkgs.mkShell {
          name = "pre-commit-shell";
          shellHook = pre-commit.installationScript;
          packages =
            pre-commit.settings.enabledPackages
            ++ [
              pre-commit.settings.package
              pkgs.ruff-lsp
              pkgs.bash-language-server
              pkgs.vscode-langservers-extracted
            ];
        };
      haskell = pkgs.mkShell {
        name = "haskell";
        packages = builtins.attrValues {
          inherit (pkgs) ghc;
          inherit
            (pkgs.haskellPackages)
            stack
            haskell-language-server
            ormolu
            ;
        };
      };
    };
    formatter = pkgs.alejandra;
  };
}
