summary refs log tree commit diff
diff options
context:
space:
mode:
authorzowoq <59103226+zowoq@users.noreply.github.com>2022-02-05 20:12:02 +1000
committerJonathan Ringer <jonringer@users.noreply.github.com>2022-02-07 14:35:20 -0800
commit49e2877f51528046262a5fdabbdb474881adc25a (patch)
treeaa5a39d213f2384c5a70f074c709828a5ffc5dc8
parentab07e129886629b235906e9fa31902138dfe53ba (diff)
downloadnixpkgs-49e2877f51528046262a5fdabbdb474881adc25a.tar
nixpkgs-49e2877f51528046262a5fdabbdb474881adc25a.tar.gz
nixpkgs-49e2877f51528046262a5fdabbdb474881adc25a.tar.bz2
nixpkgs-49e2877f51528046262a5fdabbdb474881adc25a.tar.lz
nixpkgs-49e2877f51528046262a5fdabbdb474881adc25a.tar.xz
nixpkgs-49e2877f51528046262a5fdabbdb474881adc25a.tar.zst
nixpkgs-49e2877f51528046262a5fdabbdb474881adc25a.zip
nomad-autoscaler: various fixes
- don't build `nomad-autoscaler` binary twice
- drop unnecessary `removeReferencesTo`
-rw-r--r--pkgs/applications/networking/cluster/nomad-autoscaler/default.nix20
1 files changed, 9 insertions, 11 deletions
diff --git a/pkgs/applications/networking/cluster/nomad-autoscaler/default.nix b/pkgs/applications/networking/cluster/nomad-autoscaler/default.nix
index 8eab4d793e6..54cecde0945 100644
--- a/pkgs/applications/networking/cluster/nomad-autoscaler/default.nix
+++ b/pkgs/applications/networking/cluster/nomad-autoscaler/default.nix
@@ -1,4 +1,4 @@
-{ lib, fetchFromGitHub, buildGoModule, go, removeReferencesTo, buildEnv }:
+{ lib, fetchFromGitHub, buildGoModule, buildEnv }:
 
 let
   package = buildGoModule rec {
@@ -30,21 +30,19 @@ let
 
     vendorSha256 = "sha256-g3INNvAQ124kBJSe5cnsIq1y8sWpPYKLwJONgbIUaoM=";
 
-    subPackages = [ "." ];
-
-    nativeBuildInputs = [ removeReferencesTo ];
-
-    # buildGoModule overrides normal buildPhase, can't use makeTargets
-    postBuild = ''
+    buildPhase = ''
+      runHook preBuild
       make build plugins
+      runHook postBuild
     '';
 
     # tries to pull tests from network, and fails silently anyway
     doCheck = false;
 
-    postInstall = ''
-      mkdir -p $bin/bin
-      mv $out/bin/nomad-autoscaler $bin/bin/nomad-autoscaler
+    installPhase = ''
+      runHook preInstall
+      mkdir -p $bin/bin $out/bin
+      mv bin/nomad-autoscaler $bin/bin
       ln -s $bin/bin/nomad-autoscaler $out/bin/nomad-autoscaler
 
       for d in $outputs; do
@@ -54,7 +52,6 @@ let
 
       # have out contain all of the plugins
       for plugin in bin/plugins/*; do
-        remove-references-to -t ${go} "$plugin"
         cp "$plugin" $out/share/
       done
 
@@ -73,6 +70,7 @@ let
       mv bin/plugins/prometheus $prometheus/share/
       mv bin/plugins/target-value $target_value/share/
       mv bin/plugins/threshold $threshold/share/
+      runHook postInstall
     '';
 
     # make toggle-able, so that overrided versions can disable this check if