opentofu: move the plugin patch from plugins to withPlugins

makes it easier to transparently swap out terraform/opentofu.
This commit is contained in:
Kiara Grouwstra
2025-01-10 10:55:19 +10:00
committed by zowoq
parent a0f3986b0d
commit ffacb08c63
+12 -17
View File
@@ -99,10 +99,17 @@ let
in
test;
plugins =
lib.mapAttrs
(
_: provider:
plugins = removeAttrs terraform-providers [
"override"
"overrideDerivation"
"recurseForDerivations"
];
withPlugins =
plugins:
let
actualPlugins = lib.lists.map (
provider:
if provider ? override then
# use opentofu plugin registry over terraform's
provider.override (oldArgs: {
@@ -116,19 +123,7 @@ let
})
else
provider
)
(
removeAttrs terraform-providers [
"override"
"overrideDerivation"
"recurseForDerivations"
]
);
withPlugins =
plugins:
let
actualPlugins = plugins package.plugins;
) (plugins package.plugins);
# Wrap PATH of plugins propagatedBuildInputs, plugins may have runtime dependencies on external binaries
wrapperInputs = lib.unique (