begin system-dependent package management. BROKEN
This commit is contained in:
parent
b5514591a6
commit
420b65b587
28
init.el
28
init.el
@ -264,11 +264,17 @@ If the current window occupies the whole frame, split it."
|
|||||||
|
|
||||||
;; straight.el: the better package manager?
|
;; straight.el: the better package manager?
|
||||||
;; minified bootstrap (split lines if you want) (or not)
|
;; minified bootstrap (split lines if you want) (or not)
|
||||||
;; (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/radian-software/straight.el/develop/install.el" 'silent 'inhibit-cookies) (goto-char (point-max)) (eval-print-last-sexp))) (load bootstrap-file nil 'nomessage)) (straight-use-package 'use-package) (setq straight-use-package-by-default t)
|
(defun straight-bootstrap ()
|
||||||
|
"bootstrap the `straight' package manager."
|
||||||
|
(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/radian-software/straight.el/develop/install.el" 'silent 'inhibit-cookies) (goto-char (point-max)) (eval-print-last-sexp))) (load bootstrap-file nil 'nomessage))
|
||||||
|
(straight-use-package 'use-package)
|
||||||
|
(setq straight-use-package-by-default t))
|
||||||
|
|
||||||
;; actually, use elpaca instead
|
;; actually, use elpaca instead
|
||||||
;; (require 'elpaca-bootstrap)
|
;; (require 'elpaca-bootstrap)
|
||||||
|
(defun elpaca-bootstrap ()
|
||||||
|
"Bootstrap the `elpaca' package manager."
|
||||||
(setq elpaca-bootstrap-file (expand-file-name "elpaca-bootstrap.el"
|
(setq elpaca-bootstrap-file (expand-file-name "elpaca-bootstrap.el"
|
||||||
user-emacs-directory))
|
user-emacs-directory))
|
||||||
(unless (file-exists-p elpaca-bootstrap-file)
|
(unless (file-exists-p elpaca-bootstrap-file)
|
||||||
@ -279,7 +285,23 @@ If the current window occupies the whole frame, split it."
|
|||||||
(let ((start (1+ (re-search-forward "```emacs-lisp")))
|
(let ((start (1+ (re-search-forward "```emacs-lisp")))
|
||||||
(end (- (re-search-forward "\n```") 3)))
|
(end (- (re-search-forward "\n```") 3)))
|
||||||
(write-region start end elpaca-bootstrap-file))))
|
(write-region start end elpaca-bootstrap-file))))
|
||||||
(load-file elpaca-bootstrap-file)
|
(load-file elpaca-bootstrap-file))
|
||||||
|
|
||||||
|
(defun nix-bootstrap ()
|
||||||
|
"placeholder function. Ideally, load nix packages"
|
||||||
|
(message "you never set up nix packages, baka!"))
|
||||||
|
|
||||||
|
(if (executable-find "home-manager")
|
||||||
|
(nix-bootstrap)
|
||||||
|
(if (eq system-type 'windows-nt)
|
||||||
|
(straight-bootstrap)
|
||||||
|
(elpaca-bootstrap)))
|
||||||
|
|
||||||
|
(fset #'use-package--orig #'use-package)
|
||||||
|
(defmacro use-package (&rest args)
|
||||||
|
"re-definition of use-package to replace the downloader depending on system"
|
||||||
|
(require 'dash)
|
||||||
|
`(use-package--orig ,@()))
|
||||||
|
|
||||||
;; see https://www.reddit.com/r/emacs/comments/1937vaz/emacs_291_on_windows_install_magit_requires_seq/?rdt=48529
|
;; see https://www.reddit.com/r/emacs/comments/1937vaz/emacs_291_on_windows_install_magit_requires_seq/?rdt=48529
|
||||||
;; ;; seq version workaround
|
;; ;; seq version workaround
|
||||||
|
Loading…
Reference in New Issue
Block a user