mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-10-02 13:00:23 +00:00
57 lines
1.2 KiB
Nix
57 lines
1.2 KiB
Nix
{
|
|
lib,
|
|
buildGoModule,
|
|
fetchFromGitHub,
|
|
installShellFiles,
|
|
nix-update-script,
|
|
testers,
|
|
minify,
|
|
}:
|
|
|
|
buildGoModule (finalAttrs: {
|
|
pname = "minify";
|
|
version = "2.24.17";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "tdewolff";
|
|
repo = "minify";
|
|
rev = "v${finalAttrs.version}";
|
|
hash = "sha256-syEMMEQYUQEEdch7yFrVUUPXe1cIebXkvm52e9LmP+c=";
|
|
};
|
|
|
|
vendorHash = "sha256-s4QSt1kxPxgbQLZStsMN/st3g4GjQtK7+wAI5IKaHo4=";
|
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
ldflags = [
|
|
"-s"
|
|
"-w"
|
|
"-X main.Version=${finalAttrs.version}"
|
|
];
|
|
|
|
subPackages = [ "cmd/minify" ];
|
|
|
|
passthru = {
|
|
updateScript = nix-update-script { };
|
|
tests.version = testers.testVersion {
|
|
inherit (finalAttrs) version;
|
|
package = minify;
|
|
command = "minify --version";
|
|
};
|
|
};
|
|
|
|
postInstall = ''
|
|
installShellCompletion --cmd minify --bash cmd/minify/bash_completion
|
|
'';
|
|
|
|
meta = {
|
|
description = "Go minifiers for web formats";
|
|
homepage = "https://go.tacodewolff.nl/minify";
|
|
downloadPage = "https://github.com/tdewolff/minify";
|
|
changelog = "https://github.com/tdewolff/minify/releases/tag/v${finalAttrs.version}";
|
|
license = lib.licenses.mit;
|
|
maintainers = [ ];
|
|
mainProgram = "minify";
|
|
};
|
|
})
|