anchor.diff:        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;
  +        inherit (settingsFormat) type;
           default = {
             appservice = rec {
               database = "sqlite:///${dataDir}/mautrix-telegram.db";
  
positive.code:       after = [ "network-online.target" ] ++ cfg.serviceDependencies;
  
        preStart = ''
          # generate the appservice's registration file if absent
          if [ ! -f '${registrationFile}' ]; then
            ${pkgs.mautrix-telegram}/bin/mautrix-telegram \
  
negative.code:             --config='${settingsFile}'
          '';
        };
  
        restartTriggers = [ settingsFileUnsubstituted ];
      };
    };
  
  