mirror of https://github.com/Chizi123/.emacs.d.git

Joel Grunbaum
2024-02-14 56a5d88324a3d10b8ba52d673f58fc43b01b1b89
commit | author | age
56a5d8 1 ;;; Package manager selection
JG 2 ;; Can chose the package manager from the default package.el or straight.el
3 ;; There may be problems with some of them in corporate environments
4
5 ;; Repos
6 (cond ((eq package-manager 'package)
7        (require 'package)
8        (when (not (boundp 'package-archives))
9          (setq package-archives '(("gnu"   . "https://elpa.gnu.org/packages/")
10                                   ("nongnu"  . "https://elpa.nongnu.org/nongnu/")
11                                   ("melpa" . "https://melpa.org/packages/"))))
12        (package-initialize)
13
14        ;; use-package
15        (unless (package-installed-p 'use-package)
16          (package-refresh-contents)
17          (package-install 'use-package))
18        (setq package-install-upgrade-built-in t)
19
20        (eval-when-compile
21          (require 'use-package))
22        (require 'use-package-ensure)
23        (setq use-package-always-ensure t))
24       ((eq package-manager 'straight)
25        (defvar bootstrap-version)
26        (let ((bootstrap-file
27               (expand-file-name
28                "straight/repos/straight.el/bootstrap.el"
29                (or (bound-and-true-p straight-base-dir)
30                   user-emacs-directory)))
31              (bootstrap-version 7))
32          (unless (file-exists-p bootstrap-file)
33            (with-current-buffer
34                (url-retrieve-synchronously
35                 "https://raw.githubusercontent.com/radian-software/straight.el/develop/install.el"
36                 'silent 'inhibit-cookies)
37              (goto-char (point-max))
38              (eval-print-last-sexp)))
39          (load bootstrap-file nil 'nomessage))
40        (straight-use-package 'use-package)
41        (setq straight-use-package-by-default t)))