aliyun-cli: refactor

This commit is contained in:
nayeko
2025-02-15 18:19:08 +00:00
committed by GitHub
parent 3172620e99
commit 0abfcbfa32
+13 -7
View File
@@ -2,6 +2,8 @@
lib,
buildGoModule,
fetchFromGitHub,
writableTmpDirAsHomeHook,
nix-update-script,
}:
buildGoModule rec {
@@ -9,11 +11,11 @@ buildGoModule rec {
version = "3.0.211";
src = fetchFromGitHub {
rev = "v${version}";
owner = "aliyun";
repo = pname;
fetchSubmodules = true;
repo = "aliyun-cli";
tag = "v${version}";
hash = "sha256-6msh6bGL++nXVzwwNW6fFZbkN40ieL+SpgRownIs9aE=";
fetchSubmodules = true;
};
vendorHash = "sha256-wHdSDBxDArVbD5+EgGcIpQ+NLg5BKXo2v3WM4ni1efc=";
@@ -26,16 +28,20 @@ buildGoModule rec {
"-X github.com/aliyun/aliyun-cli/cli.Version=${version}"
];
nativeCheckInputs = [ writableTmpDirAsHomeHook ];
postInstall = ''
mv $out/bin/main $out/bin/aliyun
install -Dm755 $out/bin/main $out/bin/aliyun
'';
meta = with lib; {
passthru.updateScript = nix-update-script { };
meta = {
description = "Tool to manage and use Alibaba Cloud resources through a command line interface";
homepage = "https://github.com/aliyun/aliyun-cli";
changelog = "https://github.com/aliyun/aliyun-cli/releases/tag/v${version}";
license = licenses.asl20;
maintainers = with maintainers; [ ornxka ];
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ ornxka ];
mainProgram = "aliyun";
};
}