anchor.diff:    dataDir = "/var/lib/mautrix-telegram";
     registrationFile = "${dataDir}/telegram-registration.yaml";
     cfg = config.services.mautrix-telegram;
  -  # TODO: switch to configGen.json once RFC42 is implemented
  -  settingsFile = pkgs.writeText "mautrix-telegram-settings.json" (builtins.toJSON cfg.settings);
  +  settingsFormat = pkgs.formats.json {};
  +  settingsFileUnsubstituted = settingsFormat.generate "mautrix-telegram-config-unsubstituted.json" cfg.settings;
  +  settingsFile = "${dataDir}/config.json";
   
   in {
     options = {
  
positive.code:       enable = mkEnableOption "Mautrix-Telegram, a Matrix-Telegram hybrid puppeting/relaybot bridge";
  
        settings = mkOption rec {
          # TODO: switch to types.config.json as prescribed by RFC42 once it's implemented
          type = types.attrs;
          apply = recursiveUpdate default;
          default = {
            appservice = rec {
              database = "sqlite:///${dataDir}/mautrix-telegram.db";
  
negative.code:             --config='${settingsFile}'
          '';
        };
  
        restartTriggers = [ settingsFileUnsubstituted ];
      };
    };
  
  