2017-11-12 19:46:14 +01:00
|
|
|
;;; init.el --- Package bootstrapping. -*- lexical-binding: t; -*-
|
|
|
|
|
|
|
|
;; This file bootstraps the Emacs setup by going through package installations.
|
|
|
|
;; After all packages are installed, local configuration is loaded.
|
|
|
|
|
2013-07-08 01:15:05 +02:00
|
|
|
(require 'package)
|
2017-11-12 19:46:14 +01:00
|
|
|
(require 'seq)
|
2013-07-08 01:15:05 +02:00
|
|
|
|
2017-11-12 19:46:14 +01:00
|
|
|
;; Configure Marmalade and MELPA repositories. Packages available on Marmalade
|
|
|
|
;; will have precedence.
|
2015-05-18 14:21:39 +02:00
|
|
|
(add-to-list 'package-archives '("marmalade" . "https://marmalade-repo.org/packages/"))
|
2015-12-14 00:04:29 +01:00
|
|
|
(add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/"))
|
2017-11-12 20:24:21 +01:00
|
|
|
(package-initialize)
|
2013-07-08 01:15:05 +02:00
|
|
|
|
2017-11-12 19:46:14 +01:00
|
|
|
;; This variable controls all packages that should be installed.
|
2017-11-12 22:41:54 +01:00
|
|
|
(defvar desired-packages
|
2017-11-07 21:29:20 +01:00
|
|
|
'(;; elisp libraries
|
|
|
|
dash
|
|
|
|
dash-functional
|
|
|
|
ht
|
|
|
|
s
|
|
|
|
|
|
|
|
;; editor packages
|
2013-08-19 00:46:54 +02:00
|
|
|
ace-jump-mode
|
2017-11-15 18:56:23 +01:00
|
|
|
ace-window
|
2013-07-29 00:53:08 +02:00
|
|
|
browse-kill-ring
|
2017-11-06 19:35:19 +01:00
|
|
|
cargo
|
2017-11-12 22:41:54 +01:00
|
|
|
company
|
2014-12-29 21:52:21 +01:00
|
|
|
dockerfile-mode
|
2015-01-16 14:42:48 +01:00
|
|
|
erlang
|
2017-11-15 17:35:17 +01:00
|
|
|
exwm
|
2013-10-17 14:17:38 +02:00
|
|
|
flycheck
|
2017-11-20 17:35:25 +01:00
|
|
|
geiser
|
2014-10-21 19:38:18 +02:00
|
|
|
go-mode
|
2017-09-27 15:02:45 +02:00
|
|
|
gruber-darker-theme
|
2014-10-21 19:38:18 +02:00
|
|
|
haskell-mode
|
2017-10-15 13:30:10 +02:00
|
|
|
helm
|
2017-11-20 17:35:25 +01:00
|
|
|
helm-exwm
|
|
|
|
helm-pass
|
2018-01-04 09:29:56 +01:00
|
|
|
helm-swoop
|
2014-12-29 21:52:21 +01:00
|
|
|
hi2
|
2013-07-29 00:53:08 +02:00
|
|
|
idle-highlight-mode
|
|
|
|
magit
|
2014-12-29 21:52:21 +01:00
|
|
|
markdown-mode+
|
2015-05-03 18:22:58 +02:00
|
|
|
multi-term
|
2017-11-06 19:35:53 +01:00
|
|
|
multiple-cursors
|
2017-10-15 20:23:51 +02:00
|
|
|
nix-mode
|
2013-07-29 00:53:08 +02:00
|
|
|
paredit
|
2014-06-15 12:22:18 +02:00
|
|
|
password-store
|
2017-11-06 19:35:53 +01:00
|
|
|
pg
|
2013-10-21 13:28:13 +02:00
|
|
|
puppet-mode
|
2017-11-06 19:35:19 +01:00
|
|
|
racer
|
2017-11-20 17:35:59 +01:00
|
|
|
racket-mode
|
2013-07-29 00:53:08 +02:00
|
|
|
rainbow-delimiters
|
|
|
|
rainbow-mode
|
2017-11-06 19:35:53 +01:00
|
|
|
restclient
|
2014-06-15 12:22:18 +02:00
|
|
|
rust-mode
|
2013-10-19 22:44:30 +02:00
|
|
|
smart-mode-line
|
2017-11-13 00:58:41 +01:00
|
|
|
string-edit
|
2018-01-04 09:29:56 +01:00
|
|
|
sly
|
|
|
|
sly-company
|
|
|
|
sly-quicklisp
|
2013-08-06 23:46:26 +02:00
|
|
|
switch-window
|
2017-10-13 18:14:33 +02:00
|
|
|
terraform-mode
|
2013-10-14 08:50:56 +02:00
|
|
|
undo-tree
|
2017-11-06 19:35:53 +01:00
|
|
|
uuidgen
|
2014-12-29 21:52:21 +01:00
|
|
|
yaml-mode
|
2017-11-15 18:29:01 +01:00
|
|
|
which-key
|
2017-11-12 19:46:14 +01:00
|
|
|
))
|
2014-02-04 23:48:29 +01:00
|
|
|
|
2017-11-12 19:46:14 +01:00
|
|
|
(defun installable-packages (pkg-list)
|
|
|
|
"Filter out not-yet installed packages from package list."
|
|
|
|
(seq-filter (lambda (p) (not (package-installed-p p))) pkg-list))
|
2013-10-14 08:50:56 +02:00
|
|
|
|
2017-11-12 19:46:14 +01:00
|
|
|
(defun install-needed-packages (pkg-list)
|
|
|
|
(let ((to-install (installable-packages pkg-list)))
|
|
|
|
(if (< 0 (length to-install))
|
|
|
|
(progn (package-refresh-contents)
|
|
|
|
(mapcar #'package-install to-install))
|
|
|
|
(message "No new packages to install."))))
|
2013-07-08 01:15:05 +02:00
|
|
|
|
2017-11-12 19:46:14 +01:00
|
|
|
;; Run package installation!
|
|
|
|
(install-needed-packages desired-packages)
|
2013-10-17 14:17:38 +02:00
|
|
|
|
2017-11-12 19:46:14 +01:00
|
|
|
;; Configure a few basics before moving on to package-specific initialisation.
|
2014-10-21 19:37:19 +02:00
|
|
|
(setq custom-file (concat user-emacs-directory "init/custom.el"))
|
2013-07-08 01:15:05 +02:00
|
|
|
(load custom-file)
|
|
|
|
|
2017-11-12 19:46:14 +01:00
|
|
|
(defvar home-dir)
|
|
|
|
(setq home-dir (expand-file-name "~"))
|
2013-08-05 11:54:38 +02:00
|
|
|
|
2013-07-08 01:15:05 +02:00
|
|
|
;; Seed RNG
|
|
|
|
(random t)
|
|
|
|
|
2017-11-12 19:46:14 +01:00
|
|
|
;; Add 'init' folder that contains other settings to load.
|
|
|
|
(add-to-list 'load-path (concat user-emacs-directory "init"))
|
|
|
|
|
|
|
|
;; Load configuration that makes use of installed packages:
|
|
|
|
|
|
|
|
;; Emacs will automatically initialise all installed packages.
|
|
|
|
;; After initialisation, proceed to load configuration that requires packages:
|
|
|
|
(defun load-other-settings ()
|
2017-11-15 17:35:17 +01:00
|
|
|
(mapc 'require '(nixos
|
|
|
|
look-and-feel
|
2017-11-12 19:46:14 +01:00
|
|
|
functions
|
|
|
|
settings
|
|
|
|
modes
|
|
|
|
bindings
|
|
|
|
eshell-setup
|
|
|
|
haskell-setup
|
|
|
|
rust-setup
|
2017-11-24 16:45:12 +01:00
|
|
|
lisp-setup
|
2017-11-12 19:46:14 +01:00
|
|
|
)))
|
2017-07-30 18:30:04 +02:00
|
|
|
|
2017-11-12 19:46:14 +01:00
|
|
|
(add-hook 'after-init-hook 'load-other-settings)
|