Move package config to separate file to be used by install.el

This commit is contained in:
Evie Litherland-Smith 2024-04-17 12:54:51 +01:00
parent e66638ca13
commit 2daf0a4b03
3 changed files with 16 additions and 14 deletions

14
init.el
View file

@ -1,23 +1,13 @@
;;; init.el -- My emacs config -*- lexical-binding: t -*-
;;; Commentary:
;; Moving my Emacs config from separate directory
;; To install packages on non-NixOS systems:
;; `(setq prog-mode-hook nil lisp-data-mode-hook nil)'
;; `(package-install-selected-packages)'
;; Optionally autoremove unneeded packages:
;; `(package-autoremove)'
;; To install packages on non-NixOS systems run `install.el'
;;; Code:
;; Stop popups for warning messages, keep in log buffer
(setopt warning-minimum-level :error)
;; Configure packages archives with priority
(use-package package
:custom
(package-archive-priorities '(("melpa" . 10) ("stable" . 5) ("nongnu" . 5) ("gnu" . 0)))
:config
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/"))
(add-to-list 'package-archives '("stable" . "https://stable.melpa.org/packages/"))
(package-initialize))
(require 'package-config)
(setq custom-file (locate-user-emacs-file "custom.el"))
(when (and custom-file (file-exists-p custom-file))

View file

@ -1,8 +1,8 @@
;;; install.el -- Handle installing selected packages -*- lexical-binding: t -*-
;;; Commentary:
;;; Code:
(setq prog-mode-hook nil
lisp-data-mode-hook nil)
;; Configure packages archives with priority
(require 'package-config)
(package-refresh-contents)
(setopt package-selected-packages
'(

12
package-config.el Normal file
View file

@ -0,0 +1,12 @@
;;; package-config.el -- Setup package.el archives and priorities -*- lexical-binding: t -*-
;;; Commentary:
;;; Code:
(use-package package
:custom
(package-archive-priorities '(("melpa" . 10) ("stable" . 5) ("nongnu" . 5) ("gnu" . 0)))
:config
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/"))
(add-to-list 'package-archives '("stable" . "https://stable.melpa.org/packages/"))
(package-initialize))
(provide 'package-config)
;;; package-config.el ends here