I’m also still looking for a solution. But I just found this workaround, however I did not tried it out yet.
Some other links that may help and I need to have a closer look at when i find time to do so:
- NixOS setuid wrapper prevent running sudo in user namespace · Issue #42117 · NixOS/nixpkgs · GitHub (from where the workaround is)
- SUID wrappers do not work in buildFHSUserenv.env · Issue #69338 · NixOS/nixpkgs · GitHub
- buildFHSUserEnv: Create a setuid wrapper · Issue #21387 · NixOS/nixpkgs · GitHub