Skip to content

Commit

Permalink
amazon-ec2-metadata-mock: init at 1.12.0
Browse files Browse the repository at this point in the history
  • Loading branch information
arianvp committed Dec 16, 2024
1 parent f4eadb6 commit e95eb9a
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions pkgs/by-name/am/amazon-ec2-metadata-mock/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{ lib, buildGoModule, fetchFromGitHub, nix-update-script, versionCheckHook }:

buildGoModule rec {
pname = "amazon-ec2-metadata-mock";
version = "1.12.0";

src = fetchFromGitHub {
owner = "aws";
repo = "amazon-ec2-metadata-mock";
rev = "refs/tags/v${version}";
hash = "sha256-8X6LBGo496fG0Chhvg3jAaUF6mp8psCzHd+Es75z27Y=";
};

vendorHash = "sha256-jRJX4hvfRuhR5TlZe7LsXaOlUCwmQGem2QKlX3vuk8c=";

subPackages = [ "cmd/" ];

postBuild = ''
mv "$GOPATH/bin/cmd" "$GOPATH/bin/$mainProgram"
'';

mainProgram = "ec2-metadata-mock";
doInstallCheck = true;
nativeInstallCheckInputs = [ versionCheckHook ];
versionCheckProgram = "${placeholder "out"}/bin/${mainProgram}";

passthru = { updateScript = nix-update-script { }; };

meta = {
description = "A tool to simulate Amazon EC2 instance metadata";
homepage = "https://github.com/aws/amazon-ec2-metadata-mock";
license = lib.licenses.asl20;
inherit mainProgram;
maintainers = with lib.maintainers; [ arianvp ];
};
}

0 comments on commit e95eb9a

Please sign in to comment.