diff --git a/nix/modules/default/default.nix b/nix/modules/default/default.nix index 91eba6d9..9c7d35a8 100644 --- a/nix/modules/default/default.nix +++ b/nix/modules/default/default.nix @@ -29,21 +29,21 @@ in type = types.submodule { freeformType = format.type; options = { - global.address = lib.mkOption { + address = lib.mkOption { type = types.nonEmptyStr; description = '' The local IP address to bind to. ''; default = "::1"; }; - global.conduit_compat = lib.mkOption { + conduit_compat = lib.mkOption { type = types.bool; description = '' Whether to operate as a drop-in replacement for Conduit. ''; default = false; }; - global.database_path = lib.mkOption { + database_path = lib.mkOption { type = types.nonEmptyStr; readOnly = true; description = '' @@ -52,11 +52,11 @@ in Note that this is read-only because this module makes use of systemd's `StateDirectory` option. ''; - default = if cfg.settings.global.conduit_compat + default = if cfg.settings.conduit_compat then "/var/lib/matrix-conduit" else "/var/lib/grapevine"; }; - global.port = lib.mkOption { + port = lib.mkOption { type = types.port; description = '' The local port to bind to. @@ -98,14 +98,14 @@ in RestrictNamespaces = true; RestrictRealtime = true; StartLimitBurst = 5; - StateDirectory = if cfg.settings.global.conduit_compat + StateDirectory = if cfg.settings.conduit_compat then "matrix-conduit" else "grapevine"; StateDirectoryMode = "0700"; SystemCallArchitectures = "native"; SystemCallFilter = [ "@system-service" "~@privileged" ]; UMask = "077"; - User = if cfg.settings.global.conduit_compat + User = if cfg.settings.conduit_compat then "conduit" else "grapevine"; }; diff --git a/src/config/proxy.rs b/src/config/proxy.rs index bf365265..af6df291 100644 --- a/src/config/proxy.rs +++ b/src/config/proxy.rs @@ -10,13 +10,12 @@ use crate::Result; /// ``` /// - Global proxy /// ```toml -/// [global.proxy] +/// [proxy] /// global = { url = "socks5h://localhost:9050" } /// ``` /// - Proxy some domains /// ```toml -/// [global.proxy] -/// [[global.proxy.by_domain]] +/// [[proxy.by_domain]] /// url = "socks5h://localhost:9050" /// include = ["*.onion", "matrix.myspecial.onion"] /// exclude = ["*.myspecial.onion"] diff --git a/src/main.rs b/src/main.rs index bc877d6d..4c1c9427 100644 --- a/src/main.rs +++ b/src/main.rs @@ -111,7 +111,7 @@ async fn try_main() -> Result<(), error::Main> { let args = args::parse(); // Initialize config - let raw_config = Figment::new().merge(Toml::file(&args.config).nested()); + let raw_config = Figment::new().merge(Toml::file(&args.config)); let config = raw_config.extract::()?;