It was not too hard if you are already familiar with Nix. The features supported (and the custom Linux kernel) can be found in surface-linux. For NixOS I used the nix-hardware flake to simplify things.
The worst part was the compilation of the Linux kernel, that took hours on the surface. Eventually, I used the remote nix build feature to compile on a more capable computer.
Maybe I'll write something in the future