Input-output formalism for few-photon transport in one-dimensional nanophotonic waveguides coupled to a qubit | Synapse