anchor.diff:          ++ (if cfg.automaticMigrations then [ "mastodon-init-db.service" ] else [ "mastodon-init-dirs.service" ]);
         description = "Mastodon streaming";
         wantedBy = [ "multi-user.target" ];
  -      environment = env // {
  -        PORT = toString(cfg.streamingPort);
  -      };
  +      environment = env // (if cfg.enableUnixSocket
  +        then { SOCKET = "/run/mastodon-streaming/streaming.socket"; }
  +        else { PORT = toString(cfg.streamingPort); }
  +      );
         serviceConfig = {
           ExecStart = "${pkgs.nodejs-slim}/bin/node streaming";
           Restart = "always";
  
positive.code:         ++ (if cfg.automaticMigrations then [ "mastodon-init-db.service" ] else [ "mastodon-init-dirs.service" ]);
        description = "Mastodon web";
        wantedBy = [ "multi-user.target" ];
        environment = env // {
          PORT = toString(cfg.webPort);
        };
        serviceConfig = {
          ExecStart = "${cfg.package}/bin/puma -C config/puma.rb";
          Restart = "always";
  
negative.code:         PrivateTmp = true;
          LogsDirectory = "mastodon";
          StateDirectory = "mastodon";
          # Runtime directory and mode
          RuntimeDirectory = "mastodon-web";
          RuntimeDirectoryMode = "0750";
        };
        path = with pkgs; [ file imagemagick ffmpeg ];
      };
  