  Sliding of two-dimensional materials is critical for their application as
solid lubricants for space, and also relevant for strain engineering and device
fabrication. Dopants such as Ni surprisingly improve lubrication in MoS$_2$,
despite formation of interlayer bonds by intercalated Ni, and the mechanism has
remained unclear. While sliding on the atomistic level has been theoretically
investigated in pristine 2D materials, there has been little work on doped
forms, especially for the complicated case of intercalation. We use density
functional theory to study sliding of Ni-doped MoS$_2$, considering Mo/S
substitution and octahedral/tetrahedral intercalation. We find that bulk and
trilayers are well described by pairwise bilayer interactions. Tetrahedral
intercalation between layers dramatically increases their sliding barrier, but
minimally affects sliding between adjacent undoped layers, thus preserving
effective lubrication. We provide an atomistic view of how sliding occurs in
doped transition-metal dichalcogenides, and a general methodology to analyze
doped sliding.
