From c59201d8fbe220b6510aa4f3397ee2a493015b5e Mon Sep 17 00:00:00 2001 From: Maxine Aubrey Date: Thu, 29 Jul 2021 18:41:57 +0200 Subject: nomad_1_1: 1.1.2 -> 1.1.3 --- pkgs/applications/networking/cluster/nomad/1.1.nix | 11 +++-- .../networking/cluster/nomad/generic.nix | 3 -- .../networking/cluster/nomad/genericModule.nix | 54 ++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 +- 4 files changed, 61 insertions(+), 9 deletions(-) create mode 100644 pkgs/applications/networking/cluster/nomad/genericModule.nix diff --git a/pkgs/applications/networking/cluster/nomad/1.1.nix b/pkgs/applications/networking/cluster/nomad/1.1.nix index cfc38c2f59e..e9c4ff8c967 100644 --- a/pkgs/applications/networking/cluster/nomad/1.1.nix +++ b/pkgs/applications/networking/cluster/nomad/1.1.nix @@ -1,11 +1,12 @@ { callPackage -, buildGoPackage +, buildGoModule , nvidia_x11 , nvidiaGpuSupport }: -callPackage ./generic.nix { - inherit buildGoPackage nvidia_x11 nvidiaGpuSupport; - version = "1.1.2"; - sha256 = "08ynfr2lqzv66ymj37qbc72lf2iq41kf94n76pdvynymk4dq98nq"; +callPackage ./genericModule.nix { + inherit buildGoModule nvidia_x11 nvidiaGpuSupport; + version = "1.1.3"; + sha256 = "0jpc8ff56k9q2kv9l86y3p8h3gqbvx6amvs0cw8sp4i7dqd2ihz2"; + vendorSha256 = "0az4gr7292lfr5wrwbkdknrigqm15lkbnf5mh517hl3yzv4pb8yr"; } diff --git a/pkgs/applications/networking/cluster/nomad/generic.nix b/pkgs/applications/networking/cluster/nomad/generic.nix index 99a2585272c..586308dd424 100644 --- a/pkgs/applications/networking/cluster/nomad/generic.nix +++ b/pkgs/applications/networking/cluster/nomad/generic.nix @@ -6,7 +6,6 @@ , nvidiaGpuSupport , patchelf , nvidia_x11 -, nixosTests }: buildGoPackage rec { @@ -40,8 +39,6 @@ buildGoPackage rec { done ''; - passthru.tests.nomad = nixosTests.nomad; - meta = with lib; { homepage = "https://www.nomadproject.io/"; description = "A Distributed, Highly Available, Datacenter-Aware Scheduler"; diff --git a/pkgs/applications/networking/cluster/nomad/genericModule.nix b/pkgs/applications/networking/cluster/nomad/genericModule.nix new file mode 100644 index 00000000000..c2e65731753 --- /dev/null +++ b/pkgs/applications/networking/cluster/nomad/genericModule.nix @@ -0,0 +1,54 @@ +{ lib +, buildGoModule +, fetchFromGitHub +, version +, sha256 +, vendorSha256 +, nvidiaGpuSupport +, patchelf +, nvidia_x11 +, nixosTests +}: + +buildGoModule rec { + pname = "nomad"; + inherit version; + + subPackages = [ "." ]; + + src = fetchFromGitHub { + owner = "hashicorp"; + repo = pname; + rev = "v${version}"; + inherit sha256; + }; + + inherit vendorSha256; + + nativeBuildInputs = lib.optionals nvidiaGpuSupport [ + patchelf + ]; + + # ui: + # Nomad release commits include the compiled version of the UI, but the file + # is only included if we build with the ui tag. + tags = [ "ui" ] ++ lib.optional (!nvidiaGpuSupport) "nonvidia"; + + # The dependency on NVML isn't explicit. We have to make it so otherwise the + # binary will not know where to look for the relevant symbols. + postFixup = lib.optionalString nvidiaGpuSupport '' + for bin in $out/bin/*; do + patchelf --add-needed "${nvidia_x11}/lib/libnvidia-ml.so" "$bin" + done + ''; + + passthru.tests.nomad = nixosTests.nomad; + + meta = with lib; { + homepage = "https://www.nomadproject.io/"; + description = "A Distributed, Highly Available, Datacenter-Aware Scheduler"; + platforms = platforms.unix; + license = licenses.mpl20; + maintainers = with maintainers; [ rushmorem pradeepchhetri endocrimes maxeaubrey ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 0b3823351c4..b81987922a7 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -7454,7 +7454,7 @@ with pkgs; nvidiaGpuSupport = config.cudaSupport or false; }; nomad_1_1 = callPackage ../applications/networking/cluster/nomad/1.1.nix { - buildGoPackage = buildGo116Package; + buildGoModule = buildGo116Module; inherit (linuxPackages) nvidia_x11; nvidiaGpuSupport = config.cudaSupport or false; }; -- cgit 1.4.1