From d5adaf015c9ab2cbf4306ca2f8da559fb12724e5 Mon Sep 17 00:00:00 2001 From: ulic-youthlic Date: Tue, 29 Apr 2025 00:39:36 +0800 Subject: [PATCH] remove conduwuit because it has been archived --- nixos/configurations/Cape/default.nix | 5 -- nixos/modules/programs/conduwuit.nix | 61 ------------------- nixos/modules/programs/default.nix | 1 - nixos/modules/programs/mautrix-telegram.nix | 67 +++++++-------------- 4 files changed, 21 insertions(+), 113 deletions(-) delete mode 100644 nixos/modules/programs/conduwuit.nix diff --git a/nixos/configurations/Cape/default.nix b/nixos/configurations/Cape/default.nix index 6271f80..5e50bc5 100644 --- a/nixos/configurations/Cape/default.nix +++ b/nixos/configurations/Cape/default.nix @@ -25,11 +25,6 @@ }; openssh.enable = true; tailscale.enable = true; - # conduwuit = { - # enable = true; - # serverName = "im.youthlic.fun"; - # }; - mautrix-telegram.enable = true; caddy = { enable = true; baseDomain = "youthlic.fun"; diff --git a/nixos/modules/programs/conduwuit.nix b/nixos/modules/programs/conduwuit.nix deleted file mode 100644 index 4a5f1d2..0000000 --- a/nixos/modules/programs/conduwuit.nix +++ /dev/null @@ -1,61 +0,0 @@ -{ - config, - lib, - ... -}: let - cfg = config.youthlic.programs.conduwuit; -in { - options = { - youthlic.programs.conduwuit = { - enable = lib.mkEnableOption "conduwuit"; - serverName = lib.mkOption { - type = lib.types.nonEmptyStr; - example = "example.com"; - }; - }; - }; - config = lib.mkMerge [ - (lib.mkIf cfg.enable { - sops.secrets."matrix-reg-token" = { - owner = "conduwuit"; - }; - systemd.services.conduwuit.serviceConfig = { - EnvironmentFile = "${config.sops.secrets.matrix-reg-token.path}"; - }; - services.conduwuit = { - enable = true; - settings = { - global = { - port = [8481]; - address = [ - "0.0.0.0" - "::" - ]; - trusted_servers = [ - "matrix.org" - "mozilla.org" - "nichi.co" - ]; - allow_registration = true; - server_name = cfg.serverName; - new_user_displayname_suffix = "⚡"; - allow_public_room_directory_over_federation = true; - well_known = { - client = "https://${cfg.serverName}"; - server = "${cfg.serverName}:443"; - }; - }; - }; - }; - }) - (lib.mkIf (cfg.enable && config.youthlic.programs.caddy.enable) { - services.caddy.virtualHosts = { - "${cfg.serverName}" = { - extraConfig = '' - reverse_proxy 127.0.0.1:8481 - ''; - }; - }; - }) - ]; -} diff --git a/nixos/modules/programs/default.nix b/nixos/modules/programs/default.nix index f9901ad..6e2ddd3 100644 --- a/nixos/modules/programs/default.nix +++ b/nixos/modules/programs/default.nix @@ -19,7 +19,6 @@ ./steam.nix ./tailscale.nix ./transmission.nix - ./conduwuit.nix ./nix-ld.nix ./juicity ./miniflux.nix diff --git a/nixos/modules/programs/mautrix-telegram.nix b/nixos/modules/programs/mautrix-telegram.nix index 5e90e05..175986f 100644 --- a/nixos/modules/programs/mautrix-telegram.nix +++ b/nixos/modules/programs/mautrix-telegram.nix @@ -10,54 +10,29 @@ in { enable = lib.mkEnableOption "mautrix-telegram"; }; }; - config = let - conduwuit-cfg = config.youthlic.programs.conduwuit; - caddy-cfg = config.youthlic.programs.caddy; - in - lib.mkMerge [ - (lib.mkIf cfg.enable { - sops.secrets.matrix-telegram-bot = {}; - services.mautrix-telegram = { - enable = true; - environmentFile = "${config.sops.secrets.matrix-telegram-bot.path}"; - settings = { - bridge = { - permissions = { - "*" = "relaybot"; - }; - }; - appservice = { - address = "http://127.0.0.1:8482"; - hostname = "0.0.0.0"; - port = 8482; - database = "sqlite:////var/lib/mautrix-telegram/database.db"; - bot_username = "matrix_tg_146bot"; - bot_displayname = "matrix tg bridge"; - }; + config = lib.mkIf cfg.enable { + sops.secrets.matrix-telegram-bot = {}; + services.mautrix-telegram = { + enable = true; + environmentFile = "${config.sops.secrets.matrix-telegram-bot.path}"; + settings = { + bridge = { + permissions = { + "*" = "relaybot"; }; }; - nixpkgs.config.permittedInsecurePackages = [ - "olm-3.2.16" - ]; - }) - (lib.mkIf (cfg.enable && conduwuit-cfg.enable) { - services.mautrix-telegram = { - serviceDependencies = [ - "conduwuit.service" - ]; - settings = { - bridge = { - permissions = { - "${conduwuit-cfg.serverName}" = "full"; - "@youthlic:${conduwuit-cfg.serverName}" = "admin"; - }; - }; - homeserver = { - domain = conduwuit-cfg.serverName; - address = "http://127.0.0.1:8481"; - }; - }; + appservice = { + address = "http://127.0.0.1:8482"; + hostname = "0.0.0.0"; + port = 8482; + database = "sqlite:////var/lib/mautrix-telegram/database.db"; + bot_username = "matrix_tg_146bot"; + bot_displayname = "matrix tg bridge"; }; - }) + }; + }; + nixpkgs.config.permittedInsecurePackages = [ + "olm-3.2.16" ]; + }; }