mx-puppet-discord: remove (#428183)

This commit is contained in:
jade
2025-07-24 19:48:16 -07:00
committed by GitHub
11 changed files with 8 additions and 4119 deletions
+2
View File
@@ -25,6 +25,8 @@
- `victoriametrics` no longer contains VictoriaLogs components. These have been separated into the new package `victorialogs`.
- `mx-puppet-discord` was removed from nixpkgs along with its NixOS module as it was unmaintained and was the only user of sha1 hashes in tree.
- `gnome-keyring` no longer ships with an SSH agent anymore because it has been deprecated upstream. You should use `gcr_4` instead, which provides the same features. More information on why this was done can be found on [the relevant GCR upstream PR](https://gitlab.gnome.org/GNOME/gcr/-/merge_requests/67).
- `stdenv.mkDerivation` and other derivation builders that use it no longer allow the value of `env` to be anything but an attribute set, for the purpose of setting environment variables that are available to the [builder](https://nix.dev/manual/nix/latest/store/derivation/#builder) process. An environment variable called `env` can still be provided by means of `mkDerivation { env.env = ...; }`, though we recommend to use a more specific name than "env".
@@ -108,7 +108,7 @@ In addition to numerous new and upgraded packages, this release has the followin
- [influxdb-exporter](https://github.com/prometheus/influxdb_exporter) a Prometheus exporter that exports metrics received on an InfluxDB compatible endpoint is now available as [services.prometheus.exporters.influxdb](#opt-services.prometheus.exporters.influxdb.enable).
- [mx-puppet-discord](https://github.com/matrix-discord/mx-puppet-discord), a discord puppeting bridge for matrix. Available as [services.mx-puppet-discord](#opt-services.mx-puppet-discord.enable).
- [mx-puppet-discord](https://github.com/matrix-discord/mx-puppet-discord), a discord puppeting bridge for matrix. Available as `services.mx-puppet-discord`.
- [MeshCentral](https://www.meshcommander.com/meshcentral2/overview), a remote administration service ("TeamViewer but self-hosted and with more features") is now available with a package and a module: [services.meshcentral.enable](#opt-services.meshcentral.enable)
-1
View File
@@ -779,7 +779,6 @@
./services/matrix/mautrix-telegram.nix
./services/matrix/mautrix-whatsapp.nix
./services/matrix/mjolnir.nix
./services/matrix/mx-puppet-discord.nix
./services/matrix/pantalaimon.nix
./services/matrix/synapse-auto-compressor.nix
./services/matrix/synapse.nix
+4
View File
@@ -190,6 +190,10 @@ in
(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"
)
(mkRemovedOptionModule [
"services"
"mx-puppet-discord"
] "The corresponding package was removed from nixpkgs.")
(mkRemovedOptionModule [ "services" "meguca" ] "Use meguca has been removed from nixpkgs")
(mkRemovedOptionModule [ "services" "mesos" ] "The corresponding package was removed from nixpkgs.")
(mkRemovedOptionModule [
@@ -1,125 +0,0 @@
{
config,
pkgs,
lib,
...
}:
let
dataDir = "/var/lib/mx-puppet-discord";
registrationFile = "${dataDir}/discord-registration.yaml";
cfg = config.services.mx-puppet-discord;
settingsFormat = pkgs.formats.json { };
settingsFile = settingsFormat.generate "mx-puppet-discord-config.json" cfg.settings;
in
{
options = {
services.mx-puppet-discord = {
enable = lib.mkEnableOption ''
mx-puppet-discord is a discord puppeting bridge for matrix.
It handles bridging private and group DMs, as well as Guilds (servers)
'';
settings = lib.mkOption rec {
apply = lib.recursiveUpdate default;
inherit (settingsFormat) type;
default = {
bridge.port = 8434;
presence = {
enabled = true;
interval = 500;
};
provisioning.whitelist = [ ];
relay.whitelist = [ ];
# variables are preceded by a colon.
namePatterns = {
user = ":name";
userOverride = ":displayname";
room = ":name";
group = ":name";
};
#defaults to sqlite but can be configured to use postgresql with
#connstring
database.filename = "${dataDir}/database.db";
logging = {
console = "info";
lineDateFormat = "MMM-D HH:mm:ss.SSS";
};
};
example = lib.literalExpression ''
{
bridge = {
bindAddress = "localhost";
domain = "example.com";
homeserverUrl = "https://example.com";
};
provisioning.whitelist = [ "@admin:example.com" ];
relay.whitelist = [ "@.*:example.com" ];
}
'';
description = ''
{file}`config.yaml` configuration as a Nix attribute set.
Configuration options should match those described in
[
sample.config.yaml](https://github.com/matrix-discord/mx-puppet-discord/blob/master/sample.config.yaml).
'';
};
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.
'';
};
};
};
config = lib.mkIf cfg.enable {
systemd.services.mx-puppet-discord = {
description = "Matrix to Discord puppeting bridge";
wantedBy = [ "multi-user.target" ];
wants = [ "network-online.target" ] ++ cfg.serviceDependencies;
after = [ "network-online.target" ] ++ cfg.serviceDependencies;
preStart = ''
# generate the appservice's registration file if absent
if [ ! -f '${registrationFile}' ]; then
${pkgs.mx-puppet-discord}/bin/mx-puppet-discord -r -c ${settingsFile} \
-f ${registrationFile}
fi
'';
serviceConfig = {
Type = "simple";
Restart = "always";
ProtectSystem = "strict";
ProtectHome = true;
ProtectKernelTunables = true;
ProtectKernelModules = true;
ProtectControlGroups = true;
DynamicUser = true;
PrivateTmp = true;
WorkingDirectory = pkgs.mx-puppet-discord;
StateDirectory = baseNameOf dataDir;
UMask = "0027";
ExecStart = ''
${pkgs.mx-puppet-discord}/bin/mx-puppet-discord \
-c ${settingsFile} \
-f ${registrationFile}
'';
};
};
};
meta.maintainers = with lib.maintainers; [ govanify ];
}
@@ -1,79 +0,0 @@
{
stdenv,
fetchFromGitLab,
pkgs,
lib,
node-pre-gyp,
nodejs_20,
pkg-config,
libjpeg,
pixman,
cairo,
pango,
which,
libpq,
}:
let
nodejs = nodejs_20;
version = "0.1.1";
src = fetchFromGitLab {
group = "mx-puppet";
owner = "discord";
repo = "mx-puppet-discord";
rev = "v${version}";
hash = "sha256-ZhyjUt6Bz/0R4+Lq/IoY9rNjdwVE2qp4ZQLc684+T/0=";
};
myNodePackages = import ./node-composition.nix {
inherit pkgs nodejs;
inherit (stdenv.hostPlatform) system;
};
in
myNodePackages.package.override {
inherit version src;
nativeBuildInputs = [
node-pre-gyp
nodejs.pkgs.node-gyp-build
pkg-config
which
];
buildInputs = [
libjpeg
pixman
cairo
pango
libpq
];
postRebuild = ''
# Build typescript stuff
npm run build
'';
postInstall = ''
# Make an executable to run the server
mkdir -p $out/bin
cat <<EOF > $out/bin/mx-puppet-discord
#!/bin/sh
exec ${nodejs}/bin/node $out/lib/node_modules/@mx-puppet/discord/build/index.js "\$@"
EOF
chmod +x $out/bin/mx-puppet-discord
'';
meta = with lib; {
description = "Discord puppeting bridge for matrix";
license = licenses.asl20;
homepage = "https://gitlab.com/mx-puppet/discord/mx-puppet-discord";
maintainers = [ ];
platforms = platforms.unix;
# never built on aarch64-darwin since first introduction in nixpkgs
# Depends on nodejs_18 that has been removed.
broken = true;
mainProgram = "mx-puppet-discord";
};
}
@@ -1,24 +0,0 @@
#!/usr/bin/env nix-shell
#! nix-shell -i bash -p nodePackages.node2nix
tag="v0.1.1"
u="https://gitlab.com/mx-puppet/discord/mx-puppet-discord/-/raw/$tag"
# Download package.json and patch in @discordjs/opus optional dependency
curl $u/package.json |
sed 's|"typescript": *"\^\?3\.[^"]*"|"typescript": "^4.8.3"|' | # TODO: remove when newer typescript version pinned
sed 's|\("dependencies": *{\)|\1\n"@discordjs/opus": "^0.8.0",|' >package.json
node2nix \
--nodejs-14 \
--node-env ../../development/node-packages/node-env.nix \
--input package.json \
--strip-optional-dependencies \
--output node-packages.nix \
--composition node-composition.nix \
--registry https://registry.npmjs.org \
--registry https://gitlab.com/api/v4/packages/npm \
--registry-scope '@mx-puppet'
sed -i 's|<nixpkgs>|../../..|' node-composition.nix
rm -f package.json
@@ -1,33 +0,0 @@
# This file has been generated by node2nix 1.11.1. Do not edit!
{
pkgs ? import ../../.. {
inherit system;
},
system ? builtins.currentSystem,
nodejs ? pkgs."nodejs_20",
}:
let
nodeEnv = import ../../development/node-packages/node-env.nix {
inherit (pkgs)
stdenv
lib
runCommand
writeTextFile
writeShellScript
;
inherit pkgs nodejs;
libtool = if pkgs.stdenv.hostPlatform.isDarwin then pkgs.cctools or pkgs.darwin.cctools else null;
};
in
import ./node-packages.nix {
inherit (pkgs)
fetchurl
nix-gitignore
stdenv
lib
fetchgit
;
inherit nodeEnv;
}
File diff suppressed because it is too large Load Diff
+1
View File
@@ -1336,6 +1336,7 @@ mapAliases {
mustache-tcl = tclPackages.mustache-tcl; # Added 2024-10-02
mutt-with-sidebar = mutt; # Added 2022-09-17
mutter43 = throw "'mutter43' has been removed since it is no longer used by Pantheon."; # Added 2024-09-22
mx-puppet-discord = throw "mx-puppet-discord was removed since the packaging was unmaintained and was the sole user of sha1 hashes in nixpkgs"; # Added 2025-07-24
mysql-client = hiPrio mariadb.client;
mysql = throw "'mysql' has been renamed to/replaced by 'mariadb'"; # Converted to throw 2024-10-17
mesa_drivers = throw "'mesa_drivers' has been removed, use 'pkgs.mesa' instead."; # Converted to throw 2024-07-11
-2
View File
@@ -3527,8 +3527,6 @@ with pkgs;
mhonarc = perlPackages.MHonArc;
mx-puppet-discord = callPackage ../servers/mx-puppet-discord { };
nanoemoji = with python3Packages; toPythonApplication nanoemoji;
netdata = callPackage ../tools/system/netdata {