NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.94k stars 13.96k forks source link

Specifying a custom emacs executable for the exwm.nix service #99424

Open leungbk opened 4 years ago

leungbk commented 4 years ago

I'd like a way to be able to specify the Emacs executable used with the EXWM service, like

  services.xserver.windowManager.exwm = { executable = pkgs.emacs26 }

The reason I want this is that I don't want to have to specify the packages by hand; it would be nice if I could write

  services.xserver.windowManager.exwm = {
    executable = emacsWithPackagesFromUsePackage{
      config = ./init.el;
      package = pkgs.emacsGit;
    };
  };

where emacsWithPackagesFromUsePackage is defined in nix-community/emacs-overlay.

The exwm.nix service presently specifies the Emacs executable as exwm-emacs = pkgs.emacsWithPackages packages, where the executable is (I'm guessing) automatically set to the latest stable version and where the packages must be specified by hand.

I don't know the Nix language very well, so it wouldn't surprise me if there already existed a nice way of doing this. But it looks to me like the most straightforward solution is to remove the services.xserver.windowManager.exwm.extraPackages property and ask for the user to specify the packages as part of the executable instead, which should work with or without the emacs-overlay but will be a breaking change to users presently specifying extraPackages and will require the user to specify the exwm Emacs package themselves in either their init.el or their configuration.nix. What do you think, @adisbladis?

leungbk commented 4 years ago

Hmm, from going through the git history, it seems like @puffnfresh is the author of the service.

nixos-discourse commented 3 years ago

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/exwm-use-gccemacs-as-window-manager-override-emacs-binary/10816/3

thomasheartman commented 3 years ago

Hi! I'm the author of the thread (and the post) that mentioned this issue on NixOS Discourse. In short, I was looking for a way to use Gcc Emacs from the Emacs overlay instead of the regular pkgs.emacs. I was advised that it may be a good thing to open a PR for, so I thought I'd go look for similar issues first.

Are there any current plans to do anything with this? @leungbk, did you get anywhere after posting this issue? I thought I'd try and create a derivation that serves this purpose for my own use at least, but would be happy to try and work on a solution that could be brought into nixpkgs instead if that's desirable.

stale[bot] commented 3 years ago

I marked this as stale due to inactivity. → More info

adisbladis commented 3 years ago

I think the correct design for this service would be:

For maximum flexibility and coherence.

stale[bot] commented 2 years ago

I marked this as stale due to inactivity. → More info

spiderbit commented 2 years ago

I don't know why this was never solved or refered to a workaround, it seems a very important problem.

I would like to be able to use xwidgets, which seems to be very useful for exwm, the overlap of emacs users that want to use xwidgets and use exwm is probably 90%.

I would go so far if that is to complicated to just add xwidgets support by default would there be any negative? If you don't use a package that uses xwidgets the routines get not used the only disadvantage would be minimal more compile time and a maybe slightly bigger emacs package?

So to sum it up again because this was not solved in 2 years I am not hopeful it will be fixed in the next days/weeks/months either, but any explanation why exwm not adds the --with-xwidgets compile toggle?