git.iko.soy/typeable/nixpkgs
on master help sign in
nomad-autoscaler: various fixes

- don't build `nomad-autoscaler` binary twice - drop unnecessary `removeReferencesTo`

commit49e2877f51528046262a5fdabbdb474881adc25a authorzowoq <59103226+zowoq@users.noreply.github.com> dateSat 5 Feb 2022, 20:12 (5 years ago) parentab07e12
1 file changed+9−11
pkgs/applications/networking/cluster/nomad-autoscaler/default.nix+9−11
pkgs/applications/networking/cluster/nomad-autoscaler/default.nix+9−11
@@ -1,4 +1,4 @@
1−{ lib, fetchFromGitHub, buildGoModule, go, removeReferencesTo, buildEnv }:
1+{ lib, fetchFromGitHub, buildGoModule, buildEnv }:
22
33let
44 package = buildGoModule rec {
@@ -30,21 +30,19 @@ let
3030
3131 vendorSha256 = "sha256-g3INNvAQ124kBJSe5cnsIq1y8sWpPYKLwJONgbIUaoM=";
3232
33− subPackages = [ "." ];
34−
35− nativeBuildInputs = [ removeReferencesTo ];
36−
37− # buildGoModule overrides normal buildPhase, can't use makeTargets
38− postBuild = ''
33+ buildPhase = ''
34+ runHook preBuild
3935 make build plugins
36+ runHook postBuild
4037 '';
4138
4239 # tries to pull tests from network, and fails silently anyway
4340 doCheck = false;
4441
45− postInstall = ''
46− mkdir -p $bin/bin
47− mv $out/bin/nomad-autoscaler $bin/bin/nomad-autoscaler
42+ installPhase = ''
43+ runHook preInstall
44+ mkdir -p $bin/bin $out/bin
45+ mv bin/nomad-autoscaler $bin/bin
4846 ln -s $bin/bin/nomad-autoscaler $out/bin/nomad-autoscaler
4947
5048 for d in $outputs; do
@@ -54,7 +52,6 @@ let
5452
5553 # have out contain all of the plugins
5654 for plugin in bin/plugins/*; do
57− remove-references-to -t ${go} "$plugin"
5855 cp "$plugin" $out/share/
5956 done
6057
@@ -73,6 +70,7 @@ let
7370 mv bin/plugins/prometheus $prometheus/share/
7471 mv bin/plugins/target-value $target_value/share/
7572 mv bin/plugins/threshold $threshold/share/
73+ runHook postInstall
7674 '';
7775
7876 # make toggle-able, so that overrided versions can disable this check if