Added irc service

This commit is contained in:
Julien Malka 2022-03-11 01:07:21 +01:00
parent 8ebcb7ef4f
commit 4c9e93f508
No known key found for this signature in database
GPG key ID: 3C68E13964FEA07F
3 changed files with 25 additions and 22 deletions

View file

@ -11,6 +11,7 @@
luj = {
irc.enable = true;
mediaserver = {
enable = true;
tv.enable = true;

View file

@ -2,30 +2,32 @@
with lib;
let
cfg = config.luj.irc;
port = 9117;
port = 2042;
in
{
options.luj.irc = {
enable = mkEnableOption "activate weechat service";
nginx.enable = mkEnableOption "activate nginx";
nginx.subdomain = mkOption {
type = types.str;
};
config = mkIf cfg.enable {
services.weechat.enable = true;
services.nginx.virtualHosts."irc.julienmalka.me" = {
forceSSL = true;
enableACME = true;
locations."^~ /weechat" = {
proxyPass = "http://127.0.0.1:${builtins.toString port}";
proxyWebsockets = true;
};
locations."/" = {
root = pkgs.glowing-bear;
};
};
};
config = mkIf cfg.enable (
mkMerge [{
services.weechat.enable = true;
}
(mkIf cfg.nginx.enable (mkPrivateSubdomain cfg.nginx.subdomain port))
(mkIf cfg.nginx.enable (mkVPNSubdomain cfg.nginx.subdomain port))]);
}

View file

@ -21,11 +21,11 @@ in
services.nginx = {
enable = true;
recommendedOptimisation = true;
recommendedTlsSettings = true;
recommendedProxySettings = true;
clientMaxBodySize = "128m";
recommendedGzipSettings = true;
recommendedOptimisation = true;
recommendedProxySettings = true;
recommendedTlsSettings = true;
commonHttpConfig = ''
server_names_hash_bucket_size 128;
'';