lol
1{
2 lib,
3 stdenv,
4 buildGoModule,
5 fetchFromGitHub,
6 installShellFiles,
7}:
8
9let
10 pname = "pack";
11 version = "0.37.0";
12in
13buildGoModule {
14 inherit pname version;
15
16 src = fetchFromGitHub {
17 owner = "buildpacks";
18 repo = "pack";
19 rev = "refs/tags/v${version}";
20 hash = "sha256-QCN0UvWa5u9XX5LvY3yD8Xz2s1XzZUg/WXnAfWwZnY0=";
21 };
22
23 vendorHash = "sha256-W8FTk2eJYaTE9gCRwrT+mDhda/ZZeCytqQ9vvVZZHSQ=";
24
25 nativeBuildInputs = [ installShellFiles ];
26
27 subPackages = [ "cmd/pack" ];
28
29 ldflags = [
30 "-s"
31 "-w"
32 "-X github.com/buildpacks/pack.Version=${version}"
33 ];
34
35 postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
36 installShellCompletion --cmd pack \
37 --zsh $(PACK_HOME=$PWD $out/bin/pack completion --shell zsh) \
38 --bash $(PACK_HOME=$PWD $out/bin/pack completion --shell bash) \
39 --fish $(PACK_HOME=$PWD $out/bin/pack completion --shell fish)
40 '';
41
42 meta = {
43 homepage = "https://buildpacks.io/";
44 changelog = "https://github.com/buildpacks/pack/releases/tag/v${version}";
45 description = "CLI for building apps using Cloud Native Buildpacks";
46 mainProgram = "pack";
47 license = lib.licenses.asl20;
48 maintainers = with lib.maintainers; [ momeemt ];
49 };
50}