migrate to nixos modules
This commit is contained in:
@@ -1,44 +1,64 @@
|
||||
{ config, ... }:
|
||||
{ lib, config, ... }:
|
||||
|
||||
{
|
||||
services.thelounge = {
|
||||
enable = true;
|
||||
port = 9000;
|
||||
private = true;
|
||||
extraConfig = {
|
||||
reverseProxy = true;
|
||||
maxHistory = -1;
|
||||
https.enable = false;
|
||||
# theme = "thelounge-theme-solarized";
|
||||
prefetch = false;
|
||||
prefetchStorage = false;
|
||||
fileUpload = {
|
||||
enable = true;
|
||||
maxFileSize = -1;
|
||||
baseUrl = "https://files.neet.cloud/irc/";
|
||||
let
|
||||
cfg = config.services.thelounge;
|
||||
in {
|
||||
options.services.thelounge = {
|
||||
fileUploadBaseUrl = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
};
|
||||
host = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
example = "example.com";
|
||||
};
|
||||
fileHost = {
|
||||
host = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
};
|
||||
path = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
};
|
||||
transports = [ "websocket" "polling" ];
|
||||
leaveMessage = "leaving";
|
||||
messageStorage = [ "sqlite" "text" ];
|
||||
};
|
||||
};
|
||||
|
||||
# the lounge client
|
||||
services.nginx.virtualHosts."irc.neet.dev" = {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
locations."/" = {
|
||||
proxyPass = "http://localhost:${toString config.services.thelounge.port}";
|
||||
proxyWebsockets = true;
|
||||
config = lib.mkIf cfg.enable {
|
||||
services.thelounge = {
|
||||
private = true;
|
||||
extraConfig = {
|
||||
reverseProxy = true;
|
||||
maxHistory = -1;
|
||||
https.enable = false;
|
||||
# theme = "thelounge-theme-solarized";
|
||||
prefetch = false;
|
||||
prefetchStorage = false;
|
||||
fileUpload = {
|
||||
enable = true;
|
||||
maxFileSize = -1;
|
||||
baseUrl = cfg.fileUploadBaseUrl;
|
||||
};
|
||||
transports = [ "websocket" "polling" ];
|
||||
leaveMessage = "leaving";
|
||||
messageStorage = [ "sqlite" "text" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# the lounge files
|
||||
services.nginx.virtualHosts."files.neet.cloud" = {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
locations."/irc" = {
|
||||
proxyPass = "http://localhost:${toString config.services.thelounge.port}/uploads";
|
||||
# the lounge client
|
||||
services.nginx.virtualHosts.${cfg.host} = {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
locations."/" = {
|
||||
proxyPass = "http://localhost:${toString config.services.thelounge.port}";
|
||||
proxyWebsockets = true;
|
||||
};
|
||||
};
|
||||
|
||||
# the lounge files
|
||||
services.nginx.virtualHosts.${cfg.fileHost.host} = {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
locations.${cfg.fileHost.path} = {
|
||||
proxyPass = "http://localhost:${toString config.services.thelounge.port}/uploads";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user