From 1b342d3402af2ae898acbbee0fe803c63ab7f557 Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Sun, 19 Jan 2025 10:09:49 -0500 Subject: [PATCH] Switch from buildEnv to symlinkJoin to keep dependencies out of the system path. --- nix/configuration/roles/emacs/default.nix | 41 ++++++++++------------- 1 file changed, 17 insertions(+), 24 deletions(-) diff --git a/nix/configuration/roles/emacs/default.nix b/nix/configuration/roles/emacs/default.nix index 3758cfe..dc1911a 100644 --- a/nix/configuration/roles/emacs/default.nix +++ b/nix/configuration/roles/emacs/default.nix @@ -53,32 +53,25 @@ in nixpkgs.overlays = [ (final: prev: { - emacs_full = pkgs.buildEnv { + emacs_full = pkgs.symlinkJoin { name = "emacs_full"; - paths = with prev; [ - emacs29-pgtk - (pkgs.aspellWithDicts ( - dicts: with dicts; [ - en - en-computers + paths = [ pkgs.emacs29-pgtk ]; + buildInputs = [ pkgs.makeWrapper ]; + postBuild = '' + wrapProgram $out/bin/emacs --prefix PATH : ${ + lib.makeBinPath [ + (pkgs.aspellWithDicts ( + dicts: with dicts; [ + en + en-computers + ] + )) + pkgs.nixd # nix language server + pkgs.nixfmt-rfc-style # auto-formatting nix files through nixd + pkgs.clang # To compile tree-sitter grammars ] - )) - nixd # nix language server - nixfmt-rfc-style # auto-formatting nix files through nixd - clang # To compile tree-sitter grammars - ]; - pathsToLink = [ - "/share/man" - "/share/doc" - "/share/info" - "/bin" - "/etc" - ]; - extraOutputsToInstall = [ - "man" - "doc" - "info" - ]; + } + ''; }; }) ];