move info passed to facilitate passing extra config

This commit is contained in:
Kiara Grouwstra 2025-04-17 17:52:07 +02:00
parent 9a9285eaa0
commit da030f8b4f
Signed by: kiara
SSH key fingerprint: SHA256:COspvLoLJ5WC5rFb9ZDe5urVCkK4LJZOsjfF4duRJFU

View file

@ -89,12 +89,6 @@ resource "terraform_data" "nixos" {
os = import <nixpkgs/nixos> {
system = "${local.system}";
configuration = {
# needed info passed in thru json from TF
terraform = builtins.fromJSON "${replace(jsonencode({
domain = var.domain
hostname = each.value.hostname
initialUser = var.initialUser
}), "\"", "\\\"")}";
# note interpolations here TF ones
imports = [
${path.root}/options.nix
@ -105,7 +99,15 @@ resource "terraform_data" "nixos" {
];
# nix path for debugging
nix.nixPath = [ "${local.nix_path}" ];
};
} //
# info passed in thru json from TF
builtins.fromJSON "${replace(jsonencode({
terraform = {
domain = var.domain
hostname = each.value.hostname
initialUser = var.initialUser
}
}), "\"", "\\\"")}";
};
in
# info we want to get back out