I had wasted lots time on it, may be it will help someone.
Some apps can disattach from the service and service will exit killing the app.
Fix is add: RemainAfterExit = true;
systemd.user.services.synology-drive = {
description = "Synology Cloud Sync";
enable = true;
serviceConfig.PassEnvironment = "DISPLAY";
# wantedBy = ["multi-user.target"]; #afer login
wantedBy = ["graphical-session.target"];
partOf = ["graphical-session.target"];
path = [ pkgs.synology-drive-client ];
script = ''
#!/run/current-system/sw/bin/bash
sleep 30
cd ${pkgs.synology-drive-client}/bin && synology-drive
'';
serviceConfig = {
RemainAfterExit = true;
};
};