From b545763ba1b9a530b968cdcd60e27a01af8cc72d Mon Sep 17 00:00:00 2001 From: Arian van Putten Date: Mon, 16 Dec 2024 21:42:25 +0100 Subject: [PATCH] amazon-ec2-metadata-mock: init at 1.12.0 --- .../am/amazon-ec2-metadata-mock/package.nix | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 pkgs/by-name/am/amazon-ec2-metadata-mock/package.nix diff --git a/pkgs/by-name/am/amazon-ec2-metadata-mock/package.nix b/pkgs/by-name/am/amazon-ec2-metadata-mock/package.nix new file mode 100644 index 0000000000000..1496cf583e541 --- /dev/null +++ b/pkgs/by-name/am/amazon-ec2-metadata-mock/package.nix @@ -0,0 +1,44 @@ +{ + 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 ]; + }; +}