cachix / devenv

Fast, Declarative, Reproducible, and Composable Developer Environments
https://devenv.sh
Apache License 2.0
3.98k stars 296 forks source link

No support for emacs? #977

Open tobiasBora opened 6 months ago

tobiasBora commented 6 months ago

It would be great to add support for emacs, allowing us to install emacs with a list of packages etc. Not sure if I just missed something obvious or not.

thenonameguy commented 6 months ago

Emacs support is handled via direnv integration. https://docs.doomemacs.org/v21.12/modules/tools/direnv/

  1. Emacs loads .envrc via direnv
  2. Direnv loads devenv.nix script and runs use devenv
  3. Emacs sees the updated env vars (PATH, etc.)
thenonameguy commented 6 months ago

This is true for all other editors as well, for future reference. This is why no explicit support is needed, direnv is the common interface.

tobiasBora commented 6 months ago

I mean, I want to provide a nix-shell where emacs is installed with some pre-configured packages. As far as I understand, what you describe here is a setting where emacs is already installed and we want to load the configuration from devenv inside (actually, I guess in that case the host-installed emacs will not pick extension from the devenv file?).

thenonameguy commented 6 months ago

Ah, sorry I misunderstood.

That's an interesting and novel idea! Usually people have their editors setup on their "host" and use devenv for the project-specific dependencies. For this reason what you seek is done usually on the NixOS/home-manager level.

Those module systems already handle what you seek. It shouldn't be too tough of an effort to port it from there, especially from home-manager.

As a more general implementation, it would be interesting to support home-manager's module system and transpile it to DEVENV_PROFILE folder.

This way we could get vim/neovim/emacs/etc. for "free".

tobiasBora commented 6 months ago

Yeah that would be really cool. To be honest, I already have a home manager module doing that, and I precisely wanted to find a way to use directly the home manager module in a flake-like setting to both share the home-manager module for people that want to add plugins to an existing home manager install, or directly to spawn a shell with emacs installed for others.

schwanberger commented 5 months ago

It would be awesome to include hm modules in a non disruptive way for the host. +1

I’ve found this https://discourse.nixos.org/t/home-manager-shell-nix-shell-for-your-home-manager-config/24632

Where proot is used to achieve the “non disruptiveness” and could be used for inspiration or even adoption 😊