From 234cd1d1fc53e93abfddb5f24b79da85030fd2a4 Mon Sep 17 00:00:00 2001 From: Julien Malka Date: Wed, 25 May 2022 07:34:01 +0200 Subject: [PATCH] Changed irc service --- machines/lisa/default.nix | 28 ++++++++++++++++++++++----- modules/irc/default.nix | 40 +++++++++++++++++++-------------------- 2 files changed, 43 insertions(+), 25 deletions(-) diff --git a/machines/lisa/default.nix b/machines/lisa/default.nix index 0b4c4fd..e09ed5a 100644 --- a/machines/lisa/default.nix +++ b/machines/lisa/default.nix @@ -51,7 +51,6 @@ }; - # make the tailscale command usable to users environment.systemPackages = [ pkgs.tailscale ]; @@ -59,7 +58,7 @@ services.tailscale.enable = true; - nix.maxJobs = lib.mkDefault 4; + nix.maxJobs = lib.mkDefault 6; boot.binfmt.emulatedSystems = [ "aarch64-linux" ]; services.fail2ban.enable = true; @@ -89,17 +88,36 @@ services.zfs.autoSnapshot.enable = true; services.zfs.autoScrub.enable = true; - system.stateVersion = "21.11"; - + networking.wireguard.interfaces = { + wg0 = { + ips = [ "fd85:27e8:fc9::6/128" ]; + listenPort = 51820; + privateKeyFile = "/root/wg-private"; + + peers = [ + { + allowedIPs = [ "fd85:27e8:fc9::/48" ]; + publicKey = "ZO8j0AwssAERtyJQO+o11pWAFKzkxTI5hmqHsfEy5Bo="; + endpoint = "core01.rz.ens.wtf:51820"; + persistentKeepalive = 25; + } + ]; + }; + }; + networking.firewall.allowedTCPPorts = [ 51821 ]; + networking.firewall.allowedUDPPorts = [ 51821 ]; services.nginx.virtualHosts."jellyfin.mondon.me" = { enableACME = true; forceSSL = true; locations."/" = { proxyWebsockets = true; - proxyPass = "http://100.74.49.77"; + proxyPass = "https://100.74.49.77"; }; }; + system.stateVersion = "21.11"; + + } diff --git a/modules/irc/default.nix b/modules/irc/default.nix index 33d110d..d9876d2 100644 --- a/modules/irc/default.nix +++ b/modules/irc/default.nix @@ -2,32 +2,32 @@ with lib; let cfg = config.luj.irc; - port = 2042; + port = 9000; in { options.luj.irc = { - enable = mkEnableOption "activate weechat service"; - }; + enable = mkEnableOption "activate irc service"; - 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; - }; + nginx.enable = mkEnableOption "activate nginx"; + nginx.subdomain = mkOption { + type = types.str; }; }; + + config = mkIf cfg.enable ( + mkMerge [{ + services.thelounge = { + enable = true; + }; + + } + + (mkIf cfg.nginx.enable (mkSubdomain cfg.nginx.subdomain port)) + (mkIf cfg.nginx.enable (mkVPNSubdomain cfg.nginx.subdomain port))]); + + + + } - - - -