devenv icon indicating copy to clipboard operation
devenv copied to clipboard

No support for emacs?

Open tobiasBora opened this issue 1 year ago • 6 comments

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.

tobiasBora avatar Feb 13 '24 15:02 tobiasBora

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 avatar Feb 13 '24 15:02 thenonameguy

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.

thenonameguy avatar Feb 13 '24 15:02 thenonameguy

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?).

tobiasBora avatar Feb 13 '24 15:02 tobiasBora

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".

thenonameguy avatar Feb 13 '24 15:02 thenonameguy

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.

tobiasBora avatar Feb 13 '24 16:02 tobiasBora

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 😊

schwanberger avatar Mar 10 '24 07:03 schwanberger