Compare commits

..

No commits in common. "6a105c2fce35c7bea58c78a8bc56917e623d80f4" and "6a4eb906581591043bca5e60e03970e2165a5d8c" have entirely different histories.

View file

@ -76,7 +76,7 @@ locals {
}
peertube = {
cfg = var.peertube
hostname = "test05"
hostname = "test03"
}
}
peripherals = { for name, inst in local.peripheral_configs : name => {
@ -98,26 +98,19 @@ data "external" "hash" {
program = ["echo", "{\"hash\":\"$(nix-hash ..)\"}"]
}
# merged instantiate/deploy to prevent 24+s instantiates when nothing changed.
# merge instantiate/deploy, cuz i don't want 24+s instantiates when nothing changed.
# terraform-nixos separates these to only deploy if instantiate changed.
# FIXME find a better solution for this. current considerations were:
# - generic resources cannot have outputs, while we want info from the instantiation (unless built on host?).
# - `data` always runs, which is slow for deploy/instantiation.
resource "terraform_data" "nixos" {
# - `resource null_resource` cannot have outputs, while we want info from the instantiation (unless built on host?).
# - `data external` always runs, which is undesirable for steps like deploy/instantiation.
# FIXME null_resource docs recommend terraform_data over null_resource
resource "null_resource" "deploy_nixos" {
for_each = {for name, inst in merge(
local.peripherals,
local.applications,
) : name => inst if inst.cfg.enable}
triggers_replace = [
data.external.hash.result,
var.deploy_environment,
var.domain,
var.initialUser,
local.system,
each.key,
each.value,
]
triggers = data.external.hash.result
provisioner "local-exec" {
working_dir = path.root