masive rewriting and setup of server files
This commit is contained in:
@@ -2,26 +2,30 @@
|
||||
lib,
|
||||
config,
|
||||
proxyReverse,
|
||||
setup,
|
||||
...
|
||||
}:
|
||||
let
|
||||
port = 8881;
|
||||
cfg = config.my.servers.metube;
|
||||
in
|
||||
{
|
||||
options.my.servers.metube.enable = lib.mkEnableOption "enable";
|
||||
config = lib.mkIf config.my.servers.metube.enable {
|
||||
virtualisation.oci-containers.containers.metube = {
|
||||
image = "ghcr.io/alexta69/metube";
|
||||
ports = [ "${toString port}:8081" ];
|
||||
options.my.servers.metube = setup.mkOptions "metube" "bajameesta" 8881;
|
||||
config = {
|
||||
networking.firewall.allowedTCPPorts = lib.mkIf (!cfg.isLocal) [ cfg.port ];
|
||||
virtualisation.oci-containers.containers.metube = lib.mkIf cfg.enable {
|
||||
image = "ghcr.io/alexta69/metube:latest";
|
||||
ports = [ "${toString cfg.port}:8081" ];
|
||||
volumes = [
|
||||
"${config.my.containerData}/metube:/downloads"
|
||||
"/home/jawz/.local/share/cookies.txt:/cookies.txt"
|
||||
];
|
||||
environment = {
|
||||
TZ = "America/Mexico_City";
|
||||
TZ = config.my.timeZone;
|
||||
YTDL_OPTIONS = ''{"cookiefile":"/cookies.txt"}'';
|
||||
};
|
||||
};
|
||||
services.nginx.virtualHosts."bajameesta.${config.my.domain}" = proxyReverse port // { };
|
||||
services.nginx.virtualHosts."${cfg.host}" = lib.mkIf cfg.enableProxy (
|
||||
proxyReverse cfg.hostName cfg.port // { }
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user