diff options
author | pacien <pacien.trangirard@pacien.net> | 2022-11-16 22:20:01 +0100 |
---|---|---|
committer | Winter <winter@winter.cafe> | 2022-11-21 08:46:52 -0500 |
commit | e14bdbb997707333de2114c56ab0fe764dbe9ca7 (patch) | |
tree | 5a5af6ed5b71a730bc5b72cbf7604f549ded4264 /nixos | |
parent | 4a8f6ceb6650d818d893a86d2216beea0cd2f0d1 (diff) |
Revert "nixos/mautrix-telegram: substitute secrets in config file at runtime (#112966)"
This is no longer necessary since mautrix-telegram v0.12.1, which supports JSON-formatted environment variable and therefore maps natively. See: https://github.com/mautrix/telegram/issues/584#issuecomment-1250027272 See: https://github.com/mautrix/telegram/releases/tag/v0.12.1 This partially reverts commit 24133ead28dc4ece7ba016bc8f7624db0478e977.
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/modules/services/matrix/mautrix-telegram.nix | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/nixos/modules/services/matrix/mautrix-telegram.nix b/nixos/modules/services/matrix/mautrix-telegram.nix index 0611f21367be6..544e9d10c3615 100644 --- a/nixos/modules/services/matrix/mautrix-telegram.nix +++ b/nixos/modules/services/matrix/mautrix-telegram.nix @@ -7,8 +7,8 @@ let registrationFile = "${dataDir}/telegram-registration.yaml"; cfg = config.services.mautrix-telegram; settingsFormat = pkgs.formats.json {}; - settingsFileUnsubstituted = settingsFormat.generate "mautrix-telegram-config-unsubstituted.json" cfg.settings; - settingsFile = "${dataDir}/config.json"; + settingsFile = + settingsFormat.generate "mautrix-telegram-config.json" cfg.settings; in { options = { @@ -147,16 +147,6 @@ in { environment.HOME = dataDir; preStart = '' - # Not all secrets can be passed as environment variable (yet) - # https://github.com/tulir/mautrix-telegram/issues/584 - [ -f ${settingsFile} ] && rm -f ${settingsFile} - old_umask=$(umask) - umask 0177 - ${pkgs.envsubst}/bin/envsubst \ - -o ${settingsFile} \ - -i ${settingsFileUnsubstituted} - umask $old_umask - # generate the appservice's registration file if absent if [ ! -f '${registrationFile}' ]; then ${pkgs.mautrix-telegram}/bin/mautrix-telegram \ @@ -192,8 +182,6 @@ in { --config='${settingsFile}' ''; }; - - restartTriggers = [ settingsFileUnsubstituted ]; }; }; |