-
Notifications
You must be signed in to change notification settings - Fork 1
/
init.el
172 lines (155 loc) · 5.28 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
;;; init.el --- Emacs Initialization File -*- lexical-binding: t; -*-
;;; Commentary:
;;; Code:
;; We use a straight-maintained mirror, which fixes an issue that makes tex-sites.el unavailable to
;; AUCTeX.
(setq straight-recipes-gnu-elpa-use-mirror t)
;; Retreive straight if we don't have it.
(defvar bootstrap-version)
(let ((bootstrap-file
(expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
(bootstrap-version 5))
(unless (file-exists-p bootstrap-file)
(with-current-buffer
(url-retrieve-synchronously
"https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el"
'silent 'inhibit-cookies)
(goto-char (point-max))
(eval-print-last-sexp)))
(load bootstrap-file nil 'nomessage))
;; add a new profile pointing to the emacs source tree
(setq mh-emacs-directory "~/src/nixos/users/profiles/emacs/emacs")
;; Navigate straight to source directory for lockfile. This is under
;; version control and writable, unlike the read-only copy (nix store
;; symlink) under ~/.config/emacs.
(setq straight-profiles `((nil . ,(concat mh-emacs-directory "/straight/versions/default.el"))))
(straight-use-package 'use-package)
(require 'use-package)
;; Prefer `.el' files over outdated `.elc' files. Use this with `auto-compile' to automatically
;; byte-compile outdated files.
(straight-use-package 'auto-compile)
(setq load-prefer-newer t)
(use-package auto-compile
:config
(auto-compile-on-load-mode)
(auto-compile-on-save-mode))
;; TODO move this to :presetup when that's working and nixpkgs is setup.
;; (straight-use-package
;; '(layers :type git :host github :repo "matthuszagh/layers"))
(straight-use-package 'ht)
(straight-use-package 'dash)
(straight-use-package '(layers :local-repo "layers"))
(use-package layers
:init
(if (featurep 'straight)
(progn
(straight-use-package 'ht)
(straight-use-package 'dash)))
:config
(declare-layers '(base
keybinding-management
straight
modal
multiple-cursors
no-littering
mail
recoll
ledger
pinentry
image
time
calendar
;; appearance
;; sourcerer-theme
naysayer-theme
;; TODO spaceline breaks emacs knowing the correct window. See `frame-selected-window' and `powerline-selected-window'.
;; spaceline
rainbow-delimiters
;; pairs
async
;; programming
programming
vcs
completions
prescient
shell
assembly
nix
c
lsp
;; ccls
cmake
sysadmin
octave
clisp
elisp
lisp
flycheck
refactor
dumb-jump
calc
verilog
python
sx
elfeed
make
debugging
sage
tex
sql
scad
hexl
rust
haskell
rmsbolt
asy
snippet
dap
spice
hydra
;; TODO timeout errors
;; perspective
json
yaml
web-dev
diff
jupyter
grammar
;; formatting
indenting
formatting
documentation
undoing
buffers
line
librarian
windows
files
helm
help
org
org-roam
org-noter
org-ref
markdown
writing
exwm
pdf
epub
internet
irc
icon-font))
(declare-global-depends '(base
straight
keybinding-management
no-littering))
(defun mh/load-all-elisp-in-dir (dir)
(let ((libraries-loaded (mapcar #'file-name-sans-extension
(delq nil (mapcar #'car load-history)))))
(dolist (file (directory-files-recursively dir ".+-layer\\.elc?$"))
(let ((library (file-name-sans-extension file)))
(unless (member library libraries-loaded)
(load library nil t)
(push library libraries-loaded))))))
(mh/load-all-elisp-in-dir (concat user-emacs-directory "layers")))
;;; init.el ends here