From a81b7706c05e82d61afc51aa8ce119a00c272899 Mon Sep 17 00:00:00 2001 From: Madeleine Sydney Date: Wed, 16 Apr 2025 17:12:16 -0600 Subject: [PATCH] refactor(emacs): use lib.makeBinPath --- modules/home/users/crumb/emacs.nix | 41 ++++++++++++++---------------- 1 file changed, 19 insertions(+), 22 deletions(-) diff --git a/modules/home/users/crumb/emacs.nix b/modules/home/users/crumb/emacs.nix index b7d20e4..54bc89e 100755 --- a/modules/home/users/crumb/emacs.nix +++ b/modules/home/users/crumb/emacs.nix @@ -62,28 +62,25 @@ in { name = "sydmacs"; paths = [ ewp ]; nativeBuildInputs = [ pkgs.makeWrapper ]; - buildInputs = [ - pkgs.git # Dependency of Straight.el. - my-aspell - pkgs.direnv - pkgs.ghostscript # For TeX. - ]; - postBuild = '' - find "$out/bin" -name emacs -or -name "emacs-*" \ - | while IFS= read -r emacs; do - echo "emacs: $emacs" - wrapProgram "$emacs" \ - --add-flags "--init-directory \"${emacsConfigDir}\"" \ - --set EMACS_STRAIGHT_BASE_DIR "${straightBaseDir}" \ - --set EMACS_CACHE_DIR "${emacsCacheDir}" \ - --set EMACS_DATA_DIR "${emacsDataDir}" \ - --prefix PATH : "${pkgs.git}/bin" \ - --prefix PATH : "${my-aspell}/bin" \ - --prefix PATH : "${pkgs.direnv}/bin" \ - --prefix PATH : "${my-tex}/bin" \ - --prefix PATH : "${pkgs.unzip}/bin" \ - --set ASPELL_CONF "dict-dir ${my-aspell}/lib/aspell" - done + postBuild = + let runtime-binaries = [ + my-aspell + pkgs.git # Dependency of Straight.el. + pkgs.ghostscript # For TeX. + my-tex + pkgs.unzip # For jump-to-source. + ]; + in '' + find "$out/bin" -name emacs -or -name "emacs-*" \ + | while IFS= read -r emacs; do + wrapProgram "$emacs" \ + --add-flags "--init-directory \"${emacsConfigDir}\"" \ + --set EMACS_STRAIGHT_BASE_DIR "${straightBaseDir}" \ + --set EMACS_CACHE_DIR "${emacsCacheDir}" \ + --set EMACS_DATA_DIR "${emacsDataDir}" \ + --set ASPELL_CONF "dict-dir ${my-aspell}/lib/aspell" \ + --prefix PATH : "${lib.makeBinPath runtime-binaries}" + done ''; meta = emacsBasePackage.meta; version = emacsBasePackage.version;