Compare commits

..

72 Commits

Author SHA1 Message Date
nixpkgs-ci[bot]
6d35000a08 Merge master into staging-next 2026-06-06 12:28:36 +00:00
nixpkgs-ci[bot]
0f73cea4df Merge master into staging-next 2026-06-06 07:06:01 +00:00
nixpkgs-ci[bot]
6d51453039 Merge master into staging-next 2026-06-06 00:44:28 +00:00
nixpkgs-ci[bot]
7bbb1e332a Merge master into staging-next 2026-06-05 18:40:33 +00:00
nixpkgs-ci[bot]
eb0a874834 Merge master into staging-next 2026-06-05 13:01:44 +00:00
nixpkgs-ci[bot]
280c4a0775 Merge master into staging-next 2026-06-05 07:31:02 +00:00
nixpkgs-ci[bot]
4468c00e13 Merge master into staging-next 2026-06-05 00:47:08 +00:00
nixpkgs-ci[bot]
6cda118c6e Merge master into staging-next 2026-06-04 18:47:29 +00:00
nixpkgs-ci[bot]
93cae095e9 Merge master into staging-next 2026-06-04 13:05:37 +00:00
nixpkgs-ci[bot]
ec0e30fa80 Merge master into staging-next 2026-06-04 07:39:24 +00:00
nixpkgs-ci[bot]
52304a62fb Merge master into staging-next 2026-06-04 00:54:15 +00:00
nixpkgs-ci[bot]
b6d09bb17b Merge master into staging-next 2026-06-03 19:20:24 +00:00
nixpkgs-ci[bot]
c0196ec0bc Merge master into staging-next 2026-06-03 13:38:20 +00:00
nixpkgs-ci[bot]
553d49d24d Merge master into staging-next 2026-06-03 07:43:29 +00:00
nixpkgs-ci[bot]
d315f7200a Merge master into staging-next 2026-06-03 00:54:39 +00:00
nixpkgs-ci[bot]
ca7ef11f5a Merge master into staging-next 2026-06-02 19:15:16 +00:00
nixpkgs-ci[bot]
ea57eb6862 Merge master into staging-next 2026-06-02 13:17:29 +00:00
nixpkgs-ci[bot]
fda3589e7a Merge master into staging-next 2026-06-02 07:39:55 +00:00
nixpkgs-ci[bot]
30386af727 Merge master into staging-next 2026-06-02 00:49:13 +00:00
nixpkgs-ci[bot]
81bb92ae56 Merge master into staging-next 2026-06-01 19:38:47 +00:00
nixpkgs-ci[bot]
677ebcbd10 Merge master into staging-next 2026-06-01 14:02:03 +00:00
nixpkgs-ci[bot]
bf115abdde Merge master into staging-next 2026-06-01 07:47:52 +00:00
nixpkgs-ci[bot]
0bd4c0f8ba Merge master into staging-next 2026-06-01 00:48:07 +00:00
nixpkgs-ci[bot]
0074e9d3c1 Merge master into staging-next 2026-05-31 18:25:34 +00:00
nixpkgs-ci[bot]
9dd17abec2 Merge master into staging-next 2026-05-31 12:29:59 +00:00
nixpkgs-ci[bot]
f6aa5f4c2e Merge master into staging-next 2026-05-31 07:20:08 +00:00
nixpkgs-ci[bot]
c43697e6cb Merge master into staging-next 2026-05-31 00:46:03 +00:00
nixpkgs-ci[bot]
50b7fc6f66 Merge master into staging-next 2026-05-30 18:24:22 +00:00
nixpkgs-ci[bot]
fd36a9baad Merge master into staging-next 2026-05-30 12:26:43 +00:00
nixpkgs-ci[bot]
63708d64b7 Merge master into staging-next 2026-05-30 07:02:05 +00:00
nixpkgs-ci[bot]
1993df86ee Merge master into staging-next 2026-05-30 00:42:13 +00:00
nixpkgs-ci[bot]
6e701ed561 Merge master into staging-next 2026-05-29 18:52:41 +00:00
nixpkgs-ci[bot]
6f50cf3efa Merge master into staging-next 2026-05-29 13:06:17 +00:00
nixpkgs-ci[bot]
cfd6c76775 Merge master into staging-next 2026-05-29 07:21:39 +00:00
nixpkgs-ci[bot]
9e3b121780 Merge master into staging-next 2026-05-29 00:46:34 +00:00
nixpkgs-ci[bot]
ec819f00ba Merge master into staging-next 2026-05-28 18:53:32 +00:00
nixpkgs-ci[bot]
c8ec502c8c Merge master into staging-next 2026-05-28 13:14:56 +00:00
nixpkgs-ci[bot]
7bbe929cc6 Merge master into staging-next 2026-05-28 07:21:35 +00:00
nixpkgs-ci[bot]
577b46653a Merge master into staging-next 2026-05-28 00:40:04 +00:00
nixpkgs-ci[bot]
400425f0d3 Merge master into staging-next 2026-05-27 18:47:56 +00:00
nixpkgs-ci[bot]
a90757c3af Merge master into staging-next 2026-05-27 13:10:42 +00:00
nixpkgs-ci[bot]
073fe89510 Merge master into staging-next 2026-05-27 07:28:15 +00:00
nixpkgs-ci[bot]
2f5aab8072 Merge master into staging-next 2026-05-27 00:44:08 +00:00
nixpkgs-ci[bot]
adeae1c6ff Merge master into staging-next 2026-05-26 18:48:48 +00:00
nixpkgs-ci[bot]
dd67d4aa01 Merge master into staging-next 2026-05-26 13:00:17 +00:00
nixpkgs-ci[bot]
62af8f1f8e Merge master into staging-next 2026-05-26 07:14:10 +00:00
nixpkgs-ci[bot]
f7a6250311 Merge master into staging-next 2026-05-26 01:29:25 +00:00
nixpkgs-ci[bot]
caf3bd82f0 Merge master into staging-next 2026-05-26 00:42:26 +00:00
nixpkgs-ci[bot]
93dff12487 Merge master into staging-next 2026-05-25 18:34:37 +00:00
nixpkgs-ci[bot]
0079cdc240 Merge master into staging-next 2026-05-25 13:09:46 +00:00
nixpkgs-ci[bot]
a5fb403769 Merge master into staging-next 2026-05-25 07:35:54 +00:00
nixpkgs-ci[bot]
e5a050cf5f Merge master into staging-next 2026-05-25 00:43:59 +00:00
nixpkgs-ci[bot]
e65398379c Merge master into staging-next 2026-05-24 19:10:20 +00:00
nixpkgs-ci[bot]
c0067ed7f1 Merge master into staging-next 2026-05-24 18:23:10 +00:00
nixpkgs-ci[bot]
9846aa1e24 Merge master into staging-next 2026-05-24 12:24:45 +00:00
nixpkgs-ci[bot]
bc17bf4707 Merge master into staging-next 2026-05-24 07:07:55 +00:00
nixpkgs-ci[bot]
ca62933c89 Merge master into staging-next 2026-05-24 00:42:54 +00:00
nixpkgs-ci[bot]
be978ce805 Merge master into staging-next 2026-05-23 18:22:16 +00:00
nixpkgs-ci[bot]
e4c77a1938 Merge master into staging-next 2026-05-23 12:22:11 +00:00
nixpkgs-ci[bot]
b571e1e110 Merge master into staging-next 2026-05-23 06:56:36 +00:00
nixpkgs-ci[bot]
b1310343e6 Merge master into staging-next 2026-05-23 00:41:43 +00:00
nixpkgs-ci[bot]
578b082cb4 Merge master into staging-next 2026-05-22 18:37:22 +00:00
nixpkgs-ci[bot]
07905f823e Merge master into staging-next 2026-05-22 12:50:33 +00:00
nixpkgs-ci[bot]
8e470ec7e1 Merge master into staging-next 2026-05-22 07:14:31 +00:00
nixpkgs-ci[bot]
fe58890ad0 Merge master into staging-next 2026-05-22 00:42:44 +00:00
nixpkgs-ci[bot]
6404ef005b Merge master into staging-next 2026-05-21 18:39:20 +00:00
nixpkgs-ci[bot]
5423b34576 Merge master into staging-next 2026-05-21 13:08:24 +00:00
nixpkgs-ci[bot]
e79630333e Merge master into staging-next 2026-05-21 07:18:55 +00:00
nixpkgs-ci[bot]
18524bc0e1 Merge master into staging-next 2026-05-21 00:44:27 +00:00
nixpkgs-ci[bot]
bedc0b9a8e Merge master into staging-next 2026-05-20 18:48:48 +00:00
nixpkgs-ci[bot]
9ff1583136 Merge master into staging-next 2026-05-20 12:53:08 +00:00
Vladimír Čunát
74aedbf137 Merge master into staging-next 2026-05-20 14:01:41 +02:00
18 changed files with 15476 additions and 21444 deletions

View File

@@ -65,42 +65,6 @@
"module-services-keycloak-unix-socket": [
"index.html#module-services-keycloak-unix-socket"
],
"module-services-mautrix-discord": [
"index.html#module-services-mautrix-discord"
],
"module-services-mautrix-discord-advanced": [
"index.html#module-services-mautrix-discord-advanced"
],
"module-services-mautrix-discord-authentication": [
"index.html#module-services-mautrix-discord-authentication"
],
"module-services-mautrix-discord-backfill": [
"index.html#module-services-mautrix-discord-backfill"
],
"module-services-mautrix-discord-basic-example": [
"index.html#module-services-mautrix-discord-basic-example"
],
"module-services-mautrix-discord-basic-usage": [
"index.html#module-services-mautrix-discord-basic-usage"
],
"module-services-mautrix-discord-double-puppet": [
"index.html#module-services-mautrix-discord-double-puppet"
],
"module-services-mautrix-discord-encryption": [
"index.html#module-services-mautrix-discord-encryption"
],
"module-services-mautrix-discord-server-defaults": [
"index.html#module-services-mautrix-discord-server-defaults"
],
"module-services-mautrix-discord-setup": [
"index.html#module-services-mautrix-discord-setup"
],
"module-services-mautrix-discord-synapse": [
"index.html#module-services-mautrix-discord-synapse"
],
"module-services-mautrix-discord-troubleshooting": [
"index.html#module-services-mautrix-discord-troubleshooting"
],
"module-services-tandoor-recipes-migrating-media-option-move": [
"index.html#module-services-tandoor-recipes-migrating-media-option-move",
"index.html#module-services-tandoor-recipes-migrating-media-option-1"

View File

@@ -1,156 +0,0 @@
# Mautrix-Discord {#module-services-mautrix-discord}
*Source:* {file}`modules/services/matrix/mautrix-discord`
*Upstream documentation:* <https://docs.mau.fi/bridges/go/discord/index.html>
[Mautrix-Discord](https://github.com/mautrix/discord) is a Matrix-Discord bridge.
## Basic Usage {#module-services-mautrix-discord-basic-usage}
The common setup is to enable the bridge, point it at your homeserver, and set the permissions you want to allow:
1. Set `services.mautrix-discord.enable` to `true`.
2. Set `services.mautrix-discord.settings.homeserver.address` and `services.mautrix-discord.settings.homeserver.domain`.
3. Override `services.mautrix-discord.settings.bridge.permissions` if the default relay permissions do not fit your deployment.
The module provides sensible defaults for the appservice listener, registration tokens, and relay permissions.
### Basic Example {#module-services-mautrix-discord-basic-example}
```nix
{
services.mautrix-discord = {
enable = true;
registerToSynapse = true;
settings = {
homeserver = {
address = "http://localhost:8008";
domain = "example.com";
};
bridge.permissions = {
"example.com" = "user";
"@admin:example.com" = "admin";
};
};
};
}
```
### Server Defaults {#module-services-mautrix-discord-server-defaults}
By default, the bridge listens on `http://localhost:29334` and generates its appservice tokens automatically.
## Authentication {#module-services-mautrix-discord-authentication}
If you want to store the bridge database outside the default SQLite file, set `settings.appservice.database` to use PostgreSQL instead of SQLite:
```nix
{
services.mautrix-discord.settings.appservice.database = {
type = "postgres";
uri = "postgresql:///mautrix-discord?host=/run/postgresql";
};
}
```
If the connection needs a password, combine it with `services.mautrix-discord.environmentFile`:
```nix
{
services.mautrix-discord = {
environmentFile = "/run/secrets/mautrix-discord-env";
settings.appservice.database.uri = "postgresql://mautrix:$DB_PASSWORD@localhost/mautrix-discord";
};
}
```
Use `services.mautrix-discord.environmentFile` for any secret you do not want in the Nix store.
This includes database passwords, shared secrets, and similar values.
Example:
```nix
{
services.mautrix-discord = {
environmentFile = "/run/secrets/mautrix-discord-env";
settings.bridge.login_shared_secret_map = {
"example.com" = "$SHARED_SECRET";
};
};
}
```
## Bridge Setup {#module-services-mautrix-discord-setup}
After the service starts, open a chat with `@discordbot:example.com`, send `login`, and follow the instructions to link your Discord account.
For more detail, see the [Mautrix-Discord documentation](https://docs.mau.fi/bridges/go/discord/index.html).
## Advanced Configuration {#module-services-mautrix-discord-advanced}
The upstream default configuration is available at [example-config.yaml](https://github.com/mautrix/discord/blob/main/example-config.yaml). To print the generated default configuration from the package, run:
```bash
nix-shell -p mautrix-discord --run "mautrix-discord -e"
```
### Encryption {#module-services-mautrix-discord-encryption}
```nix
{
services.mautrix-discord.settings.bridge.encryption = {
allow = true;
default = true;
require = false;
};
}
```
Encryption needs additional bridge-side setup. See the [bridge encryption documentation](https://docs.mau.fi/bridges/general/end-to-bridge-encryption.html) for details.
### Backfill {#module-services-mautrix-discord-backfill}
```nix
{
services.mautrix-discord.settings.bridge.backfill.forward_limits.initial = {
dm = 50;
channel = 50;
thread = 50;
};
}
```
### Double Puppeting {#module-services-mautrix-discord-double-puppet}
```nix
{
services.mautrix-discord = {
environmentFile = "/run/secrets/mautrix-discord-env";
settings.bridge.login_shared_secret_map = {
"example.com" = "$SHARED_SECRET";
};
};
}
```
where `/run/secrets/mautrix-discord-env` contains
```
SHARED_SECRET=aProtectedSecret
```
## Synapse Integration {#module-services-mautrix-discord-synapse}
When `services.mautrix-discord.registerToSynapse` is `true`, the bridge writes its registration file automatically and Synapse picks it up.
If Synapse is enabled, this option defaults to `true`.
## Troubleshooting {#module-services-mautrix-discord-troubleshooting}
- View logs with `journalctl -u mautrix-discord.service -f`.
- Check `systemctl status mautrix-discord` if the bridge does not start.
- Verify the homeserver can reach the configured appservice address.
- Ensure the registration file exists and Synapse can read it.
For more help, see the
[Mautrix-Discord documentation](https://docs.mau.fi/bridges/go/discord/index.html)
or the support room at [#discord:maunium.net](https://matrix.to/#/#discord:maunium.net).

View File

@@ -5,59 +5,15 @@
...
}:
let
defaultDataDir = "/var/lib/mautrix-discord";
cfg = config.services.mautrix-discord;
dataDir = cfg.dataDir;
format = pkgs.formats.yaml { };
serviceDependencies = [
"mautrix-discord-registration.service"
]
++ (lib.lists.optional config.services.matrix-synapse.enable config.services.matrix-synapse.serviceUnit)
++ (lib.lists.optional config.services.matrix-conduit.enable "matrix-conduit.service")
++ (lib.lists.optional config.services.dendrite.enable "dendrite.service");
registrationFile = "${dataDir}/discord-registration.yaml";
settingsFile = "${dataDir}/config.yaml";
settingsFileUnformatted = format.generate "discord-config-unsubstituted.yaml" cfg.settings;
default_token = "This value is generated when generating the registration";
settingsDefault = {
homeserver = {
address = "";
domain = "";
};
appservice = {
address = "http://localhost:29334";
hostname = "0.0.0.0";
port = 29334;
database = {
type = "sqlite3";
uri = "file:${defaultDataDir}/mautrix-discord.db?_txlock=immediate";
};
id = "discord";
bot = {
username = "discordbot";
displayname = "Discord bridge bot";
avatar = "mxc://maunium.net/nIdEykemnwdisvHbpxflpDlC";
};
as_token = default_token;
hs_token = default_token;
};
bridge.permissions."*" = "relay";
logging = {
min_level = "info";
writers = [
{
type = "stdout";
format = "pretty-colored";
time_format = " ";
}
];
};
};
in
{
options = {
@@ -67,14 +23,238 @@ in
package = lib.mkPackageOption pkgs "mautrix-discord" { };
settings = lib.mkOption {
apply = lib.recursiveUpdate settingsDefault;
type = format.type;
default = settingsDefault;
type = lib.types.submodule {
freeformType = format.type;
config = {
_module.args = { inherit cfg lib; };
};
options = {
homeserver = lib.mkOption {
type = lib.types.attrs;
default = {
software = "standard";
status_endpoint = null;
message_send_checkpoint_endpoint = null;
async_media = false;
websocket = false;
ping_interval_seconds = 0;
};
description = ''
fullDataDiration.
See [example-config.yaml](https://github.com/mautrix/discord/blob/main/example-config.yaml)
for more information.
'';
};
appservice = lib.mkOption {
type = lib.types.attrs;
default = {
address = "http://localhost:29334";
hostname = "0.0.0.0";
port = 29334;
database = {
type = "sqlite3";
uri = "file:/var/lib/mautrix-discord/mautrix-discord.db?_txlock=immediate";
max_open_conns = 20;
max_idle_conns = 2;
max_conn_idle_time = null;
max_conn_lifetime = null;
};
id = "discord";
bot = {
username = "discordbot";
displayname = "Discord bridge bot";
avatar = "mxc://maunium.net/nIdEykemnwdisvHbpxflpDlC";
};
ephemeral_events = true;
async_transactions = false;
as_token = "This value is generated when generating the registration";
hs_token = "This value is generated when generating the registration";
};
defaultText = lib.literalExpression ''
{
address = "http://localhost:29334";
hostname = "0.0.0.0";
port = 29334;
database = {
type = "sqlite3";
uri = "file:''${config.services.mautrix-discord.dataDir}/mautrix-discord.db?_txlock=immediate";
max_open_conns = 20;
max_idle_conns = 2;
max_conn_idle_time = null;
max_conn_lifetime = null;
};
id = "discord";
bot = {
username = "discordbot";
displayname = "Discord bridge bot";
avatar = "mxc://maunium.net/nIdEykemnwdisvHbpxflpDlC";
};
ephemeral_events = true;
async_transactions = false;
as_token = "This value is generated when generating the registration";
hs_token = "This value is generated when generating the registration";
}
'';
description = ''
Appservice configuration.
See [example-config.yaml](https://github.com/mautrix/discord/blob/main/example-config.yaml)
for more information.
'';
};
bridge = lib.mkOption {
type = lib.types.attrs;
default = {
username_template = "discord_{{.}}";
displayname_template = "{{if .Webhook}}Webhook{{else}}{{or .GlobalName .Username}}{{if .Bot}} (bot){{end}}{{end}}";
channel_name_template = "{{if or (eq .Type 3) (eq .Type 4)}}{{.Name}}{{else}}#{{.Name}}{{end}}";
guild_name_template = "{{.Name}}";
private_chat_portal_meta = "default";
public_address = null;
avatar_proxy_key = "generate";
portal_message_buffer = 128;
startup_private_channel_create_limit = 5;
delivery_receipts = false;
message_status_events = false;
message_error_notices = true;
restricted_rooms = true;
autojoin_thread_on_open = true;
embed_fields_as_tables = true;
mute_channels_on_create = false;
sync_direct_chat_list = false;
resend_bridge_info = false;
custom_emoji_reactions = true;
delete_portal_on_channel_delete = false;
delete_guild_on_leave = true;
federate_rooms = true;
prefix_webhook_messages = true;
enable_webhook_avatars = false;
use_discord_cdn_upload = true;
#proxy =
cache_media = "unencrypted";
direct_media = {
enabled = false;
#server_name = "discord-media.example.com";
#well_known_response =
allow_proxy = true;
server_key = "generate";
};
animated_sticker = {
target = "webp";
args = {
width = 320;
height = 320;
fps = 25;
};
};
double_puppet_server_map = {
#"example.com" = "https://example.com";
};
double_puppet_allow_discovery = false;
login_shared_secret_map = {
#"example.com" = "foobar";
};
command_prefix = "!discord";
management_room_text = {
welcome = "Hello, I'm a Discord bridge bot.";
welcome_connected = "Use `help` for help.";
welcome_unconnected = "Use `help` for help or `login` to log in.";
additional_help = "";
};
backfill = {
forward_limits = {
initial = {
dm = 0;
channel = 0;
thread = 0;
};
missed = {
dm = 0;
channel = 0;
thread = 0;
};
max_guild_members = -1;
};
};
encryption = {
allow = false;
default = false;
appservice = false;
msc4190 = false;
require = false;
allow_key_sharing = false;
plaintext_mentions = false;
delete_keys = {
delete_outbound_on_ack = false;
dont_store_outbound = false;
ratchet_on_decrypt = false;
delete_fully_used_on_decrypt = false;
delete_prev_on_new_session = false;
delete_on_device_delete = false;
periodically_delete_expired = false;
delete_outdated_inbound = false;
};
verification_levels = {
receive = "unverified";
send = "unverified";
share = "cross-signed-tofu";
};
rotation = {
enable_custom = false;
milliseconds = 604800000;
messages = 100;
disable_device_change_key_rotation = false;
};
};
provisioning = {
prefix = "/_matrix/provision";
shared_secret = "generate";
debug_endpoints = false;
};
permissions = {
"*" = "relay";
#"example.com" = "user";
#"@admin:example.com": "admin";
};
};
description = ''
Bridge configuration.
See [example-config.yaml](https://github.com/mautrix/discord/blob/main/example-config.yaml)
for more information.
'';
};
logging = lib.mkOption {
type = lib.types.attrs;
default = {
min_level = "info";
writers = lib.singleton {
type = "stdout";
format = "pretty-colored";
time_format = " ";
};
};
description = ''
Logging configuration.
See [example-config.yaml](https://github.com/mautrix/discord/blob/main/example-config.yaml)
for more information.
'';
};
};
};
default = { };
example = lib.literalExpression ''
{
homeserver = {
address = "http://localhost:8008";
domain = "example.com";
domain = "public-domain.tld";
};
appservice.public = {
prefix = "/public";
external = "https://public-appservice-address/public";
};
bridge.permissions = {
@@ -85,12 +265,8 @@ in
'';
description = ''
{file}`config.yaml` configuration as a Nix attribute set.
Configuration options should match those described in
[example-config.yaml](https://github.com/mautrix/discord/blob/main/example-config.yaml).
Secret tokens should be specified using {option}`environmentFile`
instead of this world-readable attribute set.
'';
};
@@ -106,9 +282,12 @@ in
dataDir = lib.mkOption {
type = lib.types.path;
default = defaultDataDir;
defaultText = defaultDataDir;
description = "Directory to store the bridge's data.";
default = "/var/lib/mautrix-discord";
defaultText = "/var/lib/mautrix-discord";
description = ''
Directory to store the bridge's configuration and database files.
This directory will be created if it does not exist.
'';
};
# TODO: Get upstream to add an environment File option. Refer to https://github.com/NixOS/nixpkgs/pull/404871#issuecomment-2895663652 and https://github.com/mautrix/discord/issues/187
@@ -116,31 +295,92 @@ in
type = lib.types.nullOr lib.types.path;
default = null;
description = ''
File containing environment variables for secret substitution.
Variables in the config like `$VARIABLE` will be replaced.
File containing environment variables to substitute when copying the configuration
out of Nix store to the `services.mautrix-discord.dataDir`.
Can be used for storing the secrets without making them available in the Nix store.
For example, you can set `services.mautrix-discord.settings.appservice.as_token = "$MAUTRIX_DISCORD_APPSERVICE_AS_TOKEN"`
and then specify `MAUTRIX_DISCORD_APPSERVICE_AS_TOKEN="{token}"` in the environment file.
This value will get substituted into the configuration file as a token.
'';
};
serviceUnit = lib.mkOption {
type = lib.types.str;
readOnly = true;
default = "mautrix-discord.service";
description = ''
The systemd unit (a service or a target) for other services to depend on if they
need to be started after matrix-synapse.
This option is useful as the actual parent unit for all matrix-synapse processes
changes when configuring workers.
'';
};
registrationServiceUnit = lib.mkOption {
type = lib.types.str;
readOnly = true;
default = "mautrix-discord-registration.service";
description = ''
The registration service that generates the registration file.
Systemd unit (a service or a target) for other services to depend on if they
need to be started after mautrix-discord registration service.
This option is useful as the actual parent unit for all matrix-synapse processes
changes when configuring workers.
'';
};
serviceDependencies = lib.mkOption {
type = lib.types.listOf lib.types.str;
default = [
cfg.registrationServiceUnit
]
++ (lib.lists.optional config.services.matrix-synapse.enable config.services.matrix-synapse.serviceUnit)
++ (lib.lists.optional config.services.matrix-conduit.enable "matrix-conduit.service")
++ (lib.lists.optional config.services.dendrite.enable "dendrite.service");
defaultText = ''
[ cfg.registrationServiceUnit ] ++
(lib.lists.optional config.services.matrix-synapse.enable config.services.matrix-synapse.serviceUnit) ++
(lib.lists.optional config.services.matrix-conduit.enable "matrix-conduit.service") ++
(lib.lists.optional config.services.dendrite.enable "dendrite.service");
'';
description = ''
List of Systemd services to require and wait for when starting the application service.
'';
};
};
};
config = lib.mkIf cfg.enable {
assertions = [
{
assertion =
cfg.settings.homeserver.address or "" != "" && cfg.settings.homeserver.domain or "" != "";
message = "services.mautrix-discord.settings.homeserver.{address,domain} must be set.";
cfg.settings.homeserver.domain or "" != "" && cfg.settings.homeserver.address or "" != "";
message = ''
The options with information about the homeserver:
`services.mautrix-discord.settings.homeserver.domain` and
`services.mautrix-discord.settings.homeserver.address` have to be set.
'';
}
{
assertion = cfg.settings.bridge.permissions or { } != { };
message = ''
The option `services.mautrix-discord.settings.bridge.permissions` has to be set.
'';
}
];
users.users.mautrix-discord = {
isSystemUser = true;
group = "mautrix-discord";
extraGroups = [ "mautrix-discord-registration" ];
home = dataDir;
description = "Mautrix-Discord bridge user";
};
users.groups.mautrix-discord = { };
users.groups.mautrix-discord-registration = {
members = lib.lists.optional config.services.matrix-synapse.enable "matrix-synapse";
};
services.matrix-synapse = lib.mkIf cfg.registerToSynapse {
settings.app_service_config_files = [ registrationFile ];
@@ -152,9 +392,7 @@ in
systemd.services = {
matrix-synapse = lib.mkIf cfg.registerToSynapse {
serviceConfig.SupplementaryGroups = [
"mautrix-discord"
];
serviceConfig.SupplementaryGroups = [ "mautrix-discord-registration" ];
# Make synapse depend on the registration service when auto-registering
wants = [ "mautrix-discord-registration.service" ];
after = [ "mautrix-discord-registration.service" ];
@@ -233,18 +471,15 @@ in
'${settingsFile}' '${registrationFile}' > '${registrationFile}.tmp'
mv '${registrationFile}.tmp' '${registrationFile}'
# Application services should not be rate limited by default.
yq -Y '.rate_limited = false' '${registrationFile}' > '${registrationFile}.tmp'
mv '${registrationFile}.tmp' '${registrationFile}'
umask $old_umask
chown :mautrix-discord-registration '${registrationFile}'
chmod 640 '${registrationFile}'
'';
serviceConfig = {
Type = "oneshot";
RemainAfterExit = true;
UMask = "027";
UMask = 27;
User = "mautrix-discord";
Group = "mautrix-discord";
@@ -266,8 +501,8 @@ in
description = "Mautrix-Discord, a Matrix-Discord puppeting/relaybot bridge";
wantedBy = [ "multi-user.target" ];
wants = [ "network-online.target" ] ++ serviceDependencies;
after = [ "network-online.target" ] ++ serviceDependencies;
wants = [ "network-online.target" ] ++ cfg.serviceDependencies;
after = [ "network-online.target" ] ++ cfg.serviceDependencies;
path = [
pkgs.lottieconverter
pkgs.ffmpeg-headless
@@ -301,8 +536,6 @@ in
ProtectHostname = true;
ProtectClock = true;
UMask = "027";
SystemCallArchitectures = "native";
SystemCallErrorNumber = "EPERM";
SystemCallFilter = "@system-service";
@@ -313,12 +546,10 @@ in
};
};
};
meta = {
maintainers = with lib.maintainers; [
mistyttm
];
doc = ./mautrix-discord.md;
meta = {
maintainers = with lib.maintainers; [
mistyttm
];
};
};
}

View File

@@ -1,4 +1,4 @@
{ pkgs, ... }:
{ pkgs, lib, ... }:
let
homeserverUrl = "http://homeserver:8008";
in
@@ -53,7 +53,6 @@ in
appservice = {
address = "http://homeserver:8009";
hostname = "0.0.0.0";
port = 8009;
id = "discord";
bot = {
@@ -61,6 +60,8 @@ in
displayname = "Discord bridge bot";
avatar = "mxc://maunium.net/nIdEykemnwdisvHbpxflpDlC";
};
# Don't override as_token/hs_token - let them use the default placeholder
# which will trigger automatic generation
database = {
type = "sqlite3";
@@ -74,17 +75,6 @@ in
"*" = "relay";
};
};
logging = {
min_level = "info";
writers = [
{
type = "stdout";
format = "pretty-colored";
time_format = " ";
}
];
};
};
};
@@ -167,57 +157,6 @@ in
with subtest("verify registration file was created"):
homeserver.wait_until_succeeds("test -f /var/lib/mautrix-discord/discord-registration.yaml")
# Verify the module wrote the expected bridge configuration.
config_homeserver_address = homeserver.succeed("yq -r '.homeserver.address' /var/lib/mautrix-discord/config.yaml").strip()
config_homeserver_domain = homeserver.succeed("yq -r '.homeserver.domain' /var/lib/mautrix-discord/config.yaml").strip()
config_appservice_address = homeserver.succeed("yq -r '.appservice.address' /var/lib/mautrix-discord/config.yaml").strip()
config_appservice_hostname = homeserver.succeed("yq -r '.appservice.hostname' /var/lib/mautrix-discord/config.yaml").strip()
config_appservice_port = homeserver.succeed("yq -r '.appservice.port' /var/lib/mautrix-discord/config.yaml").strip()
config_appservice_id = homeserver.succeed("yq -r '.appservice.id' /var/lib/mautrix-discord/config.yaml").strip()
config_bot_username = homeserver.succeed("yq -r '.appservice.bot.username' /var/lib/mautrix-discord/config.yaml").strip()
config_bot_displayname = homeserver.succeed("yq -r '.appservice.bot.displayname' /var/lib/mautrix-discord/config.yaml").strip()
config_bot_avatar = homeserver.succeed("yq -r '.appservice.bot.avatar' /var/lib/mautrix-discord/config.yaml").strip()
config_database_type = homeserver.succeed("yq -r '.appservice.database.type' /var/lib/mautrix-discord/config.yaml").strip()
config_database_uri = homeserver.succeed("yq -r '.appservice.database.uri' /var/lib/mautrix-discord/config.yaml").strip()
config_permission = homeserver.succeed("yq -r '.bridge.permissions[\"*\"]' /var/lib/mautrix-discord/config.yaml").strip()
config_logging_min_level = homeserver.succeed("yq -r '.logging.min_level' /var/lib/mautrix-discord/config.yaml").strip()
config_logging_writer_type = homeserver.succeed("yq -r '.logging.writers[0].type' /var/lib/mautrix-discord/config.yaml").strip()
config_logging_writer_format = homeserver.succeed("yq -r '.logging.writers[0].format' /var/lib/mautrix-discord/config.yaml").strip()
reg_rate_limited = homeserver.succeed("yq -r '.rate_limited' /var/lib/mautrix-discord/discord-registration.yaml").strip()
assert config_homeserver_address == "http://homeserver:8008", \
f"Unexpected homeserver address: {config_homeserver_address}"
assert config_homeserver_domain == "homeserver", \
f"Unexpected homeserver domain: {config_homeserver_domain}"
assert config_appservice_address == "http://homeserver:8009", \
f"Unexpected appservice address: {config_appservice_address}"
assert config_appservice_hostname == "0.0.0.0", \
f"Unexpected appservice hostname: {config_appservice_hostname}"
assert config_appservice_port == "8009", \
f"Unexpected appservice port: {config_appservice_port}"
assert config_appservice_id == "discord", \
f"Unexpected appservice id: {config_appservice_id}"
assert config_bot_username == "discordbot", \
f"Unexpected bot username: {config_bot_username}"
assert config_bot_displayname == "Discord bridge bot", \
f"Unexpected bot displayname: {config_bot_displayname}"
assert config_bot_avatar == "mxc://maunium.net/nIdEykemnwdisvHbpxflpDlC", \
f"Unexpected bot avatar: {config_bot_avatar}"
assert config_database_type == "sqlite3-fk-wal", \
f"Unexpected database type: {config_database_type}"
assert config_database_uri == "file:/var/lib/mautrix-discord/mautrix-discord.db?_txlock=immediate", \
f"Unexpected database uri: {config_database_uri}"
assert config_permission == "relay", \
f"Unexpected default permission mapping: {config_permission}"
assert config_logging_min_level == "info", \
f"Unexpected logging min_level: {config_logging_min_level}"
assert config_logging_writer_type == "stdout", \
f"Unexpected logging writer type: {config_logging_writer_type}"
assert config_logging_writer_format == "pretty-colored", \
f"Unexpected logging writer format: {config_logging_writer_format}"
assert reg_rate_limited == "false", \
f"Registration file should disable rate limiting by default, got: {reg_rate_limited}"
# Verify tokens were generated and are not default values
config_as_token = homeserver.succeed("yq -r '.appservice.as_token' /var/lib/mautrix-discord/config.yaml").strip()
config_hs_token = homeserver.succeed("yq -r '.appservice.hs_token' /var/lib/mautrix-discord/config.yaml").strip()

View File

@@ -45,7 +45,7 @@ assert (!blas.isILP64) && (!lapack.isILP64);
stdenv.mkDerivation (finalAttrs: {
pname = "R";
version = "4.6.0";
version = "4.5.3";
src =
let
@@ -53,7 +53,7 @@ stdenv.mkDerivation (finalAttrs: {
in
fetchurl {
url = "https://cran.r-project.org/src/base/R-${lib.versions.major version}/${pname}-${version}.tar.gz";
hash = "sha256-uNybRUNmDHtZa4eTjfUyOUNQNgl2Un00QijuDtEuRew=";
hash = "sha256-qlwe1Ck8cnGsUT1lRnA1asDopq1eQr4BQ2XREVC1uPI=";
};
outputs = [

View File

@@ -10,14 +10,11 @@
oniguruma,
openssl,
zlib,
versionCheckHook,
}:
rustPlatform.buildRustPackage (finalAttrs: {
pname = "forgejo-cli";
version = "0.5.0";
__structuredAttrs = true;
src = fetchFromCodeberg {
owner = "forgejo-contrib";
repo = "forgejo-cli";
@@ -52,10 +49,6 @@ rustPlatform.buildRustPackage (finalAttrs: {
--zsh <($out/bin/fj completion zsh)
'';
nativeInstallCheckInputs = [ versionCheckHook ];
versionCheckProgramArg = "version";
doInstallCheck = true;
meta = {
description = "CLI application for interacting with Forgejo";
homepage = "https://codeberg.org/forgejo-contrib/forgejo-cli";

View File

@@ -7,16 +7,16 @@
}:
php.buildComposerProject2 (finalAttrs: {
pname = "phpactor";
version = "2026.05.30.1";
version = "2025.12.21.1";
src = fetchFromGitHub {
owner = "phpactor";
repo = "phpactor";
tag = finalAttrs.version;
hash = "sha256-Harrs0SM00MVBicMfvs3bcLQf/PSTp6k7hcEExGELWE=";
hash = "sha256-9hkYU/Mhxl49tIZa3Vyj3kXftNIgZXUlH1T6/4obM7I=";
};
vendorHash = "sha256-PztP3qN6LL+1UshNyuJof0WT9Dg5MfXwfQr57kBG9hM=";
vendorHash = "sha256-XsybPL391WGHztWPaZAN1l2hWQMQ0tklZ9yjkKjGzsI=";
nativeBuildInputs = [ installShellFiles ];

View File

@@ -7,15 +7,15 @@
buildNpmPackage rec {
pname = "zwave-js-ui";
version = "11.19.1";
version = "11.19.0";
src = fetchFromGitHub {
owner = "zwave-js";
repo = "zwave-js-ui";
tag = "v${version}";
hash = "sha256-9dqvQxlk+DdYcpCgoLR8EqtgwJwMA4Dvtwc8n1K8Cic=";
hash = "sha256-hn5Y5ADAybwSK5hv3J7qlyjPztD6QRB4oq9JTuLg9Vk=";
};
npmDepsHash = "sha256-dED08xcbgO3zfNRP9iNuTcL+73HnfBnwDrPCGY4TZBQ=";
npmDepsHash = "sha256-hHalQUYj2T6AnxU0/EcbobY5UxgwvaS2NAy95FASTCk=";
passthru.tests.zwave-js-ui = nixosTests.zwave-js-ui;

View File

@@ -14,7 +14,7 @@
buildPythonPackage (finalAttrs: {
pname = "fastapi-pagination";
version = "0.15.14";
version = "0.15.13";
pyproject = true;
__structuredAttrs = true;
@@ -22,7 +22,7 @@ buildPythonPackage (finalAttrs: {
owner = "uriyyo";
repo = "fastapi-pagination";
tag = finalAttrs.version;
hash = "sha256-W3SgSne3GgRl2W6l3NWUguvzxigLCVgMLiT/fMIWSAE=";
hash = "sha256-c+bXtc4MQdd+UlsBHtVL6F2lBu46yry9OTKsMbu1Mhw=";
};
build-system = [

View File

@@ -2,7 +2,6 @@
lib,
buildPythonPackage,
fetchFromGitHub,
symlinkJoin,
# build-system
setuptools,
@@ -31,7 +30,6 @@
joblib,
# jsonpath-python,
nltk,
nltk-data,
olefile,
orderly-set,
python-dateutil,
@@ -120,18 +118,6 @@
}:
let
version = "0.18.31";
# unstructured downloads these NLTK corpora at import time unless they are already on
# nltk.data.path, which fails in offline or read-only builds. Bundle them and register
# the directory in postPatch. It must be named "nltk_data": unstructured's resolver
# uses paths ending in "nltk_data" as-is and appends "/nltk_data" to any others.
nltkData = symlinkJoin {
name = "nltk_data";
paths = with nltk-data; [
averaged-perceptron-tagger-eng
punkt-tab
];
};
in
buildPythonPackage rec {
pname = "unstructured";
@@ -147,11 +133,6 @@ buildPythonPackage rec {
build-system = [ setuptools ];
postPatch = ''
substituteInPlace unstructured/nlp/tokenize.py \
--replace-fail 'import nltk' 'import nltk; nltk.data.path.append("${nltkData}")'
'';
dependencies = [
# Base dependencies
anyio
@@ -276,14 +257,10 @@ buildPythonPackage rec {
];
};
pythonImportsCheck = [
"unstructured"
# exercises the bundled NLTK corpora lookup, so the build catches an attempted download
"unstructured.nlp.tokenize"
];
pythonImportsCheck = [ "unstructured" ];
# the import-time NLTK download is handled via nltkData above, but the test suite has
# further offline/data requirements that are not yet verified, so keep it disabled.
# test try to download punkt from nltk
# figure out how to make it available to enable the tests
doCheck = false;
nativeCheckInputs = [

View File

@@ -1,6 +1,6 @@
{
"extraArgs": {
"biocVersion": "3.23"
"biocVersion": "3.22"
},
"packages": {
"AHCytoBands": {
@@ -737,8 +737,8 @@
},
"BioMartGOGeneSets": {
"name": "BioMartGOGeneSets",
"version": "0.99.12",
"sha256": "11x00v18vd5ppm9asg120dmhmqamzsacy64v3kmmxfn7rhxl25b2",
"version": "0.99.11",
"sha256": "1ack8v1q0zg15gs816n9f4pwrzrpsv4va6j0r8847pw0pvavwpiq",
"depends": ["GenomicRanges", "S4Vectors"]
},
"CENTREannotation": {
@@ -749,8 +749,8 @@
},
"CTCF": {
"name": "CTCF",
"version": "0.99.14",
"sha256": "06nyz5758mq04hzvc7bl0ld2d173zabs9xyhva01y92b19yy8nfp",
"version": "0.99.13",
"sha256": "097w2rad5fxyg2dkghz6ws93q1l7hlc6f9dnw1n30gs2bdv5hbyb",
"depends": []
},
"ChemmineDrugs": {
@@ -887,14 +887,14 @@
},
"GO_db": {
"name": "GO.db",
"version": "3.23.1",
"sha256": "0ays2n3jivigpr7m3y3rba8gjyqr7g3qxdslppww0z0zzm4m808z",
"version": "3.22.0",
"sha256": "1liyl1ic2d08an0h6yxllggkv9n8vyp1bfjwvqzk5ana17lzmimf",
"depends": ["AnnotationDbi"]
},
"GeneSummary": {
"name": "GeneSummary",
"version": "0.99.7",
"sha256": "0pl843r230cgq0nh5pwp19zz823dwdv789kfcgdhylijx3h2ymfk",
"version": "0.99.6",
"sha256": "0h6afrjb00afrcw6mwslxp7cmwfzp4qfxh0aa4f41kfjd3cymmp5",
"depends": []
},
"GenomeInfoDbData": {
@@ -1241,8 +1241,8 @@
},
"Orthology_eg_db": {
"name": "Orthology.eg.db",
"version": "3.23.0",
"sha256": "0640jwylw67cw8sylmyfcqm8cak5i2bx9k925bwm0bjmayxl8yw3",
"version": "3.22.0",
"sha256": "14wng7izmr7wx3yimjlvmk87vf1z3z0n88y2nghn8a2iqci1rl3s",
"depends": ["AnnotationDbi"]
},
"PANTHER_db": {
@@ -1673,8 +1673,8 @@
},
"UniProtKeywords": {
"name": "UniProtKeywords",
"version": "0.99.8",
"sha256": "1mhbhar70acwgjmlfkfrqc2hskqvbgsaf9xlzv8ph66x6gvbyqb7",
"version": "0.99.7",
"sha256": "10id2lk2mbccay7p44pk58zhkiqc58x237qr76plivgpcc8xhjzq",
"depends": []
},
"XtraSNPlocs_Hsapiens_dbSNP144_GRCh37": {
@@ -2093,8 +2093,8 @@
},
"excluderanges": {
"name": "excluderanges",
"version": "0.99.11",
"sha256": "1czr9hr84hzwa7fyzm51425nphy0b9h5yfvgkij5v8qgq565w02a",
"version": "0.99.10",
"sha256": "0j9njpnbh731ffimr1sbvix3wsivnh9nwxg6sbrpwp8gl0pnl7r0",
"depends": ["GenomicRanges"]
},
"fitCons_UCSC_hg19": {
@@ -2513,8 +2513,8 @@
},
"hpAnnot": {
"name": "hpAnnot",
"version": "1.1.3",
"sha256": "0gnir407flzzkkljxf2brqrw2kaycl8azi0wc5yn1fhl7x5zidq1",
"version": "1.1.1",
"sha256": "0bkfcj9igi7ylhf3arszqnqzaxsxvfv2gn2smzx6ymzq5a8sc0yg",
"depends": ["AnnotationHub"]
},
"hs25kresogen_db": {
@@ -3749,20 +3749,20 @@
},
"org_Hs_eg_db": {
"name": "org.Hs.eg.db",
"version": "3.23.1",
"sha256": "1zlwsk1hq40xi8xd7wc974jp8gky6x7icc9788ch77glbik201j7",
"version": "3.22.0",
"sha256": "0bia1ppxnyjpw4p3rk19q1l8rrcraccpz4w69f3ja0q0im0xrgfi",
"depends": ["AnnotationDbi"]
},
"org_Mm_eg_db": {
"name": "org.Mm.eg.db",
"version": "3.23.0",
"sha256": "0i252737v6wk0im41gnksz4qkzf286kwgfq60yqc1mfva77m8yjh",
"version": "3.22.0",
"sha256": "16liabdbkfqzhna3rw1zgf777r3xm8knrbvy0181c2nsn2jkxsv3",
"depends": ["AnnotationDbi"]
},
"org_Mmu_eg_db": {
"name": "org.Mmu.eg.db",
"version": "3.23.0",
"sha256": "08l4bckvn42yjgpkcmq87c1c2z4g8cfjc9jm5ibb84v5ffjw92ij",
"version": "3.22.0",
"sha256": "0ga0c9635pkigmr0l9vazh3qdpyxki1y8l7mbgcp1y8sfkyjn33c",
"depends": ["AnnotationDbi"]
},
"org_Mxanthus_db": {
@@ -3779,14 +3779,14 @@
},
"org_Pt_eg_db": {
"name": "org.Pt.eg.db",
"version": "3.23.0",
"sha256": "1hfvrv2n9gc0h4s6ql4lv8q8qjf75c4y5p2hlplhphzi38j54vhl",
"version": "3.22.0",
"sha256": "1i67vccx3a6zak34nwdhrbhm7hkjz9qbai9jvwrlql6z8xc6n6q0",
"depends": ["AnnotationDbi"]
},
"org_Rn_eg_db": {
"name": "org.Rn.eg.db",
"version": "3.23.0",
"sha256": "1j1gs8bk1a247shhs5z41s4pk6hw4ssy7405fv5q16m5ilpwgc1g",
"version": "3.22.0",
"sha256": "0vqpmbivxd1yvapa5gz9mrxlk6ivrzak55dw2sfjm8sl308rmaj4",
"depends": ["AnnotationDbi"]
},
"org_Sc_sgd_db": {
@@ -3797,14 +3797,14 @@
},
"org_Ss_eg_db": {
"name": "org.Ss.eg.db",
"version": "3.23.0",
"sha256": "0ijn7dfh485lww1d9bp8j40fcjr1lx8vdnlq6ydwq3ni4bifkzqp",
"version": "3.22.0",
"sha256": "03qlbkvxfmdgpl8dwx72msd9asx12izvq2vmidqfyipyr7r79cbm",
"depends": ["AnnotationDbi"]
},
"org_Xl_eg_db": {
"name": "org.Xl.eg.db",
"version": "3.23.0",
"sha256": "1w856a5hkp9a5g41nd69xwvzaf1nmq7zqjsn7w5p1i2zsxv1i1k1",
"version": "3.22.0",
"sha256": "1h8jvdzhpp9d4zaaczhmg6hk32p77l63v3095ln58rhy9m18pg0f",
"depends": ["AnnotationDbi"]
},
"paeg1acdf": {
@@ -5111,8 +5111,8 @@
},
"reactome_db": {
"name": "reactome.db",
"version": "1.96.0",
"sha256": "0b43ri3clg6ynp197vy24936n762k0f43v9m51g1lar2w4qc2zhb",
"version": "1.95.0",
"sha256": "1b87byr45cmqa7jyd5fw3askmrzfhdljjp2d7jcmm88baf45mfg6",
"depends": ["AnnotationDbi"]
},
"rgu34a_db": {

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -765,9 +765,7 @@ let
];
RGtk2 = [ pkgs.gtk2.dev ];
rhdf5 = [ pkgs.zlib ];
Rhdf5lib = with pkgs; [
cmake
];
Rhdf5lib = with pkgs; [ zlib.dev ];
Rhpc = with pkgs; [
zlib
bzip2.dev
@@ -823,10 +821,7 @@ let
rpanel = [ pkgs.tclPackages.bwidget ];
Rpoppler = [ pkgs.poppler ];
RPostgreSQL = with pkgs; [ libpq.pg_config ];
RProtoBuf = with pkgs; [
protobuf
abseil-cpp.dev
];
RProtoBuf = [ pkgs.protobuf ];
rsamplr = with pkgs; [
cargo
rustc
@@ -870,10 +865,6 @@ let
cargo
rustc
];
tinyimg = with pkgs; [
cargo
rustc
];
caugi = with pkgs; [
cargo
rustc
@@ -975,7 +966,6 @@ let
fontconfig.dev
freetype.dev
];
rlas = [ pkgs.pkg-config ];
TAQMNGR = [ pkgs.zlib.dev ];
TDA = [ pkgs.gmp ];
tesseract = with pkgs; [
@@ -1237,16 +1227,10 @@ let
xz.dev
zlib.dev
];
fs = [ pkgs.libuv ];
pgenlibr = [ pkgs.zlib.dev ];
fftw = [ pkgs.pkg-config ];
gdtools = [ pkgs.pkg-config ];
archive = [ pkgs.libarchive ];
lpsymphony = with pkgs; [
symphony
cgl
clp
];
gdalcubes = with pkgs; [
proj.dev
gdal
@@ -1267,10 +1251,6 @@ let
fftw.dev
pkg-config
];
Rhdf5lib = with pkgs; [
curl
zlib.dev
];
GRAB = [ pkgs.zlib.dev ];
jqr = [ pkgs.jq.out ];
kza = [ pkgs.pkg-config ];
@@ -1561,13 +1541,7 @@ let
redux = [ pkgs.hiredis ];
RmecabKo = [ pkgs.mecab ];
markets = [ pkgs.gsl ];
rlas = with pkgs; [
boost
gdal
proj
sqlite
geos
];
rlas = [ pkgs.boost ];
bgx = [ pkgs.boost ];
PoissonBinomial = [ pkgs.fftw.dev ];
poisbinom = [ pkgs.fftw.dev ];
@@ -1973,10 +1947,6 @@ let
postPatch = "patchShebangs configure";
});
fixest = old.fixest.overrideAttrs (attrs: {
postPatch = "patchShebangs configure";
});
arcgisplaces = old.arcgisplaces.overrideAttrs (attrs: {
postPatch = "patchShebangs configure";
});
@@ -2009,10 +1979,6 @@ let
postPatch = "patchShebangs configure";
});
ramr = old.ramr.overrideAttrs (attrs: {
postPatch = "patchShebangs configure";
});
roxigraph = old.roxigraph.overrideAttrs (attrs: {
env = (attrs.env or { }) // {
LIBCLANG_PATH = "${lib.getLib pkgs.libclang}/lib";
@@ -2474,10 +2440,6 @@ let
'';
});
RProtoBuf = old.RProtoBuf.overrideAttrs (attrs: {
configureFlags = [ "ac_cv_prog_cxx_cxx11=" ];
});
JavaGD = old.JavaGD.overrideAttrs (attrs: {
preConfigure = ''
export JAVA_CPPFLAGS=-I${pkgs.jdk}/include/
@@ -2986,10 +2948,7 @@ let
);
lpsymphony = old.lpsymphony.overrideAttrs (attrs: {
postPatch = ''
substituteInPlace configure \
--replace-fail '--libs SYMPHONY' '--libs symphony' \
--replace-fail '--cflags SYMPHONY' '--cflags symphony'
preConfigure = ''
patchShebangs configure
'';
});
@@ -3149,13 +3108,7 @@ let
Rhdf5lib =
let
hdf5 = pkgs.hdf5.overrideAttrs (attrs: {
cmakeFlags = attrs.cmakeFlags ++ [ "-DHDF5_ENABLE_ROS3_VFD:BOOL=TRUE" ];
buildInputs = attrs.buildInputs ++ [ pkgs.curl.dev ];
postInstall = attrs.postInstall or "" + ''
cp src/libhdf5.settings $dev/lib
'';
});
hdf5 = pkgs.hdf5_1_10;
in
old.Rhdf5lib.overrideAttrs (attrs: {
propagatedBuildInputs = attrs.propagatedBuildInputs ++ [

View File

@@ -1,8 +1,8 @@
diff --git a/R/zzz.R b/R/zzz.R
index 2af2b3e..21ddc00 100644
index 97becd7..803ca39 100644
--- a/R/zzz.R
+++ b/R/zzz.R
@@ -22,7 +22,7 @@ pkgconfig <- function(opt = c("PKG_CXX_LIBS", "PKG_C_LIBS", "PKG_CXX_HL_LIBS", "
@@ -20,7 +20,7 @@ pkgconfig <- function(opt = c("PKG_CXX_LIBS", "PKG_C_LIBS", "PKG_CXX_HL_LIBS", "
path <- Sys.getenv(
x = "RHDF5LIB_RPATH",
@@ -10,48 +10,70 @@ index 2af2b3e..21ddc00 100644
+ unset = ""
)
sysname <- Sys.info()['sysname']
@@ -47,7 +47,7 @@ pkgconfig <- function(opt = c("PKG_CXX_LIBS", "PKG_C_LIBS", "PKG_CXX_HL_LIBS", "
sprintf('-L%s -lhdf5 %s',
if (nzchar(.Platform$r_arch)) {
@@ -59,7 +59,7 @@ pkgconfig <- function(opt = c("PKG_CXX_LIBS", "PKG_C_LIBS", "PKG_CXX_HL_LIBS", "
sprintf('-L%s -lhdf5 %s',
patharch, winlibs)
}, {
- sprintf('"%s/libhdf5.a"%s%s',
+ sprintf('-lhdf5',
patharch, .getSzipLoc(patharch), .getDynamicLinks(patharch))
+ sprintf('-lhdf5',
patharch, .getSzipLoc(patharch), .getDynamicLinks())
}
)
@@ -58,7 +58,7 @@ pkgconfig <- function(opt = c("PKG_CXX_LIBS", "PKG_C_LIBS", "PKG_CXX_HL_LIBS", "
sprintf('-L%s -lhdf5_cpp -lhdf5 %s',
@@ -70,7 +70,7 @@ pkgconfig <- function(opt = c("PKG_CXX_LIBS", "PKG_C_LIBS", "PKG_CXX_HL_LIBS", "
sprintf('-L%s -lhdf5_cpp -lhdf5 %s',
patharch, winlibs)
}, {
- sprintf('"%s/libhdf5_cpp.a" "%s/libhdf5.a"%s%s',
+ sprintf('-lhdf5_cpp -lhdf5',
patharch, patharch, .getSzipLoc(patharch), .getDynamicLinks(patharch))
patharch, patharch, .getSzipLoc(patharch), .getDynamicLinks())
}
)
@@ -69,7 +69,7 @@ pkgconfig <- function(opt = c("PKG_CXX_LIBS", "PKG_C_LIBS", "PKG_CXX_HL_LIBS", "
sprintf('-L%s -lhdf5_hl -lhdf5 %s',
@@ -81,7 +81,7 @@ pkgconfig <- function(opt = c("PKG_CXX_LIBS", "PKG_C_LIBS", "PKG_CXX_HL_LIBS", "
sprintf('-L%s -lhdf5_hl -lhdf5 %s',
patharch, winlibs)
}, {
- sprintf('"%s/libhdf5_hl.a" "%s/libhdf5.a"%s%s',
+ sprintf('-lhdf5_hl -lhdf5',
patharch, patharch, .getSzipLoc(patharch), .getDynamicLinks(patharch))
+ sprintf('-lhdf5_hl -lhdf5',
patharch, patharch, .getSzipLoc(patharch), .getDynamicLinks())
}
)
@@ -80,7 +80,7 @@ pkgconfig <- function(opt = c("PKG_CXX_LIBS", "PKG_C_LIBS", "PKG_CXX_HL_LIBS", "
sprintf('-L%s -lhdf5_hl_cpp -lhdf5_hl -lhdf5_cpp -lhdf5 %s',
@@ -92,7 +92,7 @@ pkgconfig <- function(opt = c("PKG_CXX_LIBS", "PKG_C_LIBS", "PKG_CXX_HL_LIBS", "
sprintf('-L%s -lhdf5_hl_cpp -lhdf5_hl -lhdf5_cpp -lhdf5 %s',
patharch, winlibs)
}, {
- sprintf('"%s/libhdf5_hl_cpp.a" "%s/libhdf5_hl.a" "%s/libhdf5_cpp.a" "%s/libhdf5.a"%s%s',
+ sprintf('-lhdf5_hl_cpp -lhdf5_hl -lhdf5_cpp -lhdf5',
patharch, patharch, patharch, patharch, .getSzipLoc(patharch), .getDynamicLinks(patharch))
patharch, patharch, patharch, patharch, .getSzipLoc(patharch), .getDynamicLinks())
}
)
@@ -113,6 +113,7 @@ getHdf5Version <- function() {
#' @noRd
@@ -124,6 +124,7 @@ getHdf5Version <- function() {
#'
#' @keywords internal
.getDynamicLinks <- function(path) {
.getDynamicLinks <- function() {
+ return("")
settings_file <- file.path(path, "libhdf5.settings")
libhdf5_settings <- readLines(settings_file)
libstr <- grep("Extra libraries", x = libhdf5_settings, fixed = TRUE, value = TRUE) |>
sysname <- Sys.info()['sysname']
if(sysname == "Windows") {
links <- "-lz"
diff --git a/src/Makevars.in b/src/Makevars.in
index addb6a0..590784a 100644
--- a/src/Makevars.in
+++ b/src/Makevars.in
@@ -18,7 +18,7 @@ USER_LIB_DIR = ${R_PACKAGE_DIR}/lib${R_ARCH}/
PKG_CPPFLAGS = -I${USER_INCLUDE_DIR} ${ZLIB_INCLUDE}
PKG_CFLAGS = ${ZLIB_LIB}
-PKG_LIBS = "${USER_LIB_DIR}libhdf5.a" @SZIP_LIB@ -lz
+PKG_LIBS = -lhdf5 -lsz
@@ -26,7 +26,7 @@ all: $(SHLIB)
$(SHLIB): Rhdf5lib.o
-Rhdf5lib.o: copy-hdf5 @COPY_SZIP@
+Rhdf5lib.o:
copy-szip: copy-hdf5
cp hdf5/libaec-1.0.4/build/szip/lib/libsz.a "${USER_LIB_DIR}"

View File

@@ -9,3 +9,39 @@ index 713b44c..704ac17 100644
#PKG_CFLAGS = -Wall
diff --git a/src/h5testLock.c b/src/h5testLock.c
index b326444..5d58b4a 100644
--- a/src/h5testLock.c
+++ b/src/h5testLock.c
@@ -8,16 +8,16 @@ SEXP _h5fileLock(SEXP _file_name) {
int lk = -1;
/* create the temporary file */
- fd = HDopen(file_name, O_RDWR | O_CREAT | O_TRUNC, 0666);
+ fd = open(file_name, O_RDWR | O_CREAT | O_TRUNC, 0666);
/* try to lock file */
- lk = HDflock(fd, LOCK_EX | LOCK_NB);
+ lk = flock(fd, LOCK_EX | LOCK_NB);
/* unlock so we can remove */
- HDflock(fd, LOCK_UN);
+ flock(fd, LOCK_UN);
/* close */
- HDclose(fd);
+ close(fd);
/* return value of lock attempt */
PROTECT(Rval = allocVector(INTSXP, 1));
diff --git a/src/h5testLock.h b/src/h5testLock.h
index 2c1c5e4..25914ff 100644
--- a/src/h5testLock.h
+++ b/src/h5testLock.h
@@ -1,5 +1,5 @@
#include <fcntl.h>
+#include <unistd.h>
#include "myhdf5.h"
-#include <H5private.h>
SEXP _h5fileLock();

View File

@@ -13,13 +13,13 @@
postgresqlBuildExtension (finalAttrs: {
pname = "plr";
version = "8.4.8.6";
version = "8.4.8";
src = fetchFromGitHub {
owner = "postgres-plr";
repo = "plr";
tag = "REL${lib.replaceString "." "_" finalAttrs.version}";
hash = "sha256-SBLv9GsyYmYdxrWmGiMIiFRGl5FA+j2RcSmKz9pMv2E=";
hash = "sha256-FLL61HsZ6WaWBP9NqrJjhMFSVyVBIpVO0wv+kXMuAaU=";
};
nativeBuildInputs = [ pkg-config ];