forked from Fediversity/Fediversity
44 lines
1.1 KiB
HCL
44 lines
1.1 KiB
HCL
locals {
|
|
vm_domain = "abundos.eu"
|
|
}
|
|
|
|
module "nixos" {
|
|
source = "../sync-nix"
|
|
|
|
vm_domain = local.vm_domain
|
|
hostname = each.value.hostname
|
|
config_nix = each.value.config_nix
|
|
config_tf = each.value.config_tf
|
|
|
|
for_each = { for name, inst in {
|
|
# wiki = "vm02187" # does not resolve
|
|
# forgejo = "vm02116" # does not resolve
|
|
# TODO: move these to a separate `host` dir
|
|
dns = "fedi200"
|
|
fedipanel = "fedi201"
|
|
} : name => {
|
|
hostname = inst
|
|
config_tf = {
|
|
terraform = {
|
|
domain = local.vm_domain
|
|
hostname = inst
|
|
}
|
|
}
|
|
config_nix = <<-EOF
|
|
{
|
|
# note interpolations here TF ones
|
|
imports = [
|
|
# shared NixOS config
|
|
${path.root}/../common/shared.nix
|
|
# FIXME: separate template options by service
|
|
${path.root}/options.nix
|
|
# for service `forgejo` import `forgejo.nix`
|
|
${path.root}/../../machines/dev/${inst}/${name}.nix
|
|
# FIXME: get VM details from TF
|
|
${path.root}/../../machines/dev/${inst}
|
|
];
|
|
}
|
|
EOF
|
|
}
|
|
}
|
|
}
|