summaryrefslogtreecommitdiffstats
path: root/pkgs/by-name/ac/acr-cli/package.nix
blob: 0c18d019de7100831ab2e8fbab3af76a3f8df00a (plain)
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
{
  lib,
  buildGoModule,
  fetchFromGitHub,
  testers,
  nix-update-script,
  acr-cli,
}:
buildGoModule (finalAttrs: {
  pname = "acr-cli";
  version = "0.19";

  src = fetchFromGitHub {
    owner = "Azure";
    repo = "acr-cli";
    tag = "v${finalAttrs.version}";
    hash = "sha256-Tb1OVVkEH6XmYjbe5ktgqRO/Ko1jhzpbhycZFalhgVg=";
  };

  vendorHash = null;

  ldflags = [
    "-s"
    "-w"
    "-X=github.com/Azure/acr-cli/version.Version=${finalAttrs.version}"
    "-X=github.com/Azure/acr-cli/version.Revision=${finalAttrs.src.rev}"
  ];

  executable = [ "acr" ];

  # Required for some tests on darwin.
  __darwinAllowLocalNetworking = true;

  # Test checks for legacy error which has been changed in newer go versions.
  checkFlags = [ "-skip=^TestParseDuration" ];

  passthru.tests.version = testers.testVersion {
    package = acr-cli;
    command = "acr version";
  };

  passthru.updateScript = nix-update-script { };

  meta = {
    description = "Command Line Tool for interacting with Azure Container Registry Images";
    homepage = "https://github.com/Azure/acr-cli";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ hausken ];
    mainProgram = "acr-cli";
  };
})