-
Notifications
You must be signed in to change notification settings - Fork 2
/
init.el
65 lines (54 loc) · 1.97 KB
/
init.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
;; Preflight checks
(when (version< emacs-version "28")
(error "Emacs version is too old for this config."))
;; Raise GC threshold to 32MB
(setq gc-cons-threshold (* 1024 1024 32))
;; Determine if we're in Guix OS or not
(defvar bsb/guix-system-p
(and (eq system-type 'gnu/linux)
(file-directory-p "/gnu/store")))
;; Add MELPA and a nice place outside the config for packages to live
(require 'package)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
(setq package-user-dir "~/.cache/emacs/packages")
(setq package-gnupghome-dir "~/.cache/emacs/gnupg")
(package-initialize)
;; Use-package is a vast improvement over the old fashioned ways.
(unless (require 'use-package nil t)
(unless package-archive-contents
(package-refresh-contents))
(package-install 'use-package)
(require 'use-package))
(setq use-package-always-ensure (not bsb/guix-system-p))
;; Add some basic utils for loading the other config files and track
;; where the config root is since I sometimes reset user-emacs-directory
(defvar bsb/config-dir
user-emacs-directory)
(defvar bsb/site-lisp
(expand-file-name "site-lisp/" bsb/config-dir))
(defun bsb/init-file (file-name &optional extension)
(when (null extension)
(setf extension "el"))
(format "%s/init/%s.%s" bsb/config-dir file-name extension))
(defun bsb/initialize-config! (modules)
(dolist (module modules)
(load-file (bsb/init-file module))))
;; Let 'er rip
(let ((modules '("appearance"
"builtins"
"core"
"development"
"email"
"feeds"
"files"
"lang-cc"
"lang-lisp"
"lang-lua"
"lang-ocaml"
"lang-ruby"
"music"
"norns"
"torrents"
"votd")))
(bsb/initialize-config! modules))
(message "Initialized in %s with %d garbage collections" (emacs-init-time) gcs-done)