I’d like to know if derivatives in glsl are working on GL_LINES primitives.
AFAIK OpenGL implementations perform a discrete approximation on a group of 4 pixels (2×2 pixel quad) to compute derivative.
Could it be possible to make them work on 1 pixel width lines?
Yes, mipmapping and derivatives work on line primitives.