2024-09-09 00:22:14 +00:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
inputs,
|
|
|
|
lib,
|
|
|
|
...
|
|
|
|
}:
|
2024-09-13 01:50:53 +00:00
|
|
|
with lib; let
|
2024-09-09 00:22:14 +00:00
|
|
|
cfg = config.custom.settings.containers.foundryvtt;
|
2024-09-13 01:50:53 +00:00
|
|
|
in {
|
|
|
|
options.custom.settings.containers.foundryvtt.enable = mkOption {default = false;};
|
2024-09-09 00:22:14 +00:00
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
2024-09-13 01:50:53 +00:00
|
|
|
age.secrets = let
|
|
|
|
secret = filename: {
|
|
|
|
file = "${inputs.self}/secrets/${filename}";
|
2024-09-09 00:22:14 +00:00
|
|
|
};
|
2024-09-13 01:50:53 +00:00
|
|
|
in {
|
|
|
|
"${config.custom.profile}/foundryvtt/.env" = secret "${config.custom.profile}/foundryvtt/.env";
|
|
|
|
};
|
2024-09-09 00:22:14 +00:00
|
|
|
|
|
|
|
#?? arion-foundryvtt pull
|
|
|
|
environment.shellAliases.arion-foundryvtt = "sudo arion --prebuilt-file ${config.virtualisation.arion.projects.foundryvtt.settings.out.dockerComposeYaml}";
|
|
|
|
|
|
|
|
virtualisation.arion.projects.foundryvtt = {
|
|
|
|
serviceName = "foundryvtt";
|
|
|
|
|
|
|
|
settings.services = {
|
|
|
|
foundryvtt.service = {
|
|
|
|
container_name = "foundryvtt";
|
2024-09-13 01:50:53 +00:00
|
|
|
env_file = [config.age.secrets."${config.custom.profile}/foundryvtt/.env".path];
|
2024-09-09 00:22:14 +00:00
|
|
|
image = "felddy/foundryvtt:12";
|
2024-09-13 01:50:53 +00:00
|
|
|
ports = ["127.0.0.1:30000:30000"];
|
2024-09-09 00:22:14 +00:00
|
|
|
restart = "unless-stopped";
|
2024-09-13 01:50:53 +00:00
|
|
|
volumes = ["${config.custom.settings.containers.directory}/foundryvtt/data:/data"];
|
2024-09-09 00:22:14 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|