{ pkgs ? import <nixpkgs> {} }:

let
  buildMudmouth = packageSet:
    packageSet.rustPlatform.buildRustPackage {
      pname = "mudmouth";
      version = "0.0.2";
      src = ./.;
      cargoLock.lockFile = ./Cargo.lock;
      nativeBuildInputs = [ packageSet.pkg-config ];
      buildInputs = packageSet.lib.optionals packageSet.stdenv.hostPlatform.isLinux [
        packageSet.alsa-lib
      ];
      doCheck = false;
    };
in {
  linux = buildMudmouth pkgs;
  windows = buildMudmouth pkgs.pkgsCross.mingwW64;
}
