Here's a complete list of all of the options configurable for each host, and their default values. If a host configuration does not exist, the default values will remain.
Configure the system font with a single ~font-family~ and define the size, of which variations to the font size are relative to this value.
#+begin_src emacs-lisp
(defvar dotfiles/font
"Fira Code"
"Unified system font family, used on all font faces.")
(defvar dotfiles/font-size
96
"Unified font size, of which all variations are relative to.")
#+end_src
Used by the desktop module to find the appropriate browser.
#+begin_src emacs-lisp
(defvar dotfiles/browser
(getenv "BROWSER")
"The default browser used by the system.")
#+end_src
Used by the writing module to determine the system language.
#+begin_src emacs-lisp
(defvar dotfiles/language
(getenv "LANG")
"The default system language.")
#+end_src
All of the available modules defined in the ~dotfiles/modules-available~ constant.
#+begin_src emacs-lisp
(defconst dotfiles/modules-available
'(core editor desktop writing projects interface)
"All of the available modules for hosts to load.")
#+end_src
Add the modules you want to initialize to the ~dotfiles/modules~ variable.
#+begin_src emacs-lisp
(defvar dotfiles/modules
dotfiles/modules-available
"Enabled modules, modify this in your host configuration.")
#+end_src
Specify the emacs home, and the cache directory.
#+begin_src emacs-lisp
(defvar dotfiles/home
user-emacs-directory
"Original value of `user-emacs-directory'.")
#+end_src
Used to seperate the immutable configuration from the stateful package files.
#+begin_src emacs-lisp
(defvar dotfiles/cache
(expand-file-name "~/.cache/emacs")
"Where `user-emacs-directory' redirects to.")
#+end_src
Functionality like =completion= and =hints= delayed to avoid popups for common manuevers.
#+begin_src emacs-lisp
(defvar dotfiles/idle
0.0
"Length of time to wait before offering completions.")
#+end_src
Required for the all powerful leader key.
#+begin_src emacs-lisp
(defvar dotfiles/leader-key
"SPC"
"Custom leader key for custom actions.")
#+end_src
The desktop module requires the global leader key set.
#+begin_src emacs-lisp
(defvar dotfiles/leader-key-global
(concat "C-" dotfiles/leader-key)
"Global leader key available everywhere.")
#+end_src
Define where the source repositories exist on disk, for integration with the projects module.
#+begin_src emacs-lisp
(defvar dotfiles/projects
(expand-file-name "~/.local/source/")
"Location where source code projects exist on disk.")
#+end_src
Where the password store exists on disk.
#+begin_src emacs-lisp
(defvar dotfiles/passwords
(expand-file-name "~/.password-store/")
"Directory containing the password store.")
#+end_src
Configure the public GPG key that Emacs will encrypt files to.
#+begin_src emacs-lisp
(defvar dotfiles/public-key
"37AB1CB72B741E478CA026D43025DCBD46F81C0F"
"Public PGP key that Emacs will encrypt files to.")
Here's a complete list of all of the options configurable for each host, and their default values. Override any of these configurations in a host file. All of the values are prefixed with ~dotfiles/~. If you need to make configurations to another variable, consider creating a new option. Here are a few examples to get started:
@ -160,7 +91,7 @@ The host configuration tangles, and loads (if it exist) using the systems name.
(org-babel-load-file host-file)))
(org-babel-load-file host-file)))
#+end_src
#+end_src
Build and load all of the enabled modules.
Breaking down the project into logical units or chapters to keep the code more maintainable and organized. This is also a fundamental requirement to achieve the goal of modularity.
#+begin_src emacs-lisp
#+begin_src emacs-lisp
(dolist (m dotfiles/modules)
(dolist (m dotfiles/modules)
@ -171,148 +102,6 @@ Build and load all of the enabled modules.
* Modules
* Modules
Breaking down the project into logical units or chapters to keep the code more maintainable and organized. This is also a fundamental requirement to achieve the goal of modularity. Incorporating just the =core= module on a build server to build literate programming projects is just one example.
** Core
:PROPERTIES:
:header-args: :tangle modules/core.el
:END:
Minimal configuration to make Emacs usable for my own personal workflow. This does little in the ways of improving the visuals, only removing what's included by default and not required. Read more about my technique in my post [[file:docs/posts/immutable-emacs.org.gpg][Immutable Emacs]].
*** Startup
Emacs creates a lot of files relative to ~user-emacs-directory~, these files are not part of this immutable configuration and do not belong in the emacs directory. How can we solve this issue? Shortly after initialization, before most packages load, we change the value to ~dotfiles/cache~. I elaborate more on the technique in my post [[https://chrishayward.xyz/posts/immutable-emacs/][Immutable Emacs]].
#+begin_src emacs-lisp
(setq user-emacs-directory dotfiles/cache)
#+end_src
Because this project uses version-control, we can disable more unwanted features:
+ Lock files
+ Backup files
#+begin_src emacs-lisp
(setq create-lockfiles nil
make-backup-files nil)
#+end_src
*** Packages
Download and install packages using [[https://github.com/raxod502/straight.el][straight.el]], a functional package manager that integrates with =use-package=, giving us more control over sourcing our packages.
+ Use the development branch
+ Integrate with ~use-package~
Apply the configurations prior to bootstrapping the package manager, by setting (writing) to the variables that =straight= will ultimately read from.
#+begin_src emacs-lisp
(setq straight-repository-branch "develop"
straight-use-package-by-default t)
#+end_src
Bootstrap the package manager, downloading, installing, or configuring depending on the state of the configuration. All packages build from source, pinned to specific git commit hashes.
Complete the integration with ~use-package~ by installing it with =straight=.
#+begin_src emacs-lisp
(straight-use-package 'use-package)
#+end_src
*** Cleanup
Despite having our *stateful* and *immutable* configurations seperate, it's good practice to make efforts to reduce the trash created by Emacs. Install [[https://github.com/emacscollective/no-littering][no-littering]] to reduce the files created by Emacs.
#+begin_src emacs-lisp
(use-package no-littering)
#+end_src
Emacs' default user interface is *horrendous*, let's do something about that.
#+begin_src emacs-lisp
(setq inhibit-startup-message t
initial-scratch-message "")
(global-prettify-symbols-mode)
(when (fboundp 'tooltip-mode)
(tooltip-mode -1))
(when (fboundp 'tool-bar-mode)
(tool-bar-mode -1))
(when (fboundp 'menu-bar-mode)
(menu-bar-mode -1))
(when (fboundp 'scroll-bar-mode)
(scroll-bar-mode -1))
#+end_src
Emacs has a long history of running on machines without gigabytes of available memory, let it realize its full potential! Just kidding, it just smashes *CPU0*.
#+begin_src emacs-lisp
(setq gc-cons-treshold most-positive-fixnum
gnutls-min-prime-bits 4096)
#+end_src
*** Babel
*Organize your plain life in plain text*
[[https://orgmode.org][Org-mode]] is one of the hallmark features of Emacs, and provides the basis for my Literate Programming platform. It's essentially a markdown language with rich features for project management, scheduling, development, and writing. It's hard to convey everything within its capabilities.
;; Here's a complete list of all of the options configurable for each host, and their default values. If a host configuration does not exist, the default values will remain.
;; Configure the system font with a single ~font-family~ and define the size, of which variations to the font size are relative to this value.
(defvardotfiles/font
"Fira Code"
"Unified system font family, used on all font faces.")
(defvardotfiles/font-size
96
"Unified font size, of which all variations are relative to.")
;; Used by the desktop module to find the appropriate browser.
(defvardotfiles/browser
(getenv"BROWSER")
"The default browser used by the system.")
;; Used by the writing module to determine the system language.
(defvardotfiles/language
(getenv"LANG")
"The default system language.")
;; All of the available modules defined in the ~dotfiles/modules-available~ constant.
(defconstdotfiles/modules-available
'(coreeditordesktopwritingprojectsinterface)
"All of the available modules for hosts to load.")
;; Add the modules you want to initialize to the ~dotfiles/modules~ variable.
(defvardotfiles/modules
dotfiles/modules-available
"Enabled modules, modify this in your host configuration.")
;; Specify the emacs home, and the cache directory.
(defvardotfiles/home
user-emacs-directory
"Original value of `user-emacs-directory'.")
;; Used to seperate the immutable configuration from the stateful package files.
(defvardotfiles/cache
(expand-file-name"~/.cache/emacs")
"Where `user-emacs-directory' redirects to.")
;; Functionality like =completion= and =hints= delayed to avoid popups for common manuevers.
(defvardotfiles/idle
0.0
"Length of time to wait before offering completions.")
;; Required for the all powerful leader key.
(defvardotfiles/leader-key
"SPC"
"Custom leader key for custom actions.")
;; The desktop module requires the global leader key set.
(defvardotfiles/leader-key-global
(concat"C-"dotfiles/leader-key)
"Global leader key available everywhere.")
;; Define where the source repositories exist on disk, for integration with the projects module.
(defvardotfiles/projects
(expand-file-name"~/.local/source/")
"Location where source code projects exist on disk.")
;; Where the password store exists on disk.
(defvardotfiles/passwords
(expand-file-name"~/.password-store/")
"Directory containing the password store.")
;; Configure the public GPG key that Emacs will encrypt files to.
(defvardotfiles/public-key
"37AB1CB72B741E478CA026D43025DCBD46F81C0F"
"Public PGP key that Emacs will encrypt files to.")
;; Here's a complete list of all of the options configurable for each host, and their default values. Override any of these configurations in a host file. All of the values are prefixed with ~dotfiles/~. If you need to make configurations to another variable, consider creating a new option. Here are a few examples to get started:
;; Breaking down the project into logical units or chapters to keep the code more maintainable and organized. This is also a fundamental requirement to achieve the goal of modularity.