modularization of all servers donion rings

This commit is contained in:
2024-06-15 00:27:14 -06:00
parent add0490415
commit fbf81f60ce
22 changed files with 618 additions and 521 deletions

50
modules/servers/flame.nix Normal file
View File

@@ -0,0 +1,50 @@
{ lib, config, proxyReverse, ... }:
let
port = 5005;
portSecret = 5007;
in {
options.my.servers = {
flame.enable = lib.mkEnableOption "enable";
flameSecret.enable = lib.mkEnableOption "enable";
};
config = lib.mkIf config.my.servers.flame.enable {
virtualisation.oci-containers = {
backend = "docker";
containers = {
flame = {
autoStart = true;
image = "pawelmalak/flame";
ports = [ "${toString port}:${toString port}" ];
volumes = [
"${config.my.containerData}/flame:/app/data"
"${config.my.containerSocket}:${config.my.containerSocket}"
];
environment = {
TZ = "America/Mexico_City";
PUID = "1000";
PGID = "100";
PASSWORD = "RkawpqMc8lR56QyU7JSfiLhG";
};
};
flame-nsfw = {
autoStart = true;
image = "pawelmalak/flame";
ports = [ "${toString portSecret}:${toString port}" ];
volumes = [ "${config.my.containerData}/flame-nsfw:/app/data" ];
environment = {
TZ = "America/Mexico_City";
PUID = "1000";
PGID = "100";
PASSWORD = "RkawpqMc8lR56QyU7JSfiLhG";
};
};
};
};
services.nginx = {
enable = true;
virtualHosts."start.${config.my.domain}" = proxyReverse port // { };
virtualHosts."qampqwn4wprhqny8h8zj.${config.my.domain}" =
proxyReverse portSecret // { };
};
};
}