I have successfully built nvidia modules for both kernels, however, 2.4.26 is easier as the headers are there and ready to use, whereas you need full source for 2.6.5.

http://home.comcast.net/~andrex/Debian-nVidia/

Follow the instructions steb by step, but you could do what I did:-

The part where I differ to the instructions is that I build the module by the debian/rules method.

Save this to a text file (minus the hash lines!) :-
###########################
#!/bin/sh
VER=2.4.26
debian/rules KSRC=/usr/src/kernel-headers-"$VER" KVERS="$VER" kdist_image
###########################
Maybe name it debuild2.4.26. Copy it to /usr/src/modules/nvidia-kernel.
When the time comes to build the package, execute the script with "sh debuild2.4.26" (minus quotes).

cd ..
dpkg -i nvidia-kernel.....

Continue with the authors excellent instructions.