From c7d930f7c1352f0b66a14bb125db789d5f9202f5 Mon Sep 17 00:00:00 2001 From: Thiago Kenji Okada Date: Tue, 25 Oct 2022 19:26:05 +0100 Subject: [PATCH] Fix doom directories paths --- default.nix | 2 +- patches/fix-doom-dirs-paths.patch | 70 +++++++++++++++++++++++ patches/move-doom-dir-paths-to-HOME.patch | 32 ----------- 3 files changed, 71 insertions(+), 33 deletions(-) create mode 100644 patches/fix-doom-dirs-paths.patch delete mode 100644 patches/move-doom-dir-paths-to-HOME.patch diff --git a/default.nix b/default.nix index ac671f29..7b633b1a 100644 --- a/default.nix +++ b/default.nix @@ -195,7 +195,7 @@ let patches = [ ./patches/early-init.patch - ./patches/move-doom-dir-paths-to-HOME.patch + ./patches/fix-doom-dirs-paths.patch ]; buildPhase = '' diff --git a/patches/fix-doom-dirs-paths.patch b/patches/fix-doom-dirs-paths.patch new file mode 100644 index 00000000..9fe5defd --- /dev/null +++ b/patches/fix-doom-dirs-paths.patch @@ -0,0 +1,70 @@ +diff --git a/lisp/doom.el b/lisp/doom.el +index ce585080f..350741b79 100644 +--- a/lisp/doom.el ++++ b/lisp/doom.el +@@ -220,12 +220,7 @@ These files should not be shared across systems. By default, it is used by + + (define-obsolete-variable-alias 'doom-etc-dir 'doom-data-dir "3.0.0") + (defvar doom-data-dir +- (if doom-profile +- (if IS-WINDOWS +- (expand-file-name "doomemacs/data/" (getenv-internal "APPDATA")) +- (expand-file-name "doom/" (or (getenv-internal "XDG_DATA_HOME") "~/.local/share"))) +- ;; DEPRECATED: .local will be removed entirely in 3.0 +- (file-name-concat doom-local-dir "etc/")) ++ (expand-file-name "doom/" (or (getenv-internal "XDG_DATA_HOME") "~/.local/share")) + "Where Doom stores its global data files. + + Data files contain shared and long-lived data that Doom, Emacs, and their +@@ -239,12 +234,7 @@ generated files for profiles, profiles themselves, autoloads/loaddefs, etc. + For profile-local data files, use `doom-profile-data-dir' instead.") + + (defvar doom-cache-dir +- (if doom-profile +- (if IS-WINDOWS +- (expand-file-name "doomemacs/cache/" (getenv-internal "APPDATA")) +- (expand-file-name "doom/" (or (getenv-internal "XDG_CACHE_HOME") "~/.cache"))) +- ;; DEPRECATED: .local will be removed entirely in 3.0 +- (file-name-concat doom-local-dir "cache/")) ++ (expand-file-name "doom/" (or (getenv-internal "XDG_CACHE_HOME") "~/.cache")) + "Where Doom stores its global cache files. + + Cache files represent non-essential data that shouldn't be problematic when +@@ -258,12 +248,7 @@ session files, ELPA archives, authinfo files, org-persist, etc. + For profile-local cache files, use `doom-profile-cache-dir' instead.") + + (defvar doom-state-dir +- (if doom-profile +- (if IS-WINDOWS +- (expand-file-name "doomemacs/state/" (getenv-internal "APPDATA")) +- (expand-file-name "doom/" (or (getenv-internal "XDG_STATE_HOME") "~/.local/state"))) +- ;; DEPRECATED: .local will be removed entirely in 3.0 +- (file-name-concat doom-local-dir "state/")) ++ (expand-file-name "doom/" (or (getenv-internal "XDG_STATE_HOME") "~/.local/state")) + "Where Doom stores its global state files. + + State files contain non-essential, unportable, but persistent data which, if +@@ -291,7 +276,7 @@ For profile-local state files, use `doom-profile-state-dir' instead.") + "For profile-local state files under `doom-state-dir'.") + + (defconst doom-profile-dir +- (file-name-concat doom-profile-data-dir "@" (cdr doom-profile)) ++ (file-name-concat doom-local-dir "etc" "@" (cdr doom-profile)) + "Where generated files for the active profile are kept.") + + ;; DEPRECATED: Will be moved to cli/env +diff --git a/modules/app/rss/config.el b/modules/app/rss/config.el +index a292f4006..fe3dbfa29 100644 +--- a/modules/app/rss/config.el ++++ b/modules/app/rss/config.el +@@ -20,8 +20,8 @@ easier to scroll through.") + (use-package! elfeed + :commands elfeed + :init +- (setq elfeed-db-directory (concat doom-local-dir "elfeed/db/") +- elfeed-enclosure-default-dir (concat doom-local-dir "elfeed/enclosures/")) ++ (setq elfeed-db-directory (concat doom-cache-dir "elfeed/db/") ++ elfeed-enclosure-default-dir (concat doom-cache-dir "elfeed/enclosures/")) + :config + (setq elfeed-search-filter "@2-week-ago " + elfeed-show-entry-switch #'pop-to-buffer diff --git a/patches/move-doom-dir-paths-to-HOME.patch b/patches/move-doom-dir-paths-to-HOME.patch deleted file mode 100644 index beacb6d9..00000000 --- a/patches/move-doom-dir-paths-to-HOME.patch +++ /dev/null @@ -1,32 +0,0 @@ -diff --git a/lisp/doom.el b/lisp/doom.el -index ce585080f..22b3de707 100644 ---- a/lisp/doom.el -+++ b/lisp/doom.el -@@ -239,12 +239,7 @@ generated files for profiles, profiles themselves, autoloads/loaddefs, etc. - For profile-local data files, use `doom-profile-data-dir' instead.") - - (defvar doom-cache-dir -- (if doom-profile -- (if IS-WINDOWS -- (expand-file-name "doomemacs/cache/" (getenv-internal "APPDATA")) -- (expand-file-name "doom/" (or (getenv-internal "XDG_CACHE_HOME") "~/.cache"))) -- ;; DEPRECATED: .local will be removed entirely in 3.0 -- (file-name-concat doom-local-dir "cache/")) -+ "~/.cache/doom/" - "Where Doom stores its global cache files. - - Cache files represent non-essential data that shouldn't be problematic when -@@ -258,12 +253,7 @@ session files, ELPA archives, authinfo files, org-persist, etc. - For profile-local cache files, use `doom-profile-cache-dir' instead.") - - (defvar doom-state-dir -- (if doom-profile -- (if IS-WINDOWS -- (expand-file-name "doomemacs/state/" (getenv-internal "APPDATA")) -- (expand-file-name "doom/" (or (getenv-internal "XDG_STATE_HOME") "~/.local/state"))) -- ;; DEPRECATED: .local will be removed entirely in 3.0 -- (file-name-concat doom-local-dir "state/")) -+ "~/.local/state/doom/" - "Where Doom stores its global state files. - - State files contain non-essential, unportable, but persistent data which, if