tye-exe 987d1657a8 minhtml: init at 0.16.4
I generated a `Cargo.lock` file which is included in the patch phase, as upstream does not have one.
2025-06-27 12:27:39 +01:00

44 lines
1.0 KiB
Nix

{
lib,
fetchFromGitHub,
rustPlatform,
}:
rustPlatform.buildRustPackage (finalAttrs: {
pname = "minhtml";
version = "0.16.4";
src = fetchFromGitHub {
owner = "wilsonzlin";
repo = "minify-html";
tag = "v${finalAttrs.version}";
hash = "sha256-SoCSHhgTLfztSfvzxxpZn/nQpXbKlkE4iiP0YZ0MVjY=";
};
# Upstream does not include a lock file so one has to be patched in.
cargoLock = {
lockFile = ./Cargo.lock;
};
postPatch = ''
cp ${./Cargo.lock} Cargo.lock
'';
# Ensures that only the correct package gets built, as upstream contains multiple.
cargoBuildFlags = [
"-p"
"minhtml"
];
cargoTestFlags = [
"-p"
"minhtml"
];
meta = {
description = "Minifier for HTML, JavaScript, and CSS";
mainProgram = "minhtml";
homepage = "https://github.com/wilsonzlin/minify-html";
changelog = "https://github.com/wilsonzlin/minify-html/releases/tag/v${finalAttrs.version}";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ tye-exe ];
};
})