nixpkgs/pkgs/development/tools/go-task/default.nix
2024-05-09 01:11:09 +00:00

53 lines
1.1 KiB
Nix

{ lib
, buildGoModule
, fetchFromGitHub
, installShellFiles
, testers
, go-task
}:
buildGoModule rec {
pname = "go-task";
version = "3.37.0";
src = fetchFromGitHub {
owner = pname;
repo = "task";
rev = "refs/tags/v${version}";
hash = "sha256-h3/quMJ4vdTaR+pY7NRpbNp0o3Wp+3K7kFNACp5Q1Ls=";
};
vendorHash = "sha256-iugFWBIKt/Rm5ccQnIFR75P1AVZbbFhWN97dvr8DoBs=";
doCheck = false;
nativeBuildInputs = [ installShellFiles ];
subPackages = [ "cmd/task" ];
ldflags = [
"-s"
"-w"
"-X=github.com/go-task/task/v3/internal/version.version=${version}"
];
postInstall = ''
ln -s $out/bin/task $out/bin/go-task
installShellCompletion completion/{bash,fish,zsh}/*
'';
passthru.tests = {
version = testers.testVersion {
package = go-task;
};
};
meta = with lib; {
homepage = "https://taskfile.dev/";
description = "A task runner / simpler Make alternative written in Go";
changelog = "https://github.com/go-task/task/blob/v${version}/CHANGELOG.md";
license = licenses.mit;
maintainers = with maintainers; [ parasrah ];
};
}