From deecb4c1aab780047d79978c636eeb879dd68630 Mon Sep 17 00:00:00 2001 From: adisbladis Date: Wed, 28 Mar 2018 08:25:23 +0800 Subject: [PATCH] terraform: Wrap PATH of propagatedBuildInputs (#37861) Plugins (namely terraform-provider-libvirt) may have a run time dependency on external binaries. --- pkgs/applications/networking/cluster/terraform/default.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/networking/cluster/terraform/default.nix b/pkgs/applications/networking/cluster/terraform/default.nix index 8b3e83ea86f..00b753a61a8 100644 --- a/pkgs/applications/networking/cluster/terraform/default.nix +++ b/pkgs/applications/networking/cluster/terraform/default.nix @@ -44,6 +44,9 @@ let let actualPlugins = plugins terraform.plugins; + # Wrap PATH of plugins propagatedBuildInputs, plugins may have runtime dependencies on external binaries + wrapperInputs = lib.unique (lib.flatten (lib.catAttrs "propagatedBuildInputs" (builtins.filter (x: x != null) actualPlugins))); + passthru = { withPlugins = newplugins: withPlugins (x: newplugins x ++ actualPlugins); @@ -64,7 +67,8 @@ let buildCommand = '' mkdir -p $out/bin/ makeWrapper "${terraform.bin}/bin/terraform" "$out/bin/terraform" \ - --set NIX_TERRAFORM_PLUGIN_DIR "${buildEnv { name = "tf-plugin-env"; paths = actualPlugins; }}/bin" + --set NIX_TERRAFORM_PLUGIN_DIR "${buildEnv { name = "tf-plugin-env"; paths = actualPlugins; }}/bin" \ + --prefix PATH : "${lib.makeBinPath wrapperInputs}" ''; inherit passthru;