Nixos, gnome3, autostart entries get deleted at reboot

If I create a new .desktop file in ~/.config/autostart it works after reboot (program starts automatically) but the .desktop file gets deleted somehow, also. Since I am a first time nixos user I am probably doing something completely wrong here. How can I get a persistent autostart configuration with gnome3 in nixos?

It was an application specific problem: only megasync shows this strange behavior, seems it deletes its own megasync.desktop file, probably because it wants to use some other kind of autostart mechanism which is not supported by nixos. There is a “Start on Startup” megasync option which also does not work.

services.xserver.displayManager.sessionCommands = “(sleep 10; megasync) &\n”;