diff --git a/README.org b/README.org index 63c892b..cd41edc 100755 --- a/README.org +++ b/README.org @@ -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. +*** 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 Following is a subset of the many places I've learnt from. diff --git a/users/crumb/programs/emacs.nix b/users/crumb/programs/emacs.nix index 15525eb..dbad0f2 100644 --- a/users/crumb/programs/emacs.nix +++ b/users/crumb/programs/emacs.nix @@ -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; diff --git a/users/crumb/programs/emacs/init-straight.el b/users/crumb/programs/emacs/init-straight.el index 512f21f..124e8cc 100644 --- a/users/crumb/programs/emacs/init-straight.el +++ b/users/crumb/programs/emacs/init-straight.el @@ -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)) diff --git a/users/crumb/programs/emacs/lib/syd-prelude.el b/users/crumb/programs/emacs/lib/syd-prelude.el index 52cb4b0..716dbe7 100644 --- a/users/crumb/programs/emacs/lib/syd-prelude.el +++ b/users/crumb/programs/emacs/lib/syd-prelude.el @@ -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)