Isolated emacs through shell.nix

Hello, I’m trying to create myself a dev-env-to-go for a project of mine.

Building that dev-env-to-go is to learn more nix while I do so. I could in theory work on the project itself without using nix at all.

Though to build that environment, I’d like to just enter a nix shell and have an emacs available that is bootstrapped with the configuration and package set that I have bootstrapped for that project.

Sadly though, it seems as if the current users config is loaded and used.

Though I’d prefer to really have an isolated emacs just for this project, is this possible and if yes, how?

It is possible, some parts of this configuration need to be done on the Emacs side however.

From the Nix perspective, you can do something like what I do in my emacs/default.nix to launch Emacs with only the configuration you want to specify.

However you still need to make sure that Lisp variables like temporary-file-directory, backup-directory-alist etc. are set to values that match your isolation standards.