I like using Nix shell for this as well. All of my projects specify their dependencies (compiler, formatter, lsp, etc) there, and with direnv-mode it means I can run Emacs from anywhere and when opening a project with a nix shell specified it automatically picks up everything. It's really neat.
This sounds really cool. Do you have any recommended resources for this?
I pretty much just tried a bunch of different things until they worked, so I don't have anything to link just yet. I'll make a post on my blog (https://leite.dev) about it tonight and reply again with the link once it's live.
[0] https://github.com/nix-community/home-manager
[1] https://github.com/siraben/dotfiles/blob/bad2e8a29b6622e10bc...