forked from Fediversity/Fediversity
intended to swap out nixos-anywhere for terraform-nixos, over: - don't need nixos-anywhere to install nixos; we preload nixos to VMs - [awkward non-flake usage](https://nix-community.github.io/nixos-anywhere/howtos/use-without-flakes.html#3-set-nixos-version-to-use) - seemed not to pick up on config changes, as observed by test VMs losing their panel keys after TF sync however, it seems that terraform-nixos has its own flaws: - its output using a random id, i.e. forcing to push even on no changes - so far did not get ssh authentication to work
92 lines
1.7 KiB
HCL
92 lines
1.7 KiB
HCL
variable "terraform-nixos" {
|
|
type = string
|
|
}
|
|
|
|
variable "domain" {
|
|
type = string
|
|
default = "fediversity.net"
|
|
}
|
|
|
|
variable "mastodon" {
|
|
type = object({
|
|
enable = bool
|
|
})
|
|
default = {
|
|
enable = false
|
|
}
|
|
}
|
|
|
|
variable "pixelfed" {
|
|
type = object({
|
|
enable = bool
|
|
})
|
|
default = {
|
|
enable = false
|
|
}
|
|
}
|
|
|
|
variable "peertube" {
|
|
type = object({
|
|
enable = bool
|
|
})
|
|
default = {
|
|
enable = false
|
|
}
|
|
}
|
|
|
|
variable "initialUser" {
|
|
type = object({
|
|
displayName = string
|
|
username = string
|
|
email = string
|
|
# TODO: mark (nested) credentials as sensitive
|
|
# https://discuss.hashicorp.com/t/is-it-possible-to-mark-an-attribute-of-an-object-as-sensitive/24649/2
|
|
password = string
|
|
})
|
|
default = {
|
|
displayName = "Testy McTestface"
|
|
username = "test"
|
|
email = "test@test.com"
|
|
password = "testtest"
|
|
}
|
|
}
|
|
|
|
# module "garage" {
|
|
# source = "./vm"
|
|
# count = var.mastodon.enable || var.pixelfed.enable || var.peertube.enable ? 1 : 0
|
|
# domain = var.domain
|
|
# hostname = "test01"
|
|
# config = "garage"
|
|
# initialUser = var.initialUser
|
|
# terraform-nixos = var.terraform-nixos
|
|
# }
|
|
|
|
module "mastodon" {
|
|
source = "./vm"
|
|
count = var.mastodon.enable ? 1 : 0
|
|
domain = var.domain
|
|
hostname = "test06"
|
|
config = "mastodon"
|
|
initialUser = var.initialUser
|
|
terraform-nixos = var.terraform-nixos
|
|
}
|
|
|
|
module "pixelfed" {
|
|
source = "./vm"
|
|
count = var.pixelfed.enable ? 1 : 0
|
|
domain = var.domain
|
|
hostname = "test04"
|
|
config = "pixelfed"
|
|
initialUser = var.initialUser
|
|
terraform-nixos = var.terraform-nixos
|
|
}
|
|
|
|
module "peertube" {
|
|
source = "./vm"
|
|
count = var.peertube.enable ? 1 : 0
|
|
domain = var.domain
|
|
hostname = "test03"
|
|
config = "peertube"
|
|
initialUser = var.initialUser
|
|
terraform-nixos = var.terraform-nixos
|
|
}
|