forked from Fediversity/Fediversity
51 lines
1.1 KiB
HCL
51 lines
1.1 KiB
HCL
variable "nixos-anywhere" {
|
|
type = string
|
|
}
|
|
|
|
variable "domain" {
|
|
type = string
|
|
}
|
|
|
|
variable "hostname" {
|
|
type = string
|
|
}
|
|
|
|
variable "config" {
|
|
type = string
|
|
}
|
|
|
|
variable "initialUser" {
|
|
type = object({
|
|
displayName = string
|
|
username = string
|
|
password = string
|
|
email = string
|
|
})
|
|
}
|
|
|
|
module "deploy" {
|
|
# source = "github.com/nix-community/nixos-anywhere//terraform/all-in-one"
|
|
source = "${var.nixos-anywhere}//terraform/all-in-one"
|
|
file = "${path.module}/../${var.config}.nix"
|
|
nixos_system_attr = "config.system.build.toplevel"
|
|
nixos_partitioner_attr = "config.system.build.diskoScript"
|
|
# when instance id changes, it will trigger a reinstall
|
|
instance_id = var.hostname
|
|
target_user = "root"
|
|
target_host = "${var.hostname}.abundos.eu"
|
|
extra_files_script = "${path.module}/../pass-ssh-key.sh"
|
|
extra_environment = {
|
|
host = var.hostname
|
|
}
|
|
special_args = {
|
|
terraform = {
|
|
domain = var.domain
|
|
hostname = var.hostname
|
|
initialUser = var.initialUser
|
|
}
|
|
}
|
|
nix_options = {
|
|
show-trace = true
|
|
}
|
|
# build_on_remote = true
|
|
}
|