nixpkgs/pkgs/tools/admin/scalr-cli/default.nix

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

43 lines
1000 B
Nix
Raw Normal View History

2023-03-20 21:10:23 +00:00
{ lib
, buildGoModule
, fetchFromGitHub
}:
buildGoModule rec {
pname = "scalr-cli";
2023-04-05 03:09:25 +00:00
version = "0.15.1";
2023-03-20 21:10:23 +00:00
src = fetchFromGitHub {
owner = "Scalr";
repo = "scalr-cli";
rev = "v${version}";
2023-04-05 03:09:25 +00:00
hash = "sha256-8KhFF/bD//NYRQ7v+ksGAE6bKVu+nE3o3R119XbHVDA=";
2023-03-20 21:10:23 +00:00
};
2023-04-05 03:09:25 +00:00
vendorHash = "sha256-xoxSQ9V9i7yxJzn8wAtIAtWlTn4q/UnNqMT93RyBHII=";
2023-03-20 21:10:23 +00:00
ldflags = [
"-s" "-w"
];
preConfigure = ''
# Set the version.
substituteInPlace main.go --replace '"0.0.0"' '"${version}"'
'';
postInstall = ''
mv $out/bin/cli $out/bin/scalr
'';
doCheck = false; # Skip tests as they require creating actual Scalr resources.
meta = with lib; {
description = "A command-line tool that communicates directly with the Scalr API.";
homepage = "https://github.com/Scalr/scalr-cli";
changelog = "https://github.com/Scalr/scalr-cli/releases/tag/v${version}";
license = licenses.asl20;
maintainers = with maintainers; [ dylanmtaylor ];
mainProgram = "scalr";
};
}