From 007cab96448921b45547a6bc85117052cbc2429a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Wed, 5 May 2021 12:30:39 +0200 Subject: [PATCH 1/2] matrix-dendrite: rename to dendrite No other distro calls it matrix-dendrite: https://repology.org/project/matrix-dendrite --- nixos/modules/services/misc/matrix-dendrite.nix | 10 +++++----- pkgs/servers/{matrix-dendrite => dendrite}/default.nix | 0 pkgs/top-level/all-packages.nix | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) rename pkgs/servers/{matrix-dendrite => dendrite}/default.nix (100%) diff --git a/nixos/modules/services/misc/matrix-dendrite.nix b/nixos/modules/services/misc/matrix-dendrite.nix index b719df29c5ab..24051e0b3b47 100644 --- a/nixos/modules/services/misc/matrix-dendrite.nix +++ b/nixos/modules/services/misc/matrix-dendrite.nix @@ -30,7 +30,7 @@ in The path to the TLS certificate. - nix-shell -p matrix-dendrite --command "generate-keys --tls-cert server.crt --tls-key server.key" + nix-shell -p dendrite --command "generate-keys --tls-cert server.crt --tls-key server.key" ''; }; @@ -42,7 +42,7 @@ in The path to the TLS key. - nix-shell -p matrix-dendrite --command "generate-keys --tls-cert server.crt --tls-key server.key" + nix-shell -p dendrite --command "generate-keys --tls-cert server.crt --tls-key server.key" ''; }; @@ -95,7 +95,7 @@ in requests and events. - nix-shell -p matrix-dendrite --command "generate-keys --private-key matrix_key.pem" + nix-shell -p dendrite --command "generate-keys --private-key matrix_key.pem" ''; }; @@ -136,7 +136,7 @@ in message = '' If Dendrite is configured to use https, tlsCert and tlsKey must be provided. - nix-shell -p matrix-dendrite --command "generate-keys --tls-cert server.crt --tls-key server.key" + nix-shell -p dendrite --command "generate-keys --tls-cert server.crt --tls-key server.key" ''; }]; @@ -163,7 +163,7 @@ in ${pkgs.coreutils}/bin/cp ${configurationYaml} /run/matrix-dendrite/dendrite.yaml ''; ExecStart = lib.strings.concatStringsSep " " ([ - "${pkgs.matrix-dendrite}/bin/dendrite-monolith-server" + "${pkgs.dendrite}/bin/dendrite-monolith-server" "--config /run/matrix-dendrite/dendrite.yaml" ] ++ lib.optionals (cfg.httpPort != null) [ "--http-bind-address :${builtins.toString cfg.httpPort}" diff --git a/pkgs/servers/matrix-dendrite/default.nix b/pkgs/servers/dendrite/default.nix similarity index 100% rename from pkgs/servers/matrix-dendrite/default.nix rename to pkgs/servers/dendrite/default.nix diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 18430aaa1218..0767b7f9cba8 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -6113,8 +6113,6 @@ in inherit (darwin.apple_sdk.frameworks) Security; }; - matrix-dendrite = callPackage ../servers/matrix-dendrite { }; - /* Python 3.8 is currently broken with matrix-synapse since `python38Packages.bleach` fails (https://github.com/NixOS/nixpkgs/issues/76093) */ matrix-synapse = callPackage ../servers/matrix-synapse { /*python3 = python38;*/ }; @@ -18582,6 +18580,8 @@ in couchpotato = callPackage ../servers/couchpotato {}; + dendrite = callPackage ../servers/dendrite { }; + dex-oidc = callPackage ../servers/dex { }; dex2jar = callPackage ../development/tools/java/dex2jar { }; From f82c6fdfd5c61b87f5bf19174727fb903e7c6e38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Wed, 5 May 2021 12:34:24 +0200 Subject: [PATCH 2/2] nixos/matrix-dendrite: rename to dendrite --- nixos/modules/module-list.nix | 2 +- .../{matrix-dendrite.nix => dendrite.nix} | 26 +++++++++---------- 2 files changed, 14 insertions(+), 14 deletions(-) rename nixos/modules/services/misc/{matrix-dendrite.nix => dendrite.nix} (88%) diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index 0c0935a7992c..53f0f6e351eb 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -472,6 +472,7 @@ ./services/misc/cgminer.nix ./services/misc/confd.nix ./services/misc/couchpotato.nix + ./services/misc/dendrite.nix ./services/misc/devmon.nix ./services/misc/dictd.nix ./services/misc/duckling.nix @@ -514,7 +515,6 @@ ./services/misc/mame.nix ./services/misc/matrix-appservice-discord.nix ./services/misc/matrix-appservice-irc.nix - ./services/misc/matrix-dendrite.nix ./services/misc/matrix-synapse.nix ./services/misc/mautrix-telegram.nix ./services/misc/mbpfan.nix diff --git a/nixos/modules/services/misc/matrix-dendrite.nix b/nixos/modules/services/misc/dendrite.nix similarity index 88% rename from nixos/modules/services/misc/matrix-dendrite.nix rename to nixos/modules/services/misc/dendrite.nix index 24051e0b3b47..c967fc3a362a 100644 --- a/nixos/modules/services/misc/matrix-dendrite.nix +++ b/nixos/modules/services/misc/dendrite.nix @@ -1,12 +1,12 @@ { config, lib, pkgs, ... }: let - cfg = config.services.matrix-dendrite; + cfg = config.services.dendrite; settingsFormat = pkgs.formats.yaml { }; configurationYaml = settingsFormat.generate "dendrite.yaml" cfg.settings; - workingDir = "/var/lib/matrix-dendrite"; + workingDir = "/var/lib/dendrite"; in { - options.services.matrix-dendrite = { + options.services.dendrite = { enable = lib.mkEnableOption "matrix.org dendrite"; httpPort = lib.mkOption { type = lib.types.nullOr lib.types.port; @@ -24,7 +24,7 @@ in }; tlsCert = lib.mkOption { type = lib.types.nullOr lib.types.path; - example = "/var/lib/matrix-dendrite/server.cert"; + example = "/var/lib/dendrite/server.cert"; default = null; description = '' The path to the TLS certificate. @@ -36,7 +36,7 @@ in }; tlsKey = lib.mkOption { type = lib.types.nullOr lib.types.path; - example = "/var/lib/matrix-dendrite/server.key"; + example = "/var/lib/dendrite/server.key"; default = null; description = '' The path to the TLS key. @@ -48,7 +48,7 @@ in }; environmentFile = lib.mkOption { type = lib.types.nullOr lib.types.path; - example = "/var/lib/matrix-dendrite/registration_secret"; + example = "/var/lib/dendrite/registration_secret"; default = null; description = '' Environment file as defined in @@ -62,7 +62,7 @@ in # snippet of dendrite-related config - services.matrix-dendrite.settings.client_api.registration_shared_secret = "$REGISTRATION_SHARED_SECRET"; + services.dendrite.settings.client_api.registration_shared_secret = "$REGISTRATION_SHARED_SECRET"; @@ -140,7 +140,7 @@ in ''; }]; - systemd.services.matrix-dendrite = { + systemd.services.dendrite = { description = "Dendrite Matrix homeserver"; after = [ "network.target" @@ -149,22 +149,22 @@ in serviceConfig = { Type = "simple"; DynamicUser = true; - StateDirectory = "matrix-dendrite"; + StateDirectory = "dendrite"; WorkingDirectory = workingDir; - RuntimeDirectory = "matrix-dendrite"; + RuntimeDirectory = "dendrite"; RuntimeDirectoryMode = "0700"; EnvironmentFile = lib.mkIf (cfg.environmentFile != null) cfg.environmentFile; ExecStartPre = if (cfg.environmentFile != null) then '' ${pkgs.envsubst}/bin/envsubst \ -i ${configurationYaml} \ - -o /run/matrix-dendrite/dendrite.yaml + -o /run/dendrite/dendrite.yaml '' else '' - ${pkgs.coreutils}/bin/cp ${configurationYaml} /run/matrix-dendrite/dendrite.yaml + ${pkgs.coreutils}/bin/cp ${configurationYaml} /run/dendrite/dendrite.yaml ''; ExecStart = lib.strings.concatStringsSep " " ([ "${pkgs.dendrite}/bin/dendrite-monolith-server" - "--config /run/matrix-dendrite/dendrite.yaml" + "--config /run/dendrite/dendrite.yaml" ] ++ lib.optionals (cfg.httpPort != null) [ "--http-bind-address :${builtins.toString cfg.httpPort}" ] ++ lib.optionals (cfg.httpsPort != null) [