We present particle-in-cell (PIC) simulations of electron bunches with nm scale longitudinal modulation produced using a compact 2-20 MeV LINAC. The modulation is initially imparted in the transverse dimension of the electron bunch with a nano-patterned photo-emitter in an X-band RF gun with 2 MeV exit energy. The electron bunch passes through a 1 m standing wave X-band LINAC which can raise the beam energy up to 20 MeV. The transverse modulation is exchanged into the longitudinal dimension using a double dog-leg emittance exchange setup with a 5 cell RF deflector cavity. The modulation pitch can be tuned by adjusting the spacing of the nano-patterned photo-emitter or magnification of the transverse pitch with electron optics. The electron beam parameters are optimized to produce coherent XFEL radiation upon interacting with a laser undu-lator.