From 49e2877f51528046262a5fdabbdb474881adc25a Mon Sep 17 00:00:00 2001 From: zowoq <59103226+zowoq@users.noreply.github.com> Date: Sat, 5 Feb 2022 20:12:02 +1000 Subject: [PATCH] nomad-autoscaler: various fixes - don't build `nomad-autoscaler` binary twice - drop unnecessary `removeReferencesTo` --- .../cluster/nomad-autoscaler/default.nix | 20 +++++++++---------- 1 file 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 8eab4d793e63..54cecde09457 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