Skip to content

Conversation

KiaraGrouwstra
Copy link

closes #77.

exposes specialArgs.

usage

passing values just from TF

extra_build_args = [
  "--arg",
  "specialArgs",
  <<-EOT
    builtins.fromJSON ''${jsonencode({
      # TF map of keys to pass to each nixos module
      my = local.cool_value
    })}''
  EOT
]

passing values from both nix and TF

extra_build_args = [
  "--arg",
  "specialArgs",
  <<-EOT
    {
      # keys to add to each 
      my_cool = "nix string";
      # but here's why we're here: values from TF!
      much_tofu = builtins.fromJSON ''${jsonencode({
        # TF map of keys to pass to each nixos module
        my = local.cool_value
      })}'';
    }
  EOT
]

prerequisites

  • flake = false
  • hermetic = false

@KiaraGrouwstra
Copy link
Author

KiaraGrouwstra commented Apr 9, 2025

alternatively, using #85 one could manually pass something similar to the code changes here into config

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.

How to pass parameters to Nix script from Terraform?
1 participant