nixos.mautrix-meta: Update config to 0.4 format
The package has been updated to 0.4 which will result in an auto-migration of the config. This updates our config to match the new expected format. Assertions have been added to warn users that they need to migrate their configuration.
This commit is contained in:
parent
b1b7d7f3c5
commit
0dcfe7e565
@ -406,6 +406,8 @@
|
|||||||
|
|
||||||
- `programs.vim.defaultEditor` now only works if `programs.vim.enable` is enabled.
|
- `programs.vim.defaultEditor` now only works if `programs.vim.enable` is enabled.
|
||||||
|
|
||||||
|
- `services.mautrix-meta` was updated to [0.4](https://github.com/mautrix/meta/releases/tag/v0.4.0). This release makes significant changes to the settings format. If you have custom settings you should migrate them to the new format. Unfortunately upstream provides little guidance for how to do this, but [the auto-migration code](https://github.com/mautrix/meta/blob/f5440b05aac125b4c95b1af85635a717cbc6dd0e/cmd/mautrix-meta/legacymigrate.go#L23) may serve as a useful reference. The NixOS module should warn you if you still have any old settings configured.
|
||||||
|
|
||||||
- The `indi-full` package no longer contains non-free drivers.
|
- The `indi-full` package no longer contains non-free drivers.
|
||||||
To get the old collection of drivers use `indi-full-nonfree` or create your own collection of drivers by overriding indi-with-drivers.
|
To get the old collection of drivers use `indi-full-nonfree` or create your own collection of drivers by overriding indi-with-drivers.
|
||||||
E.g.: `pkgs.indi-with-drivers.override {extraDrivers = with pkgs.indi-3rdparty; [indi-gphoto];}`
|
E.g.: `pkgs.indi-with-drivers.override {extraDrivers = with pkgs.indi-3rdparty; [indi-gphoto];}`
|
||||||
|
@ -69,11 +69,6 @@ in {
|
|||||||
appservice = {
|
appservice = {
|
||||||
id = "";
|
id = "";
|
||||||
|
|
||||||
database = {
|
|
||||||
type = "sqlite3-fk-wal";
|
|
||||||
uri = "file:${fullDataDir config}/mautrix-meta.db?_txlock=immediate";
|
|
||||||
};
|
|
||||||
|
|
||||||
bot = {
|
bot = {
|
||||||
username = "";
|
username = "";
|
||||||
};
|
};
|
||||||
@ -83,11 +78,15 @@ in {
|
|||||||
address = "http://${config.settings.appservice.hostname}:${toString config.settings.appservice.port}";
|
address = "http://${config.settings.appservice.hostname}:${toString config.settings.appservice.port}";
|
||||||
};
|
};
|
||||||
|
|
||||||
meta = {
|
bridge = {
|
||||||
mode = "";
|
permissions = {};
|
||||||
|
};
|
||||||
|
|
||||||
|
database = {
|
||||||
|
type = "sqlite3-fk-wal";
|
||||||
|
uri = "file:${fullDataDir config}/mautrix-meta.db?_txlock=immediate";
|
||||||
};
|
};
|
||||||
|
|
||||||
bridge = {
|
|
||||||
# Enable encryption by default to make the bridge more secure
|
# Enable encryption by default to make the bridge more secure
|
||||||
encryption = {
|
encryption = {
|
||||||
allow = true;
|
allow = true;
|
||||||
@ -106,6 +105,11 @@ in {
|
|||||||
delete_outdated_inbound = true;
|
delete_outdated_inbound = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# TODO: This effectively disables encryption. But this is the value provided when a <0.4 config is migrated. Changing it will corrupt the database.
|
||||||
|
# https://github.com/mautrix/meta/blob/f5440b05aac125b4c95b1af85635a717cbc6dd0e/cmd/mautrix-meta/legacymigrate.go#L24
|
||||||
|
# If you wish to encrypt the local database you should set this to an environment variable substitution and reset the bridge or somehow migrate the DB.
|
||||||
|
pickle_key = "mautrix.bridge.e2ee";
|
||||||
|
|
||||||
verification_levels = {
|
verification_levels = {
|
||||||
receive = "cross-signed-tofu";
|
receive = "cross-signed-tofu";
|
||||||
send = "cross-signed-tofu";
|
send = "cross-signed-tofu";
|
||||||
@ -113,9 +117,6 @@ in {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
permissions = {};
|
|
||||||
};
|
|
||||||
|
|
||||||
logging = {
|
logging = {
|
||||||
min_level = "info";
|
min_level = "info";
|
||||||
writers = lib.singleton {
|
writers = lib.singleton {
|
||||||
@ -124,6 +125,10 @@ in {
|
|||||||
time_format = " ";
|
time_format = " ";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
network = {
|
||||||
|
mode = "";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
defaultText = ''
|
defaultText = ''
|
||||||
{
|
{
|
||||||
@ -261,7 +266,7 @@ in {
|
|||||||
description = ''
|
description = ''
|
||||||
Configuration of multiple `mautrix-meta` instances.
|
Configuration of multiple `mautrix-meta` instances.
|
||||||
`services.mautrix-meta.instances.facebook` and `services.mautrix-meta.instances.instagram`
|
`services.mautrix-meta.instances.facebook` and `services.mautrix-meta.instances.instagram`
|
||||||
come preconfigured with meta.mode, appservice.id, bot username, display name and avatar.
|
come preconfigured with network.mode, appservice.id, bot username, display name and avatar.
|
||||||
'';
|
'';
|
||||||
|
|
||||||
example = ''
|
example = ''
|
||||||
@ -283,7 +288,7 @@ in {
|
|||||||
messenger = {
|
messenger = {
|
||||||
enable = true;
|
enable = true;
|
||||||
settings = {
|
settings = {
|
||||||
meta.mode = "messenger";
|
network.mode = "messenger";
|
||||||
homeserver.domain = "example.com";
|
homeserver.domain = "example.com";
|
||||||
appservice = {
|
appservice = {
|
||||||
id = "messenger";
|
id = "messenger";
|
||||||
@ -313,9 +318,9 @@ in {
|
|||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
assertion = builtins.elem cfg.settings.meta.mode [ "facebook" "facebook-tor" "messenger" "instagram" ];
|
assertion = builtins.elem cfg.settings.network.mode [ "facebook" "facebook-tor" "messenger" "instagram" ];
|
||||||
message = ''
|
message = ''
|
||||||
The option `services.mautrix-meta.instances.${name}.settings.meta.mode` has to be set
|
The option `services.mautrix-meta.instances.${name}.settings.network.mode` has to be set
|
||||||
to one of: facebook, facebook-tor, messenger, instagram.
|
to one of: facebook, facebook-tor, messenger, instagram.
|
||||||
This configures the mode of the bridge.
|
This configures the mode of the bridge.
|
||||||
'';
|
'';
|
||||||
@ -338,6 +343,24 @@ in {
|
|||||||
The option `services.mautrix-meta.instances.${name}.settings.appservice.bot.username` has to be set.
|
The option `services.mautrix-meta.instances.${name}.settings.appservice.bot.username` has to be set.
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
assertion = !(cfg.settings ? bridge.disable_xma);
|
||||||
|
message = ''
|
||||||
|
The option `bridge.disable_xma` has been moved to `network.disable_xma_always`. Please [migrate your configuration](https://github.com/mautrix/meta/releases/tag/v0.4.0). You may wish to use [the auto-migration code](https://github.com/mautrix/meta/blob/f5440b05aac125b4c95b1af85635a717cbc6dd0e/cmd/mautrix-meta/legacymigrate.go#L23) for reference.
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
{
|
||||||
|
assertion = !(cfg.settings ? bridge.displayname_template);
|
||||||
|
message = ''
|
||||||
|
The option `bridge.displayname_template` has been moved to `network.displayname_template`. Please [migrate your configuration](https://github.com/mautrix/meta/releases/tag/v0.4.0). You may wish to use [the auto-migration code](https://github.com/mautrix/meta/blob/f5440b05aac125b4c95b1af85635a717cbc6dd0e/cmd/mautrix-meta/legacymigrate.go#L23) for reference.
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
{
|
||||||
|
assertion = !(cfg.settings ? meta);
|
||||||
|
message = ''
|
||||||
|
The options in `meta` have been moved to `network`. Please [migrate your configuration](https://github.com/mautrix/meta/releases/tag/v0.4.0). You may wish to use [the auto-migration code](https://github.com/mautrix/meta/blob/f5440b05aac125b4c95b1af85635a717cbc6dd0e/cmd/mautrix-meta/legacymigrate.go#L23) for reference.
|
||||||
|
'';
|
||||||
|
}
|
||||||
]) enabledInstances));
|
]) enabledInstances));
|
||||||
|
|
||||||
users.users = lib.mapAttrs' (name: cfg: lib.nameValuePair "mautrix-meta-${name}" {
|
users.users = lib.mapAttrs' (name: cfg: lib.nameValuePair "mautrix-meta-${name}" {
|
||||||
@ -518,11 +541,7 @@ in {
|
|||||||
in {
|
in {
|
||||||
instagram = {
|
instagram = {
|
||||||
settings = {
|
settings = {
|
||||||
meta.mode = mkDefault "instagram";
|
network.mode = mkDefault "instagram";
|
||||||
|
|
||||||
bridge = {
|
|
||||||
username_template = mkDefault "instagram_{{.}}";
|
|
||||||
};
|
|
||||||
|
|
||||||
appservice = {
|
appservice = {
|
||||||
id = mkDefault "instagram";
|
id = mkDefault "instagram";
|
||||||
@ -532,16 +551,13 @@ in {
|
|||||||
displayname = mkDefault "Instagram bridge bot";
|
displayname = mkDefault "Instagram bridge bot";
|
||||||
avatar = mkDefault "mxc://maunium.net/JxjlbZUlCPULEeHZSwleUXQv";
|
avatar = mkDefault "mxc://maunium.net/JxjlbZUlCPULEeHZSwleUXQv";
|
||||||
};
|
};
|
||||||
|
username_template = mkDefault "instagram_{{.}}";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
facebook = {
|
facebook = {
|
||||||
settings = {
|
settings = {
|
||||||
meta.mode = mkDefault "facebook";
|
network.mode = mkDefault "facebook";
|
||||||
|
|
||||||
bridge = {
|
|
||||||
username_template = mkDefault "facebook_{{.}}";
|
|
||||||
};
|
|
||||||
|
|
||||||
appservice = {
|
appservice = {
|
||||||
id = mkDefault "facebook";
|
id = mkDefault "facebook";
|
||||||
@ -551,6 +567,7 @@ in {
|
|||||||
displayname = mkDefault "Facebook bridge bot";
|
displayname = mkDefault "Facebook bridge bot";
|
||||||
avatar = mkDefault "mxc://maunium.net/ygtkteZsXnGJLJHRchUwYWak";
|
avatar = mkDefault "mxc://maunium.net/ygtkteZsXnGJLJHRchUwYWak";
|
||||||
};
|
};
|
||||||
|
username_template = mkDefault "facebook_{{.}}";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user