2023-06-15 23:06:47 +02:00
|
|
|
{
|
2024-03-02 22:05:30 +01:00
|
|
|
elib,
|
|
|
|
secret,
|
|
|
|
vars,
|
|
|
|
config',
|
|
|
|
...
|
|
|
|
}: let
|
|
|
|
inherit
|
|
|
|
(elib)
|
|
|
|
nfsVolume
|
|
|
|
nomadJob
|
|
|
|
;
|
|
|
|
in {
|
2024-02-11 12:29:34 +01:00
|
|
|
terraform.required_providers = {
|
|
|
|
nomad = {
|
2024-03-02 22:05:30 +01:00
|
|
|
source = "hashicorp/nomad";
|
|
|
|
configuration_aliases = ["nomad.do-1"];
|
2024-02-11 12:29:34 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2023-06-15 23:06:47 +02:00
|
|
|
resource."nomad_volume"."ingress-letsencrypt" = nfsVolume {
|
2024-02-11 12:29:34 +01:00
|
|
|
provider = "nomad.do-1";
|
2023-06-15 23:06:47 +02:00
|
|
|
volume_name = "ingress-letsencrypt";
|
|
|
|
access_mode = "single-node-writer";
|
2023-11-19 12:33:11 +01:00
|
|
|
server = secret.network.ips.blowhole.ip or "";
|
2024-01-11 10:20:05 +01:00
|
|
|
share = "/mnt/kyle/infrastructure/ingress-toothpick/letsencrypt";
|
2024-03-02 22:05:30 +01:00
|
|
|
mount_flags = ["nolock" "hard"];
|
2023-06-15 23:06:47 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
resource."nomad_job"."ingress" = nomadJob {
|
|
|
|
jobspec = ./job.hcl;
|
|
|
|
vars = {
|
2023-06-19 00:41:49 +02:00
|
|
|
flake_ref = "${vars.flake_host}?rev=${vars.flake_rev}&ref=${vars.flake_ref}";
|
|
|
|
flake_sha = vars.flake_sha;
|
2023-07-10 23:37:54 +02:00
|
|
|
store_path = config'.flake.nixngConfigurations.ingressToothpick.config.system.build.toplevel;
|
2023-06-15 23:06:47 +02:00
|
|
|
upstreams = "\${file(\"${./upstreams.conf}\")}";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|