Yes, the 'guix environment' tool is like a language-agnostic virtualenv. Guix does not use or interfere with any components from the host distro, so you can install Guix on top of Arch Linux without fear. We have a binary installation method[0] that isn't too difficult that you can try out. I use Guix on top of an Ubuntu host at work.
For your PostgreSQL example, you'd still need to do things like initialize the DB cluster and start the daemon on your own (the GuixSD distro has a system service for this[1]), but to spawn a shell with the postgres daemon and client programs available you would run:
guix environment --ad-hoc postgresql
Exiting the sub-shell would do essentially what you had in mind with 'guix deactivate': Make postgresql available for garbage collection (via 'guix gc') if/when nothing else is using it.
The point was to install the deps into my project tree, instead of putting everything into /gnu, but to think of it that's not actually much of a problem, it's just personal preference/bikeshedding.
"Installing" a package with Guix really just means that it is referenced through a link. /gnu is just a cache for "evaluated" package recipes. You could create a profile that contains your symlinks to the items in the store wherever you want, including the currenty directory.
guix package -p $(pwd)/.guix-profile -i what ever you want
Programmes in this profile can then be executed like so:
./.guix-profile/bin/what
But that's not necessary when you could just use `guix environment` and enter a shell where everything is already hooked up.
For your PostgreSQL example, you'd still need to do things like initialize the DB cluster and start the daemon on your own (the GuixSD distro has a system service for this[1]), but to spawn a shell with the postgres daemon and client programs available you would run:
Exiting the sub-shell would do essentially what you had in mind with 'guix deactivate': Make postgresql available for garbage collection (via 'guix gc') if/when nothing else is using it.[0] https://gnu.org/software/guix/manual/html_node/Binary-Instal...
[1] https://gnu.org/software/guix/manual/html_node/Database-Serv...