tvl-depot/init.el

110 lines
2.7 KiB
EmacsLisp
Raw Normal View History

;;; 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.
(require 'package)
(require 'seq)
;; 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/"))
(package-initialize)
;; This variable controls all packages that should be installed.
(defvar desired-packages
'(;; elisp libraries
dash
dash-functional
ht
s
;; editor packages
2013-08-19 00:46:54 +02:00
ace-jump-mode
2015-05-03 18:22:08 +02:00
ag
browse-kill-ring
cargo
company
2014-02-25 17:12:53 +01:00
confluence
2013-10-19 20:04:45 +02:00
dash
2014-12-29 21:52:21 +01:00
dockerfile-mode
2015-01-16 14:42:48 +01:00
erlang
exwm
flycheck
go-mode
gruber-darker-theme
haskell-mode
2017-10-15 13:30:10 +02:00
helm
2014-12-29 21:52:21 +01:00
hi2
idle-highlight-mode
magit
2014-12-29 21:52:21 +01:00
markdown-mode+
2015-05-03 18:22:58 +02:00
multi-term
multiple-cursors
nix-mode
paredit
2014-06-15 12:22:18 +02:00
password-store
pg
2014-12-29 21:52:21 +01:00
pkgbuild-mode
2013-10-21 13:28:13 +02:00
puppet-mode
racer
rainbow-delimiters
rainbow-mode
restclient
2014-06-15 12:22:18 +02:00
rust-mode
smart-mode-line
string-edit
switch-window
2017-10-13 18:14:33 +02:00
terraform-mode
undo-tree
uuidgen
2014-12-29 21:52:21 +01:00
yaml-mode
which-key
))
(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))
(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."))))
;; Run package installation!
(install-needed-packages desired-packages)
;; 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"))
(load custom-file)
(defvar home-dir)
(setq home-dir (expand-file-name "~"))
;; Seed RNG
(random t)
;; 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 ()
(mapc 'require '(nixos
look-and-feel
functions
settings
modes
bindings
eshell-setup
haskell-setup
rust-setup
)))
2017-07-30 18:30:04 +02:00
(add-hook 'after-init-hook 'load-other-settings)