!ZmUSesoOjmVsKbzFbp:nixos.org

Nix Emacs

784 Members
All things Nix/Emacs! https://github.com/nix-community/emacs-overlay | For Doom Emacs: https://matrix.to/#/#doom-emacs:nixos.org176 Servers

Load older messages


SenderMessageTime
14 Jan 2025
@nbp:mozilla.orgnbp

Julien: I am still using spacemacs, but I am migrating to a hand made config based home manager to provide all packages and symlink the *.el files at the proper locations and rely on use-package to load and configure packages in my init.el. I also generate a pkgs.el in home manager to carry path to external programs, the gist of it is:

{pkgs, ...}: {
  home.file.".emacs.d/init.el".source = ./init.el;
  home.file.".emacs.d/pkgs.el".text = ''
    (setq pkgs-clang-tools "${pkgs.clang-tools}")
  '';
  programs.emacs = {
    enable = true;
    extraPackages = epkgs: with epkgs; [ ... ];
  };
}
18:50:34
@cor:goblin.shcor changed their profile picture.20:20:51
@cor:goblin.shcor changed their profile picture.20:23:31
16 Jan 2025
@amadaluzia:tchncs.deamadaluzia joined the room.01:11:15
18 Jan 2025
@peterzky:matrix.orgpeterzky joined the room.02:42:47
@stephen:crabsin.spaceStephen D Do people use emacs client/daemon with nix? One practical issue I've run into is I might want to spawn an emacs from within my nix develop environment, which doesn't work with the daemon 05:14:29
@stephen:crabsin.spaceStephen Dso right now I'm using a mixture of emacsclient and normal emacs depending on if I can get away with the former or not05:14:42
@slot-:matrix.orgSolid Stephen D: envrc is generally pretty good at keeping up with changing environments 06:36:10
@d:arcticfoxes.net@d:arcticfoxes.net joined the room.13:56:59
@d:arcticfoxes.net@d:arcticfoxes.net left the room.13:57:05
@stephen:crabsin.spaceStephen D
In reply to @slot-:matrix.org
Stephen D: envrc is generally pretty good at keeping up with changing environments
Right but that won't propagate it onto the emacs daemon will it?
14:01:44
@stephen:crabsin.spaceStephen DBecause that's where problems arise14:01:55
@antifuchs:asf.computerantifuchsThe envrc emacs package should! It runs inside emacs after all (so, inside the server)15:22:11
@antifuchs:asf.computerantifuchsAh, but if I read your question right, you want the development shell in your terminal to have emacsclient connect to the right server?15:22:56
@stephen:crabsin.spaceStephen DYeah exactly15:23:08
@stephen:crabsin.spaceStephen D Maybe I'll provide an example to make the problem less abstract. Say I am working on some rust project that requires some C bindings to be installed. Because I use LSP, I need emacs to run in the environment with those C bindings, otherwise compilation (within my LSP server) will fail. This is fine when I use emacs inside of that env but using emacsclient doesn't work, presumably because the LSP is running under the emacs daemon 15:24:29
@antifuchs:asf.computerantifuchsAh, yep, in that case definitely check out envrc-mode also!16:27:42
@stephen:crabsin.spaceStephen DI don't understand how envrc-mode helps? The server will still be running in the wrong context, won't it?16:29:53
@antifuchs:asf.computerantifuchsIt will set up the correct execution environment for processes spawned by lsp-mode (and generally in your project); that tends to be sufficient for getting a nix devshell’s env into dev tools16:33:23
@joaomoreira:matrix.orgJoão Moreira joined the room.16:35:36
@starlit:crossbach.destarlit
In reply to @rczb:envs.net
I just found that it is nil rather than Eglot that blocks the initialization of a Nix buffer. nixd takes almost no time to startup.
hm nixd is fast but it uses too much memory... linux oom killed it sometimes
18:28:04
@starlit:crossbach.destarlitlikely a memory leaking bug somethin18:29:00
@stephen:crabsin.spaceStephen D
In reply to @antifuchs:asf.computer
It will set up the correct execution environment for processes spawned by lsp-mode (and generally in your project); that tends to be sufficient for getting a nix devshell’s env into dev tools
But aren't those executed under the daemon?
18:31:37
@stephen:crabsin.spaceStephen D If I do nix develop and then emacsclient lsp-mode doesn't have the context of nix develop. Does envrc change this? 18:32:03
@antifuchs:asf.computerantifuchscorrect, it'll be the emacs daemon executing the commands. That's why envrc-mode sets environment variables like PATH on the commands executed by the daemon, according to the direnv settings for the project you're working on. that is, it doesn't matter if you launch emacsclient from the nix shell or not - what matters is that emacs (daemon or not) knows the environment for the project you're working on.20:47:23
@antifuchs:asf.computerantifuchsif you launch emacs from the commandline with the shell active, that's trivially the case: the environment gets inherited by emacs. but then you can only effectively work on that project20:47:54
@antifuchs:asf.computerantifuchs with envrc-mode, you can work on multiple project and they'll all have the nix shell active inside emacs, depending on what project's buffer you have open 20:48:26
@ge24z009:matrix.orgge24z009

Hi, I build this overlay for Emacs builds with the new concurrent/incremental garbage collector (branch: feature/igc).
https://github.com/naveen-seth/emacs-igc-overlay

Mostly meant for personal use and I will try creating a pull request to the official community overlay once I get the time. I am not sure how I can keep my newly defined derivation inputs inside of their mkGitEmacs function though.

21:12:07
@stephen:crabsin.spaceStephen D
In reply to @antifuchs:asf.computer
with envrc-mode, you can work on multiple project and they'll all have the nix shell active inside emacs, depending on what project's buffer you have open
hmm okay. sounds like it will work then
21:13:14
@stephen:crabsin.spaceStephen Dty!21:13:15

Show newer messages


Back to Room ListRoom Version: 6