An inverter may be created with a B source (manual chapter 5.1 Bxxxx: Nonlinear dependent source (ASRC)) and a ternary equation: Binv1 out 0 V = (v(in) > 2.5) ? 0 : 5
where the ports are in, 0 and out, 0. You may change 5 and 5/2=2.5 according to your needs.
At the moment I’m looking into: 74HC04BQ - Hex inverter | Nexperia which has both spice and ibis models for the hc family, and getting such models to work is on my todo list too.
It would be nice if there was more overlap between the ngSpice manual and the Simulation_SPICE lib in KiCad. As mentioned earlier, the ngspice manual does not mention ESOURCE, and the KiCad library does not have VCVS. It is one of those gazillion things that all add up and make getting started with ngSpice very frustrating for beginners.