Automatic login via configuration.nix

Can I get a configuration.nix set up so it logs me automatically into e.g. firefox / google , so I am in my firefox account and connected to googledrive immediately in gnome even when I run a re-installation from scratch and use the configuration.nix from backup containing automated logon instructions ? I realise that storing passwords in the configuration.nix is a no-go - but are there any ways of doing this : a fresh install with my on-line accounts (as they appear in gnome) and firefox all set up of their own accord ?

It’s not only password; it’s OAuth Authorization Code Grant Flow involved here, so you would need to automate that flow, which is not trivial. Google does not have OAuth Client Credentials Grant Flow.

To automate that flow, you’d need an End-to-end testing framework. There are some articles on doing this on the Winternet.