vifm: 0.13 -> 0.14 (#380559)
[NixPkgs.git] / pkgs / by-name / co / consul / package.nix
blobad6fbcadeabe3ed623c78ddef1637b0e22fd0d7b
2   lib,
3   buildGoModule,
4   fetchFromGitHub,
5   nixosTests,
6   nix-update-script,
7 }:
9 buildGoModule rec {
10   pname = "consul";
11   version = "1.20.2";
13   # Note: Currently only release tags are supported, because they have the Consul UI
14   # vendored. See
15   #   https://github.com/NixOS/nixpkgs/pull/48714#issuecomment-433454834
16   # If you want to use a non-release commit as `src`, you probably want to improve
17   # this derivation so that it can build the UI's JavaScript from source.
18   # See https://github.com/NixOS/nixpkgs/pull/49082 for something like that.
19   # Or, if you want to patch something that doesn't touch the UI, you may want
20   # to apply your changes as patches on top of a release commit.
21   src = fetchFromGitHub {
22     owner = "hashicorp";
23     repo = pname;
24     tag = "v${version}";
25     hash = "sha256-pUKX94OgJ2PTchBokAI5QzLxvdzQjcePrKHEiB782hc=";
26   };
28   # This corresponds to paths with package main - normally unneeded but consul
29   # has a split module structure in one repo
30   subPackages = [
31     "."
32     "connect/certgen"
33   ];
35   vendorHash = "sha256-pH9KVyHgSULZ+fuUSDIXOzLhrdhsbJEom67k6jaW31E=";
37   doCheck = false;
39   ldflags = [
40     "-X github.com/hashicorp/consul/version.GitDescribe=v${version}"
41     "-X github.com/hashicorp/consul/version.Version=${version}"
42     "-X github.com/hashicorp/consul/version.VersionPrerelease="
43   ];
45   passthru = {
46     tests = {
47       inherit (nixosTests) consul;
48     };
50     updateScript = nix-update-script { };
51   };
53   meta = with lib; {
54     description = "Tool for service discovery, monitoring and configuration";
55     changelog = "https://github.com/hashicorp/consul/releases/tag/v${version}";
56     homepage = "https://www.consul.io/";
57     platforms = platforms.linux ++ platforms.darwin;
58     license = licenses.bsl11;
59     maintainers = with maintainers; [
60       adamcstephens
61       pradeepchhetri
62       vdemeester
63       nh2
64       techknowlogick
65     ];
66     mainProgram = "consul";
67   };