That should work, unless there is something wrong with the values themselves, you can also check the bash profile files nix generates.
Cant say much without seeing the code.
Hmm, which option were you setting? Can you share your configuration.nix (relevant parts)?
Check if the process is actually running
‘ps aux | grep 1635’
(You should see a line output)
More likely its not running and crashed without cleaning up the lock file, you might want to figure out why from logs and whatnot but its ok also to remove that file and try again