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

nuv: init at 3.0.1-beta.2405292059 #316731

Merged
merged 3 commits into from
Jun 20, 2024
Merged
Show file tree
Hide file tree
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
12 changes: 12 additions & 0 deletions maintainers/maintainer-list.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4443,6 +4443,12 @@
github = "d4ilyrun";
githubId = 34611103;
};
d4rkstar = {
name = "Bruno Salzano";
email = "[email protected]";
github = "d4rkstar";
githubId = 4957015;
};
dadada = {
name = "dadada";
email = "[email protected]";
Expand Down Expand Up @@ -14140,6 +14146,12 @@
githubId = 3856390;
email = "[email protected]";
};
msciabarra = {
email = "[email protected]";
github = "sciabarracom";
githubId = 30654959;
name = "Michele Sciabarra";
};
msiedlarek = {
email = "[email protected]";
github = "msiedlarek";
Expand Down
75 changes: 75 additions & 0 deletions pkgs/by-name/nu/nuv/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
{ lib
, stdenv
, symlinkJoin
, callPackage
, fetchFromGitHub
, fetchurl
, buildGoModule
, makeWrapper
, breakpointHook
, jq
, curl
, kubectl
, eksctl
, kind
, k3sup
, coreutils
}:

let
branch = "3.0.0";
version = "3.0.1-beta.2405292059";
pname = "nuv";
in
buildGoModule {
inherit pname version;

src = fetchFromGitHub {
owner = "nuvolaris";
repo = "nuv";
rev = version;
hash = "sha256-MdnBvlA4S2Mi/bcbE+O02x+wvlIrsK1Zc0dySz4FB/w=";
};

d4rkstar marked this conversation as resolved.
Show resolved Hide resolved
subPackages = [ "." ];
vendorHash = "sha256-JkQbQ2NEaumXbAfsv0fNiQf/EwMs3SDLHvu7c/bU7fU=";

nativeBuildInputs = [ makeWrapper jq curl breakpointHook ];

ldflags = [
"-s"
"-w"
"-X main.NuvVersion=${version}"
"-X main.NuvBranch=${branch}"
];

# false because tests require some modifications inside nix-env
doCheck = false;
d4rkstar marked this conversation as resolved.
Show resolved Hide resolved

postInstall = let
nuv-bin = symlinkJoin {
name = "nuv-bin";
paths = [
coreutils
kubectl
eksctl
kind
k3sup
];
};
in ''
wrapProgram $out/bin/nuv --set NUV_BIN "${nuv-bin}/bin"
'';

passthru.tests = {
simple = callPackage ./tests.nix { inherit version; };
};

meta = {
homepage = "https://nuvolaris.io/";
description = "A CLI tool for running tasks using the Nuvolaris serverless engine";
license = lib.licenses.asl20;
mainProgram = "nuv";
maintainers = with lib.maintainers; [ msciabarra d4rkstar ];
};
}
17 changes: 17 additions & 0 deletions pkgs/by-name/nu/nuv/tests.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{ runCommand, nuv, version }:

runCommand "nuv-test-run"
{
nativeBuildInputs = [ nuv ];
} ''
export TMP_BASE=$(mktemp -d /tmp/.nuv-XXXXX)
export HOME=$TMP_BASE
export NUV_REPO=""
export NUV_ROOT=$TMP_BASE/.nuv/3.0.0/olaris
rm -rf $TMP_BASE/.nuv && \
d4rkstar marked this conversation as resolved.
Show resolved Hide resolved
mkdir -p $TMP_BASE/.nuv/3.0.0/olaris && \
mkdir $TMP_BASE/.nuv/tmp
V=$(nuv -version 2>/dev/null)
diff -U3 --color=auto <(echo "$V") <(echo "${version}")
touch $out
''