switch to tofu from terraform

This commit is contained in:
Jörg Thalheim 2024-03-12 11:28:00 +01:00
parent fd2cbba2e9
commit 06443ea314
2 changed files with 11 additions and 7 deletions

View File

@ -4,7 +4,13 @@
, pkgs , pkgs
, lib , lib
, ... , ...
}: { }:
let
convert2Tofu = provider: provider.override (prev: {
homepage = builtins.replaceStrings [ "registry.terraform.io/providers" ] [ "registry.opentofu.org" ] prev.homepage;
});
in
{
devShells.default = pkgs.mkShellNoCC { devShells.default = pkgs.mkShellNoCC {
packages = [ packages = [
pkgs.bashInteractive pkgs.bashInteractive
@ -12,15 +18,13 @@
inputs'.clan-core.packages.clan-cli inputs'.clan-core.packages.clan-cli
((pkgs.terraform.withPlugins (p: [ (pkgs.opentofu.withPlugins (p: builtins.map convert2Tofu [
p.hetznerdns p.hetznerdns
p.hcloud p.hcloud
p.null p.null
p.external p.external
p.local p.local
])).overrideAttrs (old: { ]))
meta = old.meta // { license = lib.licenses.free; };
}))
]; ];
inputsFrom = [ inputsFrom = [
inputs'.clan-core.devShells.default inputs'.clan-core.devShells.default

View File

@ -14,5 +14,5 @@ cleanup() {
} }
trap "cleanup" EXIT trap "cleanup" EXIT
terraform init tofu init
terraform "$@" tofu "$@"