biglybt: 3.5.0.0 -> 3.6.0.0
[NixPkgs.git] / pkgs / servers / monitoring / sensu-go / default.nix
blob81ec65598cc61b42df6e36ee0e39045b9a1072b3
1 { buildGo121Module, fetchFromGitHub, lib }:
3 let
4   generic = { subPackages, pname, postInstall ? "", mainProgram }:
5     buildGo121Module rec {
6       inherit pname;
7       version = "6.11.0";
8       shortRev = "9587df6"; # for internal version info
10       src = fetchFromGitHub {
11         owner = "sensu";
12         repo = "sensu-go";
13         rev = "v${version}";
14         sha256 = "sha256-Vcay8vUYLjV65g526btQX0+m5n/cRocIKx7C2LuWeP4=";
15       };
17       inherit subPackages postInstall;
19       vendorHash = "sha256-ADqU/ZJiyZ5hAkqFXExmA8fSZxzhx42QptYu3TIlgBc=";
21       patches = [
22         # Without this, we get error messages like:
23         # vendor/golang.org/x/sys/unix/mremap.go:41:10: unsafe.Slice requires go1.17 or later (-lang was set to go1.16; check go.mod)
24         # The patch was generated by changing "go 1.16" to "go 1.21" and executing `go mod tidy`.
25         ./fix-go-version-error.patch
26       ];
28       doCheck = false;
30       ldflags = let
31         versionPkg = "github.com/sensu/sensu-go/version";
32       in [
33         "-X ${versionPkg}.Version=${version}"
34         "-X ${versionPkg}.BuildSHA=${shortRev}"
35       ];
37       meta = {
38         inherit mainProgram;
39         homepage = "https://sensu.io";
40         description = "Open source monitoring tool for ephemeral infrastructure & distributed applications";
41         license = lib.licenses.mit;
42         maintainers = with lib.maintainers; [ thefloweringash ];
43       };
44     };
47   sensu-go-cli = generic {
48     pname = "sensu-go-cli";
49     subPackages = [ "cmd/sensuctl" ];
50     postInstall = ''
51       mkdir -p \
52         "''${!outputBin}/share/bash-completion/completions" \
53         "''${!outputBin}/share/zsh/site-functions"
55       ''${!outputBin}/bin/sensuctl completion bash > ''${!outputBin}/share/bash-completion/completions/sensuctl
57       # https://github.com/sensu/sensu-go/issues/3132
58       (
59         echo "#compdef sensuctl"
60         ''${!outputBin}/bin/sensuctl completion zsh
61         echo '_complete sensuctl 2>/dev/null'
62       ) > ''${!outputBin}/share/zsh/site-functions/_sensuctl
64     '';
65     mainProgram = "sensuctl";
66   };
68   sensu-go-backend = generic {
69     pname = "sensu-go-backend";
70     subPackages = [ "cmd/sensu-backend" ];
71     mainProgram = "sensu-backend";
72   };
74   sensu-go-agent = generic {
75     pname = "sensu-go-agent";
76     subPackages = [ "cmd/sensu-agent" ];
77     mainProgram = "sensu-agent";
78   };