Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nesting: init at 0.2.1 #338281

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions pkgs/by-name/ne/nesting/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
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";
platforms = lib.platforms.unix;
# TODO: Find maintainer(s).
maintainers = with lib.maintainers; [ ];
};
}