2023-08-04 22:07:22 +00:00
|
|
|
{ lib
|
|
|
|
, buildGoModule
|
|
|
|
, fetchFromGitHub
|
|
|
|
, installShellFiles
|
|
|
|
, nix-update-script
|
|
|
|
, testers
|
|
|
|
, minify
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "minify";
|
2023-11-16 04:20:00 +00:00
|
|
|
version = "2.20.5";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "tdewolff";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2023-11-16 04:20:00 +00:00
|
|
|
hash = "sha256-+oaK6OdBRxtWW+0zp+pbCcGyphuOLzyv/LfjDqDiTGw=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
vendorHash = "sha256-GQqdr0zMQhi6QfLAyFchtWPOGfpo5yODDinKWA/s+qs=";
|
2023-08-04 22:07:22 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
2020-08-20 17:08:02 +00:00
|
|
|
|
2021-08-27 14:25:00 +00:00
|
|
|
ldflags = [ "-s" "-w" "-X main.Version=${version}" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
subPackages = [ "cmd/minify" ];
|
|
|
|
|
|
|
|
passthru = {
|
|
|
|
updateScript = nix-update-script { };
|
|
|
|
tests.version = testers.testVersion {
|
|
|
|
inherit version;
|
|
|
|
package = minify;
|
|
|
|
command = "minify --version";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
installShellCompletion --cmd minify --bash cmd/minify/bash_completion
|
|
|
|
'';
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = with lib; {
|
2023-08-04 22:07:22 +00:00
|
|
|
description = "Go minifiers for web formats";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://go.tacodewolff.nl/minify";
|
2022-04-27 09:35:20 +00:00
|
|
|
downloadPage = "https://github.com/tdewolff/minify";
|
2023-08-04 22:07:22 +00:00
|
|
|
changelog = "https://github.com/tdewolff/minify/releases/tag/v${version}";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ gaelreyrol ];
|
2023-10-09 19:29:22 +00:00
|
|
|
mainProgram = "minify";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2020-08-20 17:08:02 +00:00
|
|
|
}
|