diff options
author | h7x4 <h7x4@nani.wtf> | 2024-06-20 12:27:10 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-20 12:27:10 +0200 |
commit | d34459eae5159894ef07d62e7e043944391d1364 (patch) | |
tree | dce3569279406c85769c57766742ebe5d2bb7df7 | |
parent | e5aa50d7333b9a872c7a77937bc69144c6a209f8 (diff) | |
parent | 38649d653654c95c608943bb95ac56ba3a28a29a (diff) |
Merge pull request #316731 from d4rkstar/master
nuv: init at 3.0.1-beta.2405292059
-rw-r--r-- | maintainers/maintainer-list.nix | 12 | ||||
-rw-r--r-- | pkgs/by-name/nu/nuv/package.nix | 75 | ||||
-rw-r--r-- | pkgs/by-name/nu/nuv/tests.nix | 17 |
3 files changed, 104 insertions, 0 deletions
diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index 407a59b6e6854..f58e58e88aef7 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -4260,6 +4260,12 @@ github = "d4ilyrun"; githubId = 34611103; }; + d4rkstar = { + name = "Bruno Salzano"; + email = "d4rkstar@gmail.com"; + github = "d4rkstar"; + githubId = 4957015; + }; dadada = { name = "dadada"; email = "dadada@dadada.li"; @@ -13629,6 +13635,12 @@ githubId = 3856390; email = "mschwaig+nixpkgs@eml.cc"; }; + msciabarra = { + email = "msciabarra@apache.org"; + github = "sciabarracom"; + githubId = 30654959; + name = "Michele Sciabarra"; + }; msiedlarek = { email = "mikolaj@siedlarek.pl"; github = "msiedlarek"; diff --git a/pkgs/by-name/nu/nuv/package.nix b/pkgs/by-name/nu/nuv/package.nix new file mode 100644 index 0000000000000..30ca0bfecfee4 --- /dev/null +++ b/pkgs/by-name/nu/nuv/package.nix @@ -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="; + }; + + 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; + + 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 ]; + }; +} diff --git a/pkgs/by-name/nu/nuv/tests.nix b/pkgs/by-name/nu/nuv/tests.nix new file mode 100644 index 0000000000000..4e531728e8ff4 --- /dev/null +++ b/pkgs/by-name/nu/nuv/tests.nix @@ -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 && \ + 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 +'' |