summary refs log tree commit diff stats
path: root/user
diff options
context:
space:
mode:
authorAlan Pearce2020-08-26 14:02:23 +0200
committerAlan Pearce2020-08-26 14:03:50 +0200
commit3937dbd373054643862bed55e11280d2f34b6eeb (patch)
tree12c19cb7f134d7564107024c3cde68fe887f35e5 /user
parent0f6a0e57504c07aa9f93f6d23a56555341ee5124 (diff)
downloadnixfiles-3937dbd373054643862bed55e11280d2f34b6eeb.tar.lz
nixfiles-3937dbd373054643862bed55e11280d2f34b6eeb.tar.zst
nixfiles-3937dbd373054643862bed55e11280d2f34b6eeb.zip
BC! Emacs: move config to XDG config dir
Diffstat (limited to 'user')
-rw-r--r--user/emacs/init.el5
-rw-r--r--user/modules/eshell.nix2
-rw-r--r--user/settings/emacs.nix4
3 files changed, 6 insertions, 5 deletions
diff --git a/user/emacs/init.el b/user/emacs/init.el
index a3dd37e1..d5396f75 100644
--- a/user/emacs/init.el
+++ b/user/emacs/init.el
@@ -49,7 +49,7 @@
 
 ;;; Customize
 
-(setq custom-file "~/.emacs.d/custom.el")
+(setq custom-file (expand-file-name "custom.el" user-emacs-directory))
 (load custom-file :noerror :nomessage)
 
 (use-package crux
@@ -576,7 +576,8 @@ _p_rev       _u_pper              _=_: upper/lower       _r_esolve
 ;; I like to keep my backups out of regular folders.  I tell emacs to use
 ;; a subfolder of its configuration directory for that.  Also, use the
 ;; trash for deleting on OS X.
-(let ((backup-dir (expand-file-name "~/.emacs.d/backups/")))
+(let ((backup-dir (expand-file-name "emacs" (or (getenv "XDG_DATA_HOME")
+                                                "~/.local/share"))))
   (unless (file-directory-p backup-dir)
     (make-directory backup-dir))
   (setq backup-directory-alist `((".*" . ,backup-dir))
diff --git a/user/modules/eshell.nix b/user/modules/eshell.nix
index c4fc366f..eaa4a206 100644
--- a/user/modules/eshell.nix
+++ b/user/modules/eshell.nix
@@ -20,7 +20,7 @@ in {
   };
 
   config = mkIf cfg.enable {
-    home.file.".emacs.d/eshell/alias" = {
+    xdg.configFile."emacs/eshell/alias" = {
       recursive = true;
       text = concatStringsSep "\n" (mapAttrsToList (k: v: "alias ${k} ${v}") cfg.eshell.aliases);
     };
diff --git a/user/settings/emacs.nix b/user/settings/emacs.nix
index 543a17cc..1ce4fc23 100644
--- a/user/settings/emacs.nix
+++ b/user/settings/emacs.nix
@@ -189,10 +189,10 @@ in
   home.sessionVariables = {
     EDITOR = "${editorScript}/bin/edit";
   };
-  home.file.".emacs.d/init.el" = {
+  xdg.configFile."emacs/init.el" = {
     source = ../emacs/init.el;
     onChange = ''
-      ${config.programs.emacs.finalPackage}/bin/emacs -Q -batch -f batch-byte-compile .emacs.d/init.el
+      ${config.programs.emacs.finalPackage}/bin/emacs -Q -batch -f batch-byte-compile .config/emacs/init.el
     '';
   };