Override #define statements in libraries
You're allowed to modify the header file.  The version I looked at says

#define USE_SOFTWARE_SERIAL //Comment this line for use  HardwareSerial


...but I think he meant "comment this line out to use HardwareSerial".  Or conversely, "uncomment this line to use SoftwareSerial."

Then you just pass your SoftwareSerial instance into the Nextion constructor:

SoftwareSerial HMI( 8,9 );
Nextion nextion( HMI );

void setup()
{
   HMI.begin( 9600 ); // or whatever speed...


However, because you are using pins 8 &amp; 9, I would strongly recommend using AltSoftSerial instead.  It is much more reliable and efficient.  MUCH.

You would have to modify the Nextion files to either (1) search and replace all occurrences of SoftwareSerial with AltSoftSerial, or (2) add a third choice to the author's #ifdef/#endif sections.  For example:

#define USE_SOFTWARE_SERIAL // uncomment this line to use SoftwareSerial
#define USE_ALTSOFT_SERIAL  // uncomment this line to use AltSoftSerial
                            // comment both above  to use HardwareSerial

#if defined(USE_SOFTWARE_SERIAL)
#include &lt;SoftwareSerial.h&gt;
#elsif definied(USE_ALT_SOFTSERIAL)
#include &lt;AltSoftSerial.h&gt;
#endif

class Nextion{
 private:
  void flushSerial();
#if defined(USE_SOFTWARE_SERIAL)
  SoftwareSerial *nextion;
#elsif defined(USE_ALTSOFT_SERIAL)
  AltSoftSerial *nextion;
#else
  HardwareSerial *nextion;
#endif


Do either one of those things in all files that refer to the Nextion serial member; Nextion.CPP certainly needs it.