15 buildGo122Module rec {
18 shortRev = "9587df6"; # for internal version info
20 src = fetchFromGitHub {
24 sha256 = "sha256-Vcay8vUYLjV65g526btQX0+m5n/cRocIKx7C2LuWeP4=";
27 inherit subPackages postInstall;
29 vendorHash = "sha256-ADqU/ZJiyZ5hAkqFXExmA8fSZxzhx42QptYu3TIlgBc=";
32 # Without this, we get error messages like:
33 # 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)
34 # The patch was generated by changing "go 1.16" to "go 1.21" and executing `go mod tidy`.
35 ./fix-go-version-error.patch
42 versionPkg = "github.com/sensu/sensu-go/version";
45 "-X ${versionPkg}.Version=${version}"
46 "-X ${versionPkg}.BuildSHA=${shortRev}"
51 homepage = "https://sensu.io";
52 description = "Open source monitoring tool for ephemeral infrastructure & distributed applications";
53 license = lib.licenses.mit;
54 maintainers = with lib.maintainers; [
62 sensu-go-cli = generic {
63 pname = "sensu-go-cli";
64 subPackages = [ "cmd/sensuctl" ];
67 "''${!outputBin}/share/bash-completion/completions" \
68 "''${!outputBin}/share/zsh/site-functions"
70 ''${!outputBin}/bin/sensuctl completion bash > ''${!outputBin}/share/bash-completion/completions/sensuctl
72 # https://github.com/sensu/sensu-go/issues/3132
74 echo "#compdef sensuctl"
75 ''${!outputBin}/bin/sensuctl completion zsh
76 echo '_complete sensuctl 2>/dev/null'
77 ) > ''${!outputBin}/share/zsh/site-functions/_sensuctl
80 mainProgram = "sensuctl";
83 sensu-go-backend = generic {
84 pname = "sensu-go-backend";
85 subPackages = [ "cmd/sensu-backend" ];
86 mainProgram = "sensu-backend";
89 sensu-go-agent = generic {
90 pname = "sensu-go-agent";
91 subPackages = [ "cmd/sensu-agent" ];
92 mainProgram = "sensu-agent";