forked from jkitchin/scimax
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bootstrap.el
64 lines (47 loc) · 1.98 KB
/
bootstrap.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
;;; bootstrap.el --- install use-package
;;; Commentary:
;;
;;; Code:
(package-initialize)
(when (memq system-type '(windows-nt ms-dos))
;; On windows this solves some issues checking package signatures in the gnu elpa.
(setq package-check-signature nil))
(require 'gnutls)
(when (and (string= "26" (substring emacs-version 0 2))
(null gnutls-algorithm-priority)
(not (memq system-type '(windows-nt ms-dos))))
;; This appears to be a bug in emacs 26 that prevents the gnu archive from being downloaded.
;; This solution is from https://www.reddit.com/r/emacs/comments/cdf48c/failed_to_download_gnu_archive/
(setq gnutls-algorithm-priority "NORMAL:-VERS-TLS1.3"))
(unless (file-exists-p (expand-file-name "archives/gnu/archive-contents" package-user-dir))
(package-refresh-contents))
(unless package--initialized (package-initialize))
(unless (package-installed-p 'diminish)
(package-refresh-contents)
(package-install 'diminish))
(unless (package-installed-p 'use-package)
(package-refresh-contents)
(package-install 'use-package))
(eval-when-compile
(require 'use-package)
(when (and (boundp 'scimax-package-refresh) scimax-package-refresh)
(package-refresh-contents)))
(require 'diminish) ;; if you use :diminish
(require 'bind-key) ;; if you use any :bind variant
;; bootstrap straight
;; https://github.com/radian-software/straight.el#bootstrapping-straightel
;; adding to support using a git repo to install packages
(defvar bootstrap-version)
(let ((bootstrap-file
(expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
(bootstrap-version 6))
(unless (file-exists-p bootstrap-file)
(with-current-buffer
(url-retrieve-synchronously
"https://raw.githubusercontent.com/radian-software/straight.el/develop/install.el"
'silent 'inhibit-cookies)
(goto-char (point-max))
(eval-print-last-sexp)))
(load bootstrap-file nil 'nomessage))
(provide 'bootstrap)
;;; bootstrap.el ends here