summary refs log tree commit diff
diff options
context:
space:
mode:
authorMaxine Aubrey <maxeaubrey@gmail.com>2021-07-29 18:41:57 +0200
committerMaxine Aubrey <maxeaubrey@gmail.com>2021-08-17 14:54:45 +0200
commitc59201d8fbe220b6510aa4f3397ee2a493015b5e (patch)
tree23f35aa6b936f6eb9175cb808c8e3c4a740dbb15
parent3bb2af26e857a2b3a5adedb5744ec701b51a14d7 (diff)
downloadnixpkgs-c59201d8fbe220b6510aa4f3397ee2a493015b5e.tar
nixpkgs-c59201d8fbe220b6510aa4f3397ee2a493015b5e.tar.gz
nixpkgs-c59201d8fbe220b6510aa4f3397ee2a493015b5e.tar.bz2
nixpkgs-c59201d8fbe220b6510aa4f3397ee2a493015b5e.tar.lz
nixpkgs-c59201d8fbe220b6510aa4f3397ee2a493015b5e.tar.xz
nixpkgs-c59201d8fbe220b6510aa4f3397ee2a493015b5e.tar.zst
nixpkgs-c59201d8fbe220b6510aa4f3397ee2a493015b5e.zip
nomad_1_1: 1.1.2 -> 1.1.3
-rw-r--r--pkgs/applications/networking/cluster/nomad/1.1.nix11
-rw-r--r--pkgs/applications/networking/cluster/nomad/generic.nix3
-rw-r--r--pkgs/applications/networking/cluster/nomad/genericModule.nix54
-rw-r--r--pkgs/top-level/all-packages.nix2
4 files changed, 61 insertions, 9 deletions
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;
   };