diff --git a/pkgs/by-name/ov/ovhcloud-cli/package.nix b/pkgs/by-name/ov/ovhcloud-cli/package.nix new file mode 100644 index 000000000000..98bf05847bb5 --- /dev/null +++ b/pkgs/by-name/ov/ovhcloud-cli/package.nix @@ -0,0 +1,47 @@ +{ + lib, + buildGoModule, + fetchFromGitHub, + installShellFiles, + testers, +}: + +buildGoModule (finalAttrs: { + pname = "ovhcloud-cli"; + version = "0.5.0"; + + src = fetchFromGitHub { + owner = "ovh"; + repo = "ovhcloud-cli"; + tag = "v${finalAttrs.version}"; + hash = "sha256-vf8z2jOcN76BIS6AamWxrBIVUMxlerd4dNwVxpuxQZg="; + }; + + vendorHash = "sha256-WNONEceR/cDVloosQ/BMYjPTk9elQ1oTX89lgzENSAI="; + + env.CGO_ENABLED = 0; + + ldflags = [ + "-s" + "-w" + "-X github.com/ovh/ovhcloud-cli/internal/version.Version=${finalAttrs.version}" + ]; + + excludedPackages = [ "cmd/docgen" ]; + + nativeBuildInputs = [ installShellFiles ]; + + passthru.tests.version = testers.testVersion { + package = finalAttrs.finalPackage; + command = "ovhcloud version"; + }; + + meta = { + homepage = "https://github.com/ovh/ovhcloud-cli"; + changelog = "https://github.com/ovh/ovhcloud-cli/releases/tag/v${finalAttrs.version}"; + description = "Command Line Interface to manage your OVHcloud services"; + mainProgram = "ovhcloud"; + license = lib.licenses.asl20; + maintainers = [ lib.maintainers.anthonyroussel ]; + }; +})