wip: fix: Fix and refactor emacs-wrapper and Straight.el things

This commit is contained in:
Madeleine Sydney
2025-01-07 04:30:21 -07:00
parent 1262b8049f
commit ae74a9a15a
4 changed files with 31 additions and 6 deletions

View File

@@ -26,16 +26,24 @@ let
overlays = [ emacs-overlay ];
};
straightBaseDir = "${config.xdg.dataHome}/straight";
emacsDataDir = "${config.xdg.dataHome}/emacs";
emacsCacheDir = "${emacsDataDir}/cache";
straightBaseDir = "${emacsDataDir}/straight";
emacsWrapper = pkgs.symlinkJoin {
name = "emacs-wrapper";
paths = [ emacsPackage ];
buildInputs = [ pkgs.makeWrapper ];
nativeBuildInputs = [ pkgs.makeWrapper ];
buildInputs = [
pkgs.git # Dependency of Straight.el.
];
postBuild = ''
for i in $out/bin/emacs-*; do
wrapProgram "$i" \
--add-flags "--init-directory \"${emacsConfigDir}\""
--add-flags "--init-directory \"${emacsConfigDir}\"" \
--set EMACS_STRAIGHT_BASE_DIR "${straightBaseDir}" \
--set EMACS_CACHE_DIR "${emacsCacheDir}" \
--set EMACS_DATA_DIR "${emacsDataDir}"
done
'';
};
@@ -43,7 +51,7 @@ in {
sydnix.impermanence.cache.directories = [ straightBaseDir ];
home.packages = [ emacsWrapper ];
home.sessionVariables.EMACS_STRAIGHT_BASE_DIR = straightBaseDir;
# home.sessionVariables.EMACS_STRAIGHT_BASE_DIR = straightBaseDir;
# programs.emacs = {
# enable = true;