Fediversity/infra/dev/main.tf

41 lines
1.1 KiB
HCL

module "nixos" {
source = "./deploy"
hostname = each.value.hostname
config_nix = each.value.config_nix
config_tf = each.value.config_nix
for_each = { for name, inst in {
wiki = "vm02187"
forgejo = "vm02116"
# TODO: move these to a separate `host` dir
dns = "fedi200"
demo = "fedi201"
} : name => {
hostname = inst
config_nix = {
terraform = {
domain = local.vm_domain
hostname = inst
}
}
config_nix = <<-EOF
{
# note interpolations here TF ones
imports = [
# shared NixOS config
${path.root}/../launch/shared.nix
# FIXME: separate template options by service
${path.root}/options.nix
# for service `forgejo` import `forgejo.nix`
${path.root}/machines/${inst}/${name}.nix
# FIXME: get VM details from TF
${path.root}/machines/${inst}
];
# nix path for debugging
nix.nixPath = [ "${local.nix_path}" ];
}
EOF
}
}
}