{
  stdenv,
  rustPlatform,
  lib,
  pkg-config,
  openssl,
  demostf-frontend-node-modules,
}: let
  inherit (lib.sources) sourceByRegex;
in
  rustPlatform.buildRustPackage rec {
    pname = "demostf-frontend";
    version = "0.1.0";

    src = sourceByRegex ../. ["Cargo.*" "(src|build|images|script|style|.sqlx)(/.*)?"];

    buildInputs = [openssl];

    nativeBuildInputs = [pkg-config];

    preBuild = ''
      ln -s ${demostf-frontend-node-modules}/node_modules .
    '';

    doCheck = false;

    cargoLock = {
      lockFile = ../Cargo.lock;
      outputHashes = {
        "jsx-dom-expressions-0.1.0" = "sha256-8AErYTMCG47rEm5x8KZIPEkD4eGPp7/LuRPJUdnWtK0=";
      };
    };
  }
