-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
/
Copy pathpackage.nix
63 lines (52 loc) · 1.49 KB
/
package.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
{
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
installShellFiles,
nix-update-script,
versionCheckHook,
}:
buildGoModule rec {
pname = "go-task";
version = "3.41.0";
src = fetchFromGitHub {
owner = "go-task";
repo = "task";
tag = "v${version}";
hash = "sha256-yJ9XTCS0BK+pcQvcbGR2ixwPODJKdfQnHgB1QoTFhzA=";
};
vendorHash = "sha256-DR9G+I6PYk8jrR0CZiPqtuULTMekATNSLjyHACOmlbk=";
nativeBuildInputs = [ installShellFiles ];
subPackages = [ "cmd/task" ];
ldflags = [
"-s"
"-w"
"-X=github.com/go-task/task/v3/internal/version.version=${version}"
];
env.CGO_ENABLED = 0;
postInstall =
''
ln -s $out/bin/task $out/bin/go-task
''
+ lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd task \
--bash <($out/bin/task --completion bash) \
--fish <($out/bin/task --completion fish) \
--zsh <($out/bin/task --completion zsh)
'';
nativeInstallCheckInputs = [
versionCheckHook
];
doInstallCheck = true;
versionCheckProgram = "${placeholder "out"}/bin/task";
versionCheckProgramArg = [ "--version" ];
passthru.updateScript = nix-update-script { };
meta = with lib; {
homepage = "https://taskfile.dev/";
description = "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 ];
};
}