nixpkgs/pkgs/shells/carapace/default.nix
2024-03-14 01:43:08 +00:00

39 lines
896 B
Nix

{ lib, buildGoModule, fetchFromGitHub, testers, carapace }:
buildGoModule rec {
pname = "carapace";
version = "1.0.0";
src = fetchFromGitHub {
owner = "rsteube";
repo = "${pname}-bin";
rev = "v${version}";
hash = "sha256-lc+oU9adFbtQyb4wKLgbf5i6UwxsKUJo3giquDTO6qg=";
};
vendorHash = "sha256-XAdTLfMnOAcOiRYZGrom2Q+qp+epfg6Y9Jv0V0T12/8=";
ldflags = [
"-s"
"-w"
"-X main.version=${version}"
];
subPackages = [ "./cmd/carapace" ];
tags = [ "release" ];
preBuild = ''
GOOS= GOARCH= go generate ./...
'';
passthru.tests.version = testers.testVersion { package = carapace; };
meta = with lib; {
description = "Multi-shell multi-command argument completer";
homepage = "https://rsteube.github.io/carapace-bin/";
maintainers = with maintainers; [ star-szr ];
license = licenses.mit;
mainProgram = "carapace";
};
}