config/private: refactor symlink code
This commit is contained in:
parent
0e6540fb8f
commit
8ca4fbd8fe
2 changed files with 10 additions and 14 deletions
|
@ -7,13 +7,9 @@
|
||||||
"The directory that serves as the root of your external private config for
|
"The directory that serves as the root of your external private config for
|
||||||
Doom Emacs.")
|
Doom Emacs.")
|
||||||
|
|
||||||
(defvar +private-modules-path
|
(defvar +private-symlink-path
|
||||||
(expand-file-name "modules/" +private-config-path)
|
(expand-file-name "private" doom-modules-dir)
|
||||||
"The path to your private, external modules. This will be symlinked to
|
"Where the place the symbolic link to the private modules directory.")
|
||||||
external/ in `doom-modules-dir'.")
|
|
||||||
|
|
||||||
(defvar +private-module-prefix "private"
|
|
||||||
"TODO")
|
|
||||||
|
|
||||||
;; Ensure `doom//reload-autoloads', `doom//byte-compile' and
|
;; Ensure `doom//reload-autoloads', `doom//byte-compile' and
|
||||||
;; `doom-initialize-packages' all include this module in their operations.
|
;; `doom-initialize-packages' all include this module in their operations.
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
;; -*- no-byte-compile: t; -*-
|
;; -*- no-byte-compile: t; -*-
|
||||||
;;; config/private/packages.el
|
;;; config/private/packages.el
|
||||||
|
|
||||||
(when (file-directory-p +private-modules-path)
|
(let ((modules-path (expand-file-name "modules/" +private-config-path)))
|
||||||
;; automatically symlinks your private modules to `doom-modules-dir'.
|
(when (file-directory-p modules-path)
|
||||||
(let ((symlink (expand-file-name +private-module-prefix doom-modules-dir)))
|
;; automatically symlinks your private modules to `doom-modules-dir'.
|
||||||
(if (and (file-directory-p symlink)
|
(if (and (file-directory-p +private-symlink-path)
|
||||||
(not (file-symlink-p symlink)))
|
(not (file-symlink-p +private-symlink-path)))
|
||||||
(lwarn "config/private" :warning
|
(lwarn "config/private" :warning
|
||||||
"modules/%s already exists; can't create symlink" +private-module-prefix)
|
"modules/%s already exists; can't create symlink" +private-symlink-path)
|
||||||
(make-symbolic-link +private-modules-path symlink t))))
|
(make-symbolic-link modules-path +private-symlink-path t))))
|
||||||
|
|
||||||
;;
|
;;
|
||||||
(load (expand-file-name "packages.el" +private-config-path)
|
(load (expand-file-name "packages.el" +private-config-path)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue