-
-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ac63aa9
commit 8d724ba
Showing
1 changed file
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
{ | ||
lib, | ||
buildGoModule, | ||
fetchFromGitLab, | ||
nix-update-script, | ||
versionCheckHook, | ||
}: | ||
|
||
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 | ||
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 = [ | ||
"-X ${ldflagsPackageVariablePrefix}.NAME=${pname}" | ||
"-X ${ldflagsPackageVariablePrefix}.VERSION=v${version}" | ||
"-X ${ldflagsPackageVariablePrefix}.REVISION=${src.rev}" | ||
]; | ||
|
||
nativeInstallCheckInputs = [ versionCheckHook ]; | ||
|
||
versionCheckProgramArg = "version"; | ||
|
||
passthru = { | ||
updateScript = nix-update-script { }; | ||
}; | ||
|
||
meta = { | ||
description = "nesting is a basic and opinionated daemon that sits in front of virtualization platforms. Its goal is to provide a client/server model for listing, creating and deleting pre-configured Virtual Machines intended for isolated and short-lived workloads."; | ||
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; [ ]; | ||
}; | ||
} |