sfos/hosts/sfos-2/nomad.nix
2025-03-16 20:15:03 -06:00

58 lines
1.3 KiB
Nix

{...}: {
services.nomad = {
enable = true;
enableDocker = true;
settings = {
server = {
enabled = true;
# Ideally the bootstrap expect value would reflect the number of servers set by `instance_count`, but in the interest
# of not chaning each server's "user data" every time the instance_count changes, we hard code the nomad cluster to
# bootstrap itself whenever 3 nodes are present
bootstrap_expect = 3;
server_join = {
retry_join = [];
};
};
acl = {
enabled = true;
};
client = {
enabled = true;
};
plugin.docker = {
config = {
gc = {
image = true;
image_delay = "3m";
container = true;
dangling_containers = {
enabled = true;
dry_run = false;
period = "5m";
creation_grace = "5m";
};
};
volumes = {
enabled = true;
selinuxlabel = "z";
};
allow_caps = ["chown" "net_raw"];
allow_privileged = true;
};
};
plugin.raw_exec = {
config = {
enabled = true;
};
};
};
};
}