diff --git a/nixos/doc/manual/release-notes/rl-2611.section.md b/nixos/doc/manual/release-notes/rl-2611.section.md index 3697b3bb2e3e..66efc2c22cef 100644 --- a/nixos/doc/manual/release-notes/rl-2611.section.md +++ b/nixos/doc/manual/release-notes/rl-2611.section.md @@ -30,6 +30,8 @@ - `systemd.user.extraConfig` has been removed in favor of the structured [](#opt-systemd.user.settings.Manager) option. Use `systemd.user.settings.Manager` to set any `systemd-user.conf(5)` option directly. For example, replace `systemd.user.extraConfig = "DefaultTimeoutStartSec=60";` with `systemd.user.settings.Manager.DefaultTimeoutStartSec = 60;`. +- `matrix-appservice-discord` was removed from nixpkgs along with its NixOS module (`services.matrix-appservice-discord`) as it is no longer actively maintained upstream. Use the actively-maintained puppeting bridge [`mautrix-discord`](#opt-services.mautrix-discord.enable) instead. + - `services.timesyncd.extraConfig` has been removed in favor of the structured [](#opt-services.timesyncd.settings.Time) option. Use `services.timesyncd.settings.Time` to set any `timesyncd.conf(5)` option directly. For example, replace `services.timesyncd.extraConfig = "PollIntervalMaxSec=180";` with `services.timesyncd.settings.Time.PollIntervalMaxSec = 180;`. - `services.firezone.server.provision` has been removed due to it being unmaintanable. Remove all uses of provisioning and use the WebUI to configure firezone. diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index a96e30cac837..8aefc20ebb1d 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -798,7 +798,6 @@ ./services/mail/sympa.nix ./services/mail/tlsrpt.nix ./services/mail/zeyple.nix - ./services/matrix/appservice-discord.nix ./services/matrix/appservice-irc.nix ./services/matrix/conduit.nix ./services/matrix/continuwuity.nix diff --git a/nixos/modules/rename.nix b/nixos/modules/rename.nix index bacb7275cea0..7d54c7738dcf 100644 --- a/nixos/modules/rename.nix +++ b/nixos/modules/rename.nix @@ -274,6 +274,13 @@ in "services" "marathon" ] "The corresponding package was removed from nixpkgs.") + (mkRemovedOptionModule + [ + "services" + "matrix-appservice-discord" + ] + "The matrix-appservice-discord package has been removed as it is no longer actively maintained upstream. Use `services.mautrix-discord` instead." + ) (mkRemovedOptionModule [ "services" "mathics" ] "The Mathics module has been removed") (mkRemovedOptionModule [ "services" "matrix-sliding-sync" ] "The matrix-sliding-sync package has been removed, since matrix-synapse incorporated its functionality. Remove `services.sliding-sync` from your NixOS Configuration, and the `.well-known` record for `org.matrix.msc3575.proxy` from your webserver" diff --git a/nixos/modules/services/matrix/appservice-discord.nix b/nixos/modules/services/matrix/appservice-discord.nix deleted file mode 100644 index cf3c8ea20eae..000000000000 --- a/nixos/modules/services/matrix/appservice-discord.nix +++ /dev/null @@ -1,163 +0,0 @@ -{ - config, - options, - pkgs, - lib, - ... -}: -let - dataDir = "/var/lib/matrix-appservice-discord"; - registrationFile = "${dataDir}/discord-registration.yaml"; - cfg = config.services.matrix-appservice-discord; - opt = options.services.matrix-appservice-discord; - # TODO: switch to configGen.json once RFC42 is implemented - settingsFile = pkgs.writeText "matrix-appservice-discord-settings.json" ( - builtins.toJSON cfg.settings - ); - -in -{ - options = { - services.matrix-appservice-discord = { - enable = lib.mkEnableOption "a bridge between Matrix and Discord"; - - package = lib.mkPackageOption pkgs "matrix-appservice-discord" { }; - - settings = lib.mkOption rec { - # TODO: switch to lib.types.config.json as prescribed by RFC42 once it's implemented - type = lib.types.attrs; - apply = lib.recursiveUpdate default; - default = { - database = { - filename = "${dataDir}/discord.db"; - }; - - # empty values necessary for registration file generation - # actual values defined in environmentFile - auth = { - clientID = ""; - botToken = ""; - }; - }; - example = lib.literalExpression '' - { - bridge = { - domain = "public-domain.tld"; - homeserverUrl = "http://public-domain.tld:8008"; - }; - } - ''; - description = '' - {file}`config.yaml` configuration as a Nix attribute set. - - Configuration options should match those described in - [config.sample.yaml](https://github.com/Half-Shot/matrix-appservice-discord/blob/master/config/config.sample.yaml). - - {option}`config.bridge.domain` and {option}`config.bridge.homeserverUrl` - should be set to match the public host name of the Matrix homeserver for webhooks and avatars to work. - - Secret tokens should be specified using {option}`environmentFile` - instead of this world-readable attribute set. - ''; - }; - - environmentFile = lib.mkOption { - type = lib.types.nullOr lib.types.path; - default = null; - description = '' - File containing environment variables to be passed to the matrix-appservice-discord service, - in which secret tokens can be specified securely by defining values for - `APPSERVICE_DISCORD_AUTH_CLIENT_I_D` and - `APPSERVICE_DISCORD_AUTH_BOT_TOKEN`. - ''; - }; - - url = lib.mkOption { - type = lib.types.str; - default = "http://localhost:${toString cfg.port}"; - defaultText = lib.literalExpression ''"http://localhost:''${toString config.${opt.port}}"''; - description = '' - The URL where the application service is listening for HS requests. - ''; - }; - - port = lib.mkOption { - type = lib.types.port; - default = 9005; # from https://github.com/Half-Shot/matrix-appservice-discord/blob/master/package.json#L11 - description = '' - Port number on which the bridge should listen for internal communication with the Matrix homeserver. - ''; - }; - - localpart = lib.mkOption { - type = with lib.types; nullOr str; - default = null; - description = '' - The user_id localpart to assign to the AS. - ''; - }; - - serviceDependencies = lib.mkOption { - type = with lib.types; listOf str; - default = lib.optional config.services.matrix-synapse.enable config.services.matrix-synapse.serviceUnit; - defaultText = lib.literalExpression '' - lib.optional config.services.matrix-synapse.enable config.services.matrix-synapse.serviceUnit - ''; - description = '' - List of Systemd services to require and wait for when starting the application service, - such as the Matrix homeserver if it's running on the same host. - ''; - }; - }; - }; - - config = lib.mkIf cfg.enable { - systemd.services.matrix-appservice-discord = { - description = "A bridge between Matrix and Discord."; - - wantedBy = [ "multi-user.target" ]; - wants = [ "network-online.target" ] ++ cfg.serviceDependencies; - after = [ "network-online.target" ] ++ cfg.serviceDependencies; - - preStart = '' - if [ ! -f '${registrationFile}' ]; then - ${cfg.package}/bin/matrix-appservice-discord \ - --generate-registration \ - --url=${lib.escapeShellArg cfg.url} \ - ${ - lib.optionalString (cfg.localpart != null) "--localpart=${lib.escapeShellArg cfg.localpart}" - } \ - --config='${settingsFile}' \ - --file='${registrationFile}' - fi - ''; - - serviceConfig = { - Type = "simple"; - Restart = "always"; - - ProtectSystem = "strict"; - ProtectHome = true; - ProtectKernelTunables = true; - ProtectKernelModules = true; - ProtectControlGroups = true; - - DynamicUser = true; - PrivateTmp = true; - WorkingDirectory = "${cfg.package}/${cfg.package.passthru.nodeAppDir}"; - StateDirectory = baseNameOf dataDir; - UMask = "0027"; - EnvironmentFile = cfg.environmentFile; - - ExecStart = '' - ${cfg.package}/bin/matrix-appservice-discord \ - --file='${registrationFile}' \ - --config='${settingsFile}' \ - --port='${toString cfg.port}' - ''; - }; - }; - }; - - meta.maintainers = with lib.maintainers; [ euxane ]; -} diff --git a/pkgs/by-name/ma/matrix-appservice-discord/package.nix b/pkgs/by-name/ma/matrix-appservice-discord/package.nix deleted file mode 100644 index 7330ecea5b45..000000000000 --- a/pkgs/by-name/ma/matrix-appservice-discord/package.nix +++ /dev/null @@ -1,123 +0,0 @@ -{ - lib, - stdenv, - fetchYarnDeps, - fetchFromGitHub, - - # native - yarn, - yarnConfigHook, - node-gyp, - python3, - srcOnly, - removeReferencesTo, - yarnBuildHook, - makeWrapper, - - # buildInputs - nodejs_20, - matrix-sdk-crypto-nodejs, - napi-rs-cli, -}: - -let - yarn' = yarn.override { - nodejs = nodejs_20; - }; - yarnConfigHook' = yarnConfigHook.override { - nodejs-slim = nodejs_20; - yarn = yarn'; - }; - yarnBuildHook' = yarnBuildHook.override { - nodejs-slim = nodejs_20; - yarn = yarn'; - }; - matrix-sdk-crypto-nodejs' = matrix-sdk-crypto-nodejs.override { - nodejs = nodejs_20; - napi-rs-cli = napi-rs-cli.override { - nodejs = nodejs_20; - }; - }; - nodeSources = srcOnly nodejs_20; -in -stdenv.mkDerivation (finalAttrs: { - pname = "matrix-appservice-discord"; - version = "4.0.0"; - - src = fetchFromGitHub { - owner = "matrix-org"; - repo = "matrix-appservice-discord"; - tag = "v${finalAttrs.version}"; - hash = "sha256-UyRMMbnX4aJVv8oQfgn/rkZT1cRATtcgFj4fXszDKqo="; - }; - - yarnOfflineCache = fetchYarnDeps { - yarnLock = "${finalAttrs.src}/yarn.lock"; - hash = "sha256-s8ictJX65mSU2oxaIuCswfb2flo2RN9a1JZevacN/Ic="; - }; - - nativeBuildInputs = [ - yarnConfigHook' - yarnBuildHook' - nodejs_20 - node-gyp - python3 - removeReferencesTo - makeWrapper - ]; - - preBuild = '' - cp -r ${matrix-sdk-crypto-nodejs'}/lib/node_modules/@matrix-org ./node_modules - cd ./node_modules/better-sqlite3 - npm run build-release --offline --nodedir="${nodeSources}" - find build -type f -exec remove-references-to -t "${nodeSources}" {} \; - cd ../../ - ''; - - # npmHooks.npmInstallHook and yarnInstallHook don't work for this package - # because: - # - # - There is no `bin` key in - # package.json, which instructs it to create a binary file for the package. - # - The build/ directory, containing the compiled `.js` files from some - # doesn't get picked up by `yarn pack`. - installPhase = '' - runHook preInstall - - mkdir -p $out/lib/node_modules - - mv build $out/lib/node_modules/matrix-appservice-discord - cp -r node_modules $out/lib/node_modules/matrix-appservice-discord - makeWrapper '${nodejs_20}/bin/node' "$out/bin/matrix-appservice-discord" \ - --add-flags "$out/lib/node_modules/matrix-appservice-discord/src/discordas.js" - - # admin tools wrappers - for toolPath in $out/lib/node_modules/matrix-appservice-discord/tools/*; do - makeWrapper '${nodejs_20}/bin/node' \ - "$out/bin/matrix-appservice-discord-$(basename $toolPath .js)" \ - --add-flags "$toolPath" - done - - runHook postInstall - ''; - - doCheck = true; - - checkPhase = '' - runHook preCheck - - # the default 2000ms timeout is sometimes too short on our busy builders - yarn --offline test --timeout 10000 - - runHook postCheck - ''; - - meta = { - description = "Bridge between Matrix and Discord"; - homepage = "https://github.com/matrix-org/matrix-appservice-discord"; - license = lib.licenses.asl20; - maintainers = with lib.maintainers; [ euxane ]; - platforms = lib.platforms.linux; - mainProgram = "matrix-appservice-discord"; - }; -}) diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index 8017987d67c3..0c4917e65443 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -1433,6 +1433,7 @@ mapAliases { material-kwin-decoration = throw "'material-kwin-decoration' has been removed, as it is only compatible with Plasma 5, which is EOL"; # Added 2025-08-20 mathlibtools = throw "mathlibtools has been removed as it was archived upstream in 2023"; # Added 2025-07-09 matomo_5 = throw "'matomo_5' has been renamed to/replaced by 'matomo'"; # Converted to throw 2025-10-27 + matrix-appservice-discord = throw "'matrix-appservice-discord' has been removed as it is no longer actively maintained upstream. Use the actively-maintained puppeting bridge 'mautrix-discord' instead"; # Added 2026-06-08 matrix-appservice-slack = throw "'matrix-appservice-slack' has been removed, as it relies on Classic Slack Apps, which no longer exist, and is abandoned upstream"; # Added 2025-11-11 matrix-synapse-tools.rust-synapse-compress-state = throw "'matrix-synapse-tools.rust-synapse-compress-state' has been renamed to/replaced by 'rust-synapse-compress-state'"; # Converted to throw 2025-10-27 matrix-synapse-tools.synadm = throw "'matrix-synapse-tools.synadm' has been renamed to/replaced by 'synadm'"; # Converted to throw 2025-10-27