modularization of all servers donion rings
This commit is contained in:
50
modules/servers/flame.nix
Normal file
50
modules/servers/flame.nix
Normal 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 // { };
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user