wip: fix: Fix and refactor emacs-wrapper and Straight.el things
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
(let ((bootstrap-file
|
||||
(file-name-concat straight-base-dir
|
||||
"repos/straight.el/bootstrap.el"))
|
||||
"straight/repos/straight.el/bootstrap.el"))
|
||||
(bootstrap-version 7))
|
||||
(unless (file-exists-p bootstrap-file)
|
||||
(let* ((url "https://raw.githubusercontent.com/radian-software/straight.el/develop/install.el")
|
||||
@@ -19,6 +19,8 @@
|
||||
(with-current-buffer url-buffer
|
||||
(goto-char (point-max))
|
||||
(eval-print-last-sexp))))
|
||||
(load bootstrap-file nil 'nomessage))
|
||||
(load-file bootstrap-file)
|
||||
;; (load bootstrap-file nil 'nomessage)
|
||||
)
|
||||
|
||||
(setq straight-use-package-by-default t))
|
||||
|
||||
@@ -2,4 +2,13 @@
|
||||
|
||||
;; (eval-when-compile (require 'cl-lib))
|
||||
|
||||
(defvar syd-data-dir
|
||||
(or (getenv "EMACS_DATA_DIR")
|
||||
(error "Need $EMACS_DATA_DIR"))
|
||||
"Directory analogous to XDG_DATA_HOME for miscellaneous Emacs things.")
|
||||
|
||||
(defvar syd-cache-dir
|
||||
(or (getenv "EMACS_CACHE_DIR")
|
||||
(error "Need $EMACS_CACHE_DIR")))
|
||||
|
||||
(provide 'syd-prelude)
|
||||
|
||||
Reference in New Issue
Block a user