{
  stdenv,
  pkgs,
  ...
}: let
  version = "6.0.14";
in
  stdenv.mkDerivation {
    name = "mongodb";
    inherit version;

    src = builtins.fetchTarball {
      url = "https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-debian11-${version}.tgz";
      sha256 = "sha256:0lghfh8dpq159y2m0b7wg3xks2s59n9s5xmcw6ng2lrg815s6aiz";
    };
    dontBuild = true;

    nativeBuildInputs = with pkgs; [
      openssl_1_1
      xz
      curl
      libgcc
      autoPatchelfHook
    ];

    installPhase = ''
      runHook preInstall

      mkdir -p $out/bin
      cp -R bin $out/

      runHook postInstall
    '';
  }
