From d5edf6df6120352591747f385267adcee703f218 Mon Sep 17 00:00:00 2001 From: commiterate <111539270+commiterate@users.noreply.github.com> Date: Tue, 27 Aug 2024 19:20:58 -0400 Subject: [PATCH] fleeting-plugin-aws: init at 1.0.0 --- maintainers/maintainer-list.nix | 5 ++ .../fl/fleeting-plugin-aws/package.nix | 59 +++++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 pkgs/by-name/fl/fleeting-plugin-aws/package.nix diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index df6a19a3e554..2065f51585fa 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -4602,6 +4602,11 @@ githubId = 87764; name = "Ben Ford"; }; + commiterate = { + github = "commiterate"; + githubId = 111539270; + name = "commiterate"; + }; CompEng0001 = { email = "sb1501@canterbury.ac.uk"; github = "CompEng0001"; diff --git a/pkgs/by-name/fl/fleeting-plugin-aws/package.nix b/pkgs/by-name/fl/fleeting-plugin-aws/package.nix new file mode 100644 index 000000000000..f066d23f6427 --- /dev/null +++ b/pkgs/by-name/fl/fleeting-plugin-aws/package.nix @@ -0,0 +1,59 @@ +{ + lib, + buildGoModule, + fetchFromGitLab, + nix-update-script, + versionCheckHook, +}: + +buildGoModule rec { + pname = "fleeting-plugin-aws"; + version = "1.0.0"; + + src = fetchFromGitLab { + owner = "gitlab-org/fleeting/plugins"; + repo = "aws"; + tag = "v${version}"; + hash = "sha256-8vEduf+xh9R3+GoouXJS2h/ELlzKXDmLBLekaXGn7SE="; + }; + + vendorHash = "sha256-bfEzPPP280peOK4Jyu1fyfFCaFnRLoPmsjJ+G1BoVW4="; + + subPackages = [ "cmd/fleeting-plugin-aws" ]; + + # See https://gitlab.com/gitlab-org/fleeting/plugins/aws/-/blob/v1.0.0/Makefile?ref_type=tags#L20-22. + # + # Needed for "fleeting-plugin-aws version" to not show "dev". + ldflags = + let + # See https://gitlab.com/gitlab-org/fleeting/plugins/aws/-/blob/v1.0.0/Makefile?ref_type=tags#L14. + # + # Couldn't find a way to substitute "go list ." into "ldflags". + ldflagsPackageVariablePrefix = "gitlab.com/gitlab-org/fleeting/plugins/aws"; + in + [ + "-X ${ldflagsPackageVariablePrefix}.NAME=fleeting-plugin-aws" + "-X ${ldflagsPackageVariablePrefix}.VERSION=v${version}" + "-X ${ldflagsPackageVariablePrefix}.REVISION=${src.rev}" + ]; + + doInstallCheck = true; + + nativeInstallCheckInputs = [ versionCheckHook ]; + + versionCheckProgram = "${builtins.placeholder "out"}/bin/fleeting-plugin-aws"; + + versionCheckProgramArg = "version"; + + passthru = { + updateScript = nix-update-script { }; + }; + + meta = { + description = "GitLab fleeting plugin for AWS"; + homepage = "https://gitlab.com/gitlab-org/fleeting/plugins/aws"; + license = lib.licenses.mit; + mainProgram = "fleeting-plugin-aws"; + maintainers = with lib.maintainers; [ commiterate ]; + }; +}