From f3212f0cb272077e8994f97e86ab9580227d0100 Mon Sep 17 00:00:00 2001 From: commiterate <111539270+commiterate@users.noreply.github.com> Date: Thu, 29 Aug 2024 19:42:00 -0400 Subject: [PATCH] nesting: init at 0.2.1 --- pkgs/by-name/ne/nesting/package.nix | 58 +++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 pkgs/by-name/ne/nesting/package.nix diff --git a/pkgs/by-name/ne/nesting/package.nix b/pkgs/by-name/ne/nesting/package.nix new file mode 100644 index 00000000000000..830d274b8a85d7 --- /dev/null +++ b/pkgs/by-name/ne/nesting/package.nix @@ -0,0 +1,58 @@ +{ + lib, + buildGoModule, + fetchFromGitLab, + nix-update-script, + versionCheckHook, +}: + +buildGoModule rec { + pname = "nesting"; + version = "0.2.1"; + + src = fetchFromGitLab { + owner = "gitlab-org/fleeting"; + repo = "nesting"; + rev = "refs/tags/v${version}"; + hash = "sha256-6JgwzJrULbXLQI5pB5DttjOkVyN7s9Bgr/L5sD79Nvw="; + }; + + vendorHash = "sha256-JIVETis405olMyq8cvBjw4KRG9qusSfktx1vAM48y3s="; + + subPackages = [ "cmd/nesting" ]; + + # See https://gitlab.com/gitlab-org/fleeting/nesting/-/blob/v0.2.1/Makefile?ref_type=tags#L22-24. + # + # Needed for "nesting version" to not show "dev". + ldflags = + let + # See https://gitlab.com/gitlab-org/fleeting/nesting/-/blob/v0.2.1/Makefile?ref_type=tags#L18. + # + # Couldn't find a way to substitute "go list ." into "ldflags". + ldflagsPackageVariablePrefix = "gitlab.com/gitlab-org/fleeting/nesting"; + in + [ + "-X ${ldflagsPackageVariablePrefix}.NAME=nesting" + "-X ${ldflagsPackageVariablePrefix}.VERSION=v${version}" + "-X ${ldflagsPackageVariablePrefix}.REVISION=${src.rev}" + ]; + + doInstallCheck = true; + + nativeInstallCheckInputs = [ versionCheckHook ]; + + versionCheckProgramArg = "version"; + + passthru = { + updateScript = nix-update-script { }; + }; + + meta = { + description = "Basic and opinionated daemon that sits in front of virtualization platforms"; + homepage = "https://gitlab.com/gitlab-org/fleeting/nesting"; + license = lib.licenses.mit; + mainProgram = "nesting"; + # TODO: Find maintainer(s). + maintainers = with lib.maintainers; [ ]; + }; +}