Files

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

65 lines
1.7 KiB
Nix
Raw Permalink Normal View History

2025-10-09 14:15:47 +02:00
{
stdenv,
fetchFromGitHub,
lib,
buildGoModule,
installShellFiles,
nix-update-script,
testers,
mongodb-atlas-cli,
}:
buildGoModule rec {
pname = "mongodb-atlas-cli";
version = "1.48.0";
src = fetchFromGitHub {
owner = "mongodb";
repo = "mongodb-atlas-cli";
tag = "atlascli/v${version}";
hash = "sha256-xdsW1REvd6yIsFO9j4t7Ydb9eVt1a3I3TMBYw5eeYXI=";
};
vendorHash = "sha256-Qwk4iVFvNGyam3QNJSuwCHD0BiqPIGV7qj3HfUzJNsQ=";
nativeBuildInputs = [ installShellFiles ];
ldflags = [
"-s"
"-w"
"-X github.com/mongodb/mongodb-atlas-cli/atlascli/internal/version.GitCommit=${src.rev}"
"-X github.com/mongodb/mongodb-atlas-cli/atlascli/internal/version.Version=v${version}"
];
subPackages = [ "cmd/atlas" ];
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd atlas \
--bash <($out/bin/atlas completion bash) \
--fish <($out/bin/atlas completion fish) \
--zsh <($out/bin/atlas completion zsh)
'';
passthru = {
updateScript = nix-update-script {
extraArgs = [ "--version-regex=atlascli/v(.+)" ];
};
tests.version = testers.testVersion {
package = mongodb-atlas-cli;
version = "v${version}";
};
};
meta = {
description = "CLI utility to manage MongoDB Atlas from the terminal";
homepage = "https://github.com/mongodb/mongodb-atlas-cli";
changelog = "https://www.mongodb.com/docs/atlas/cli/current/atlas-cli-changelog/#atlas-cli-${version}";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [
aduh95
iamanaws
];
mainProgram = "atlas";
};
}