about summary refs log blame commit diff stats
path: root/.emacs.d/lisp/init-packages.el
blob: d236bca5f8f9986e564e87b74b353ddfd4b32b0b (plain) (tree)


















                                                                                

                               











                                          

                
                                                                            
                                        


                               









                                                                                          



                                           
;;; init-packages.el --- Package Configuration File -*- lexical-binding: t -*-
;;; Commentary:
;;; Code:

;; TODO - straight.el?

(require 'package)
(require 'url)

(setq package-archives '(("melpa" . "https://melpa.org/packages/")
                         ("melpa-stable" . "https://stable.melpa.org/packages/")
                         ("nongnu" . "https://elpa.nongnu.org/nongnu/")
                         ("elpa" . "https://elpa.gnu.org/packages/")))

(package-initialize)

(unless package-archive-contents
  (package-refresh-contents))

(setq package-native-compile t)

(unless (package-installed-p 'use-package)
   (package-install 'use-package))
(require 'use-package)

(setq use-package-always-ensure t)

(use-package diminish)

(use-package paradox
  :config
  (paradox-enable))

(use-package epl
  :config
  ;; TODO make a copy of the built-in check for system packages work instead
  (defvar my/system-packages '("vterm"))
  (defun my/upgrade-packages ()
    (interactive)
    (epl-refresh)
    (when-let ((upgrades (seq-filter (lambda (u)
                                       (not (member
                                             (epl-package-name (epl-upgrade-available  u))
                                             my/system-packages)))
                                     (epl-find-upgrades))))
      ;; TODO why doesn't this work?
      ;; (epl-upgrade (mapcar 'epl-upgrade-available upgrades)
      (dolist (upgrade upgrades)
        (epl-package-install (epl-upgrade-available upgrade) 'force)
        (epl-package-delete (epl-upgrade-installed upgrade))))
    (message "Package upgrade finished.")))

(provide 'init-packages)
;;; init-packages.el ends here