Compare commits

..

2 commits

Author SHA1 Message Date
d955e39f4c
simplify tf 2025-04-12 22:18:21 +02:00
3418d0e76d
get terraform-nixos working deployed 2025-04-12 22:11:23 +02:00
4 changed files with 28 additions and 34 deletions

View file

@ -64,6 +64,23 @@ variable "deploy_environment" {
default = {}
}
locals {
applications = {
mastodon = {
cfg = var.mastodon
hostname = "test06"
}
pixelfed = {
cfg = var.pixelfed
hostname = "test04"
}
peertube = {
cfg = var.peertube
hostname = "test03"
}
}
}
# module "garage" {
# source = "./vm"
# count = var.mastodon.enable || var.pixelfed.enable || var.peertube.enable ? 1 : 0
@ -76,38 +93,14 @@ variable "deploy_environment" {
# deploy_environment = var.deploy_environment
# }
module "mastodon" {
module "nixos" {
source = "./vm"
count = var.mastodon.enable ? 1 : 0
domain = var.domain
hostname = "test06"
config = "mastodon"
initialUser = var.initialUser
terraform-nixos = var.terraform-nixos
ssh_private_key_file = var.ssh_private_key_file
deploy_environment = var.deploy_environment
}
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
ssh_private_key_file = var.ssh_private_key_file
deploy_environment = var.deploy_environment
}
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
ssh_private_key_file = var.ssh_private_key_file
deploy_environment = var.deploy_environment
for_each = { for name, inst in local.applications : name => inst if inst.cfg.enable }
config = each.key
hostname = each.value.hostname
}

View file

@ -1 +1 @@
{"terraform-nixos": "/nix/store/8mh14khb56hqyslxhla0nzdzi2wp6wp7-source"}
{"terraform-nixos": "/nix/store/7rx25dwsw2xv9462rk2vkwy4qv33w76x-source"}

View file

@ -68,7 +68,8 @@ module "deploy" {
];
}
EOT
# build_on_target = false
perform_gc = false
build_on_target = false
# triggers = {
# # pins = data.external.pins.result
# }

View file

@ -79,10 +79,10 @@
"owner": "KiaraGrouwstra",
"repo": "terraform-nixos"
},
"branch": "env-hermetic",
"revision": "cc28d99966d0c742265d1551c622383fd775dd30",
"url": "https://github.com/KiaraGrouwstra/terraform-nixos/archive/cc28d99966d0c742265d1551c622383fd775dd30.tar.gz",
"hash": "17a01my75ccxpn5h40w3855hkj2mkfm0q0chxwxcnq8g9hh67waj"
"branch": "fediversity",
"revision": "54c57ae2e8c312c1b9f69524462d588966ed23b4",
"url": "https://github.com/KiaraGrouwstra/terraform-nixos/archive/54c57ae2e8c312c1b9f69524462d588966ed23b4.tar.gz",
"hash": "1yxps17ac5sljd1ri2p1q1x9h8dcxfpcf0hh6wcpic8ydwy45qql"
}
},
"version": 3