begin system-dependent package management. BROKEN

This commit is contained in:
mir 2024-01-28 17:44:12 -09:00
parent b5514591a6
commit 420b65b587

32
init.el
View File

@ -264,14 +264,20 @@ If the current window occupies the whole frame, split it."
;; straight.el: the better package manager?
;; 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
;; (require 'elpaca-bootstrap)
(setq elpaca-bootstrap-file (expand-file-name "elpaca-bootstrap.el"
(defun elpaca-bootstrap ()
"Bootstrap the `elpaca' package manager."
(setq elpaca-bootstrap-file (expand-file-name "elpaca-bootstrap.el"
user-emacs-directory))
(unless (file-exists-p elpaca-bootstrap-file)
(unless (file-exists-p elpaca-bootstrap-file)
(with-current-buffer
(pop-to-buffer
(url-retrieve-synchronously "https://raw.githubusercontent.com/progfolio/elpaca/master/README.md"))
@ -279,7 +285,23 @@ If the current window occupies the whole frame, split it."
(let ((start (1+ (re-search-forward "```emacs-lisp")))
(end (- (re-search-forward "\n```") 3)))
(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
;; ;; seq version workaround