Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
50 lines
1.3 KiB
Nix
50 lines
1.3 KiB
Nix
{
|
|
lib,
|
|
buildGoModule,
|
|
fetchFromGitHub,
|
|
versionCheckHook,
|
|
nix-update-script,
|
|
}:
|
|
|
|
buildGoModule (finalAttrs: {
|
|
pname = "ec2-instance-selector";
|
|
version = "3.1.2";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "aws";
|
|
repo = "amazon-ec2-instance-selector";
|
|
tag = "v${finalAttrs.version}";
|
|
hash = "sha256-8tSZkh2ngOgfwup2nCiNXHFX2GhIVVW9PtLuGNP5yoo=";
|
|
};
|
|
|
|
vendorHash = "sha256-qrxYLnj8DEGNtIq6sC7xvNBLgguG/lj9YLqgLFumQtE=";
|
|
|
|
ldflags = [
|
|
"-s"
|
|
"-w"
|
|
"-X=main.versionID=${finalAttrs.version}"
|
|
"-X=github.com/aws/amazon-ec2-instance-selector/v3/pkg/selector.versionID=${finalAttrs.version}"
|
|
];
|
|
|
|
postInstall = ''
|
|
rm $out/bin/readme-test
|
|
mv $out/bin/cmd $out/bin/ec2-instance-selector
|
|
'';
|
|
|
|
nativeInstallCheckInputs = [ versionCheckHook ];
|
|
versionCheckProgramArg = "--version";
|
|
versionCheckKeepEnvironment = [ "HOME" ];
|
|
doInstallCheck = true;
|
|
|
|
passthru.updateScript = nix-update-script { };
|
|
|
|
meta = {
|
|
description = "Recommends instance types based on resource criteria like vcpus and memory";
|
|
homepage = "https://github.com/aws/amazon-ec2-instance-selector";
|
|
changelog = "https://github.com/aws/amazon-ec2-instance-selector/tags/v${finalAttrs.version}";
|
|
license = lib.licenses.asl20;
|
|
maintainers = with lib.maintainers; [ wcarlsen ];
|
|
mainProgram = "ec2-instance-selector";
|
|
};
|
|
})
|