Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use opentofu over terraform #69

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

KiaraGrouwstra
Copy link
Contributor

this PR replaces the use of terraform with the open-source fork opentofu, as suggested at #60.

it may be possible to refactor this to take out the ugly patch for the registry (may involve a change over at nixpkgs), but for now i wanted to focus on gathering feedback on the idea first.

while this implementation flat-out replaces the package, i actually hoped to maybe let the user choose, but came up blank with an elegant way to handle that kind of conditional here.

Copy link
Member

@yannham yannham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool to see support for OpenTofu! We should probably propose both terraform and opentofu in the output indeed.

To do so we'll have to pull anything that depends on either terraform in their own definition if not already the case (e.g. mkDevShell, while generateJsonSchema or terraformProviders are already in a let-binding), then make them functions taking a terraform package as an argument so that we can pass either opentofu or terraform, instead of relying on pkgs or the ambiant self.terraform.

Since flake outputs are notoriously not parametrizable, it's reasonable to duplicate each output that depends on terraform as a -terraform version and an -opentofu version.

Would that make sense somehow?

flake.nix Outdated Show resolved Hide resolved
@KiaraGrouwstra
Copy link
Contributor Author

@yannham thanks, that makes sense!
i now pushed commits to:

on merge of #68 i'll rebase on that as well.

Copy link
Member

@yannham yannham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, looks good overall, beside a few details. I understand that you would like to get #68 merged first, and then rebase? Note that the CI is failing on the later PR.

flake.nix Outdated Show resolved Hide resolved
flake.nix Show resolved Hide resolved
flake.nix Show resolved Hide resolved
@KiaraGrouwstra
Copy link
Contributor Author

@yannham:

Thanks, looks good overall, beside a few details. I understand that you would like to get #68 merged first, and then rebase? Note that the CI is failing on the later PR.

Thanks for your feedback!

On the CI, I seem able to reproduce the failure using main branch - this regression seems induced probably by a new nixos-unstable rather than by my PRs.

@KiaraGrouwstra
Copy link
Contributor Author

hm, looks like a few dependencies cause the check to fail when updated - see #73, #74.

@KiaraGrouwstra KiaraGrouwstra mentioned this pull request Jan 11, 2025
@KiaraGrouwstra KiaraGrouwstra force-pushed the opentofu branch 2 times, most recently from 71a6cbc to 669c163 Compare January 17, 2025 12:44
@KiaraGrouwstra
Copy link
Contributor Author

rebased now

@yannham
Copy link
Member

yannham commented Jan 17, 2025

It just needs a nixpkgs-fmt flake.nix; we check formatting as part of the CI.

@KiaraGrouwstra
Copy link
Contributor Author

thanks, done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants