wip: fix: Fix and refactor emacs-wrapper and Straight.el things
This commit is contained in:
@@ -350,6 +350,12 @@ Remove a given host from =~/.ssh/known_hosts=. Something like =sed -i -e '/192.1
|
|||||||
|
|
||||||
Create a new tempdir called ~[NAME]~, and cd into it.
|
Create a new tempdir called ~[NAME]~, and cd into it.
|
||||||
|
|
||||||
|
*** TODO =doctor=
|
||||||
|
|
||||||
|
Run various checks on the system.
|
||||||
|
|
||||||
|
- Sizes of caches. perhaps those listed by ~sydnix.impermanence.cache.{files,directories}~? Offer to clean them if they're getting old.
|
||||||
|
|
||||||
* References
|
* References
|
||||||
|
|
||||||
Following is a subset of the many places I've learnt from.
|
Following is a subset of the many places I've learnt from.
|
||||||
|
|||||||
@@ -26,16 +26,24 @@ let
|
|||||||
overlays = [ emacs-overlay ];
|
overlays = [ emacs-overlay ];
|
||||||
};
|
};
|
||||||
|
|
||||||
straightBaseDir = "${config.xdg.dataHome}/straight";
|
emacsDataDir = "${config.xdg.dataHome}/emacs";
|
||||||
|
emacsCacheDir = "${emacsDataDir}/cache";
|
||||||
|
straightBaseDir = "${emacsDataDir}/straight";
|
||||||
|
|
||||||
emacsWrapper = pkgs.symlinkJoin {
|
emacsWrapper = pkgs.symlinkJoin {
|
||||||
name = "emacs-wrapper";
|
name = "emacs-wrapper";
|
||||||
paths = [ emacsPackage ];
|
paths = [ emacsPackage ];
|
||||||
buildInputs = [ pkgs.makeWrapper ];
|
nativeBuildInputs = [ pkgs.makeWrapper ];
|
||||||
|
buildInputs = [
|
||||||
|
pkgs.git # Dependency of Straight.el.
|
||||||
|
];
|
||||||
postBuild = ''
|
postBuild = ''
|
||||||
for i in $out/bin/emacs-*; do
|
for i in $out/bin/emacs-*; do
|
||||||
wrapProgram "$i" \
|
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
|
done
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
@@ -43,7 +51,7 @@ in {
|
|||||||
sydnix.impermanence.cache.directories = [ straightBaseDir ];
|
sydnix.impermanence.cache.directories = [ straightBaseDir ];
|
||||||
home.packages = [ emacsWrapper ];
|
home.packages = [ emacsWrapper ];
|
||||||
|
|
||||||
home.sessionVariables.EMACS_STRAIGHT_BASE_DIR = straightBaseDir;
|
# home.sessionVariables.EMACS_STRAIGHT_BASE_DIR = straightBaseDir;
|
||||||
|
|
||||||
# programs.emacs = {
|
# programs.emacs = {
|
||||||
# enable = true;
|
# enable = true;
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
(let ((bootstrap-file
|
(let ((bootstrap-file
|
||||||
(file-name-concat straight-base-dir
|
(file-name-concat straight-base-dir
|
||||||
"repos/straight.el/bootstrap.el"))
|
"straight/repos/straight.el/bootstrap.el"))
|
||||||
(bootstrap-version 7))
|
(bootstrap-version 7))
|
||||||
(unless (file-exists-p bootstrap-file)
|
(unless (file-exists-p bootstrap-file)
|
||||||
(let* ((url "https://raw.githubusercontent.com/radian-software/straight.el/develop/install.el")
|
(let* ((url "https://raw.githubusercontent.com/radian-software/straight.el/develop/install.el")
|
||||||
@@ -19,6 +19,8 @@
|
|||||||
(with-current-buffer url-buffer
|
(with-current-buffer url-buffer
|
||||||
(goto-char (point-max))
|
(goto-char (point-max))
|
||||||
(eval-print-last-sexp))))
|
(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))
|
(setq straight-use-package-by-default t))
|
||||||
|
|||||||
@@ -2,4 +2,13 @@
|
|||||||
|
|
||||||
;; (eval-when-compile (require 'cl-lib))
|
;; (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)
|
(provide 'syd-prelude)
|
||||||
|
|||||||
Reference in New Issue
Block a user