mirror of
https://git.sr.ht/~magic_rb/dotfiles
synced 2024-12-01 20:46:12 +01:00
0d4698ab78
Signed-off-by: Magic_RB <magic_rb@redalder.org>
58 lines
1.4 KiB
Nix
58 lines
1.4 KiB
Nix
{ elib, tflib, vars, ... }:
|
|
let
|
|
inherit (elib)
|
|
nfsVolume
|
|
nomadJob;
|
|
inherit (tflib)
|
|
tf;
|
|
in
|
|
{
|
|
variable."dont_deploy_containers" = {
|
|
type = "boolean";
|
|
description = "Whether the data to deploy containers properly is available.";
|
|
};
|
|
|
|
resource."vault_policy"."dovecot-policy" = nfsVolume {
|
|
name = "dovecot-policy";
|
|
policy = ''
|
|
path "kv/data/cluster/dovecot" {
|
|
capabilities = ["read"]
|
|
}
|
|
'';
|
|
};
|
|
|
|
resource."vault_policy"."getmail-policy" = nfsVolume {
|
|
name = "getmail-policy";
|
|
policy = ''
|
|
path "kv/data/cluster/getmail" {
|
|
capabilities = ["read"]
|
|
}
|
|
'';
|
|
};
|
|
|
|
resource."nomad_volume"."dovecot_maildir" = {
|
|
volume_name = "org.democratic-csi.nfs";
|
|
access_mode = "multi-node-multi-writer";
|
|
server = "blowhole.hosts.in.redalder.org";
|
|
share = "/var/nfs/dovecot/maildir";
|
|
mount_flags = [ "nfsvers=3" "hard" "async" ];
|
|
};
|
|
|
|
resource."nomad_volume"."mail-configuration" = {
|
|
volume_name = "mail-configuration";
|
|
access_mode = "single-node-writer";
|
|
server = "blowhole.hosts.in.redalder.org";
|
|
share = "/var/nfs/mail-configuration";
|
|
mount_flags = [ "nfsvers=3" "hard" "async" ];
|
|
};
|
|
|
|
resource."nomad_job"."email" = {
|
|
count = tf "var.dont_deploy_containers ? 0 : 1";
|
|
jobspec = ./job.hcl;
|
|
vars = {
|
|
flake_ref = "${vars.flake_host}?rev=${vars.flake_rev}&ref=${vars.flake_ref}";
|
|
flake_sha = vars.flake_sha;
|
|
};
|
|
};
|
|
}
|