Commit 049813d94f7f

Vincent Demeester <vincent@sbr.pm>
2020-03-29 18:55:21
docs: move emacs.org to pulbished docs 📖
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
1 parent f476c57
docs/emacs.old.org
@@ -1,118 +0,0 @@
-#+TITLE: Vincent Demeester's .emacs.d
-#+SETUPFILE: ./.setupfile.org
-
-* Overview
-:PROPERTIES:
-:CUSTOM_ID: h:d95d2079-2aee-4be4-b6bd-d89de96e7033
-:END:
-
-** Canonical links to this document
-:PROPERTIES:
-:CUSTOM_ID: h:0a080da3-bcc6-42a1-83ef-5d1ed6123cc4
-:END:
-
-** What is this
-:PROPERTIES:
-:CUSTOM_ID: h:fa787d18-1a0c-4312-bc07-22318c645daa
-:END:
-
-This is a try at merging [[https://github.com/vdemeester/emacs-config.git][~vdemeester/emacs-config~]] and [[https://github.com/vdemeester/home.git][~vdemeester/home~]] repository by
-having the emacs configuration written in there. Once this is complete,
-[[https://github.com/vdemeester/emacs-config.git][~vdemeester/emacs-config~]] should be archived.
-
-* Nix-ies
-:PROPERTIES:
-:CUSTOM_ID: h:8bc69da9-b49c-4ddd-a6c9-b944aad993a1
-:END:
-
-This is where the magic happens, when using [[https://nixos.org/nix/][~nix~]] or [[https://nixos.org][NixOS]] with [[https://github.com/rycee/home-manager][~home-manager~]]. In a gist
-we will create a set of nix files that tangle, get dependencies and generate the correct
-emacs package with the packages used inside the configuration. This means, if I add a
-=(use-package magit)= in my configuration, and I tangle / re-execute this script(s), I now
-have a new packaged installed as part of my Emacs package. This is *heavily* inspired by
-[[https://matthewbauer.us/bauer/][Matthew Bauer's bauer]] emacs configuration.
-
-** Required lisp libraries
-:PROPERTIES:
-:header-args: :tangle ~/.emacs.d/lisp/use-package-list.el
-:CUSTOM_ID: h:316fd3ee-ab99-4f01-ba5a-1a91c54bc334
-:END:
-
-We need a way to list packages used in the configuration using ~use-package~. This is
-coming straight from [[https://matthewbauer.us/bauer/][Matthew Bauer's bauer]].
-
-#+begin_src emacs-lisp
-;;; use-package-list.el --- List use-package declarations in config file
-
-;; Copyright (C) 2017 Matthew Bauer
-
-;; Author: Matthew Bauer <mjbauer95@gmail.com>
-
-;; This file is NOT part of GNU Emacs.
-
-;;; Commentary:
-
-;; ‘ensure’ packages at compile time.
-
-;;; Code:
-
-(require 'json)
-(require 'use-package)
-(require 'package)
-(eval-when-compile
-  (require 'cl))
-
-(defun use-package-list (script)
-  "Count use-package declarations listed in SCRIPT."
-
-  (defvar use-package-list--is-running t)
-  (lexical-let ((use-package-verbose t)
-                (use-package-debug t)
-                (use-package-always-ensure nil)
-                (use-package-always-defer t)
-                (use-package-list--packages nil)
-                (use-package-ensure-function 'ignore))
-    (advice-add 'use-package
-                :before (lambda (name &rest args)
-                          (unless (or (and (member :disabled args)
-                                           (plist-get args :disabled))
-                                      (and (member :ensure args)
-                                           (not (plist-get args :ensure)))
-                                      (and (not (member :ensure args))
-                                           (package-built-in-p name)))
-                            (when (and (member :ensure args)
-                                       (not (eq (plist-get args :ensure) t))
-                                       (symbolp (plist-get args :ensure)))
-                              (setq name (plist-get args :ensure)))
-                            (add-to-list 'use-package-list--packages name))))
-
-    (advice-add 'use-package-handler/:defer
-                :around (lambda (x name keyword arg rest state)
-                          (let ((body (use-package-process-keywords name rest
-                                        (plist-put state :deferred t)))
-                                (name-string (use-package-as-string name)))
-                            (dolist (command
-                                     (delete-dups (plist-get state :commands)))
-                              (fset command (lambda (&rest args))))
-                            body)))
-
-    (advice-add 'use-package-load-name :override #'ignore)
-
-    (load script nil nil t)
-
-    (princ (json-encode use-package-list--packages))
-
-    use-package-list--packages))
-
-(provide 'use-package-list)
-;;; use-package-list.el ends here
-#+end_src
-
-The idea is to run some like the following.
-
-#+begin_src bash :tangle no
-emacs --batch --quick \
-      -L /nix/store/acm9rskhx237xb16zdy7vx6r1m5n8q58-emacs-packages-deps/share/emacs/site-lisp/elpa/use-package-20191126.2034/use-package-* \
-      -l /home/vincent/.emacs.d/lisp/use-package-list.el \
-      --eval "(use-package-list \"/home/vincent/.emacs.d/init.el\")"
-#+end_src
tools/emacs/emacs.org → docs/emacs.org
@@ -4,7 +4,6 @@
 #+EXPORT_EXCLUDE_TAGS: noexport
 #+CREATOR: Emacs 27.0.90 (Org mode 9.3)
 #+LANGUAGE: en
-#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="./notes.css"/>
 #+OPTIONS: html-style:nil
 
 #+TOC: headlines 3
@@ -190,42 +189,42 @@
   calling `package-initialize'.  Emacs 27 changed the default behavior: It now calls
   `package-initialize' before loading the init file.
 
-  #+INCLUDE: "./early-init.el" src emacs-lisp :range-begin "PkgStartup" :range-end "-PkgStartup" :lines "3-4"
+  #+INCLUDE: "../tools/emacs/early-init.el" src emacs-lisp :range-begin "PkgStartup" :range-end "-PkgStartup" :lines "3-4"
 
 - Let's inhibit resizing the frame at early stage.
 
-  #+INCLUDE: "./early-init.el" src emacs-lisp :range-begin "FrameResize" :range-end "-FrameResize" :lines "7-8"
+  #+INCLUDE: "../tools/emacs/early-init.el" src emacs-lisp :range-begin "FrameResize" :range-end "-FrameResize" :lines "7-8"
 
 - I never use the /menu-bar/, or the /tool-bar/ or even the /scroll-bar/, so we can safely
   disable those very very early.
 
-  #+INCLUDE: "./early-init.el" src emacs-lisp :range-begin "DisableUI" :range-end "-DisableUI" :lines "11-15"
+  #+INCLUDE: "../tools/emacs/early-init.el" src emacs-lisp :range-begin "DisableUI" :range-end "-DisableUI" :lines "11-15"
 
 - Finally we can try to avoid garbage collection at startup. The garbage collector can
   easily double startup time, so we suppress it at startup by turning up ~gc-cons-threshold~
   (and perhaps ~gc-cons-percentage~) temporarily.
 
-  #+INCLUDE: "./early-init.el" src emacs-lisp :range-begin "GarbageCollection" :range-end "-GarbageCollection" :lines "18-20"
+  #+INCLUDE: "../tools/emacs/early-init.el" src emacs-lisp :range-begin "GarbageCollection" :range-end "-GarbageCollection" :lines "18-20"
 
 - Another small optimization concerns on =file-name-handler-alist= : on every .el and .elc
   file loaded during start up, it has to runs those regexps against the filename ; setting
   it to ~nil~ and after initialization finished put the value back make the initialization
   process quicker.
 
-  #+INCLUDE: "./early-init.el" src emacs-lisp :range-begin "FileNameHandler" :range-end "-FileNameHandler" :lines "23-25"
+  #+INCLUDE: "../tools/emacs/early-init.el" src emacs-lisp :range-begin "FileNameHandler" :range-end "-FileNameHandler" :lines "23-25"
 
   However, it is important to reset it eventually. Not doing so will cause garbage
   collection freezes during long-term interactive use. Conversely, a ~gc-cons-threshold~
   that is too small will cause stuttering.
 
-  #+INCLUDE: "./early-init.el" src emacs-lisp :range-begin "AfterInitHook" :range-end "-AfterInitHook" :lines "28-34"
+  #+INCLUDE: "../tools/emacs/early-init.el" src emacs-lisp :range-begin "AfterInitHook" :range-end "-AfterInitHook" :lines "28-34"
 
 One thing though, I am currently not necessarily running Emacs 27, so I am going to need
 to have the same configuration in ~init.el~ for a little bit of time.
 
 /Note: the lowest emacs version I wanna support is 26 (as of today, might evolve)/
 
-#+INCLUDE: "./init.el" src emacs-lisp :range-begin "CheckVer" :range-end "-CheckVer" :lines "3-13"
+#+INCLUDE: "../tools/emacs/init.el" src emacs-lisp :range-begin "CheckVer" :range-end "-CheckVer" :lines "3-13"
 
 We also want our configuration to be working the same on any computer, this means we want
 to define every option by ourselves, not relying on default files (~default.el~) that
@@ -235,17 +234,17 @@
 We also want to inhibit some initial default start messages and screen. The default screen
 will be as bare as possible.
 
-#+INCLUDE: "./init.el" src emacs-lisp :range-begin "Inhibit" :range-end "-Inhibit" :lines "16-20"
+#+INCLUDE: "../tools/emacs/init.el" src emacs-lisp :range-begin "Inhibit" :range-end "-Inhibit" :lines "16-20"
 
 Let's also use =y= or =n= instead of =yes= and =no= when exiting Emacs.
 
-#+INCLUDE: "./init.el" src emacs-lisp :range-begin "Confirm" :range-end "-Confirm" :lines "23-24"
+#+INCLUDE: "../tools/emacs/init.el" src emacs-lisp :range-begin "Confirm" :range-end "-Confirm" :lines "23-24"
 
 One last piece to the puzzle is the default mode. Setting it to fundamental-mode means we
 won't load any /heavy/ mode at startup (like =org-mode=). We also want this scratch buffer
 to be empty, so let's set it as well
 
-#+INCLUDE: "./init.el" src emacs-lisp :range-begin "DefaultMode" :range-end "-DefaultMode" :lines "27-29"
+#+INCLUDE: "../tools/emacs/init.el" src emacs-lisp :range-begin "DefaultMode" :range-end "-DefaultMode" :lines "27-29"
 
 *** Unicode all the way
 :PROPERTIES:
@@ -255,7 +254,7 @@
 By default, all my systems are configured and support =utf-8=, so let's just make it a
 default in Emacs ; and handle special case on demand.
 
-#+INCLUDE: "./init.el" src emacs-lisp :range-begin "Unicode" :range-end "-Unicode" :lines "32-37"
+#+INCLUDE: "../tools/emacs/init.el" src emacs-lisp :range-begin "Unicode" :range-end "-Unicode" :lines "32-37"
 
 *** Package management with =use-package=
 :PROPERTIES:
@@ -281,7 +280,7 @@
 We need to setup the emacs package system and install =use-package= if not present
 already.
 
-#+INCLUDE: "./init.el" src emacs-lisp :range-begin "UsePackageSetup" :range-end "-UsePackageSetup" :lines "40-89"
+#+INCLUDE: "../tools/emacs/init.el" src emacs-lisp :range-begin "UsePackageSetup" :range-end "-UsePackageSetup" :lines "40-89"
 
 *** =custom.el=
 :PROPERTIES:
@@ -292,7 +291,7 @@
 your liking, Emacs will append a piece of elisp to your init file. I prefer to have that
 stored in a separate file.
 
-#+INCLUDE: "./init.el" src emacs-lisp :range-begin "CustomFile" :range-end "-CustomFile" :lines "92-107"
+#+INCLUDE: "../tools/emacs/init.el" src emacs-lisp :range-begin "CustomFile" :range-end "-CustomFile" :lines "92-107"
 
 *** Remove built-in =org-mode=
 :PROPERTIES:
@@ -303,14 +302,14 @@
 configuration) instead of the built-in one. To do that safely, let's remove the built-in
 version out of the load path.
 
-#+INCLUDE: "./init.el" src emacs-lisp :range-begin "NoBuiltinOrg" :range-end "-NoBuiltinOrg" :lines "110-116"
+#+INCLUDE: "../tools/emacs/init.el" src emacs-lisp :range-begin "NoBuiltinOrg" :range-end "-NoBuiltinOrg" :lines "110-116"
 
 *** Pinentry
 :PROPERTIES:
 :CUSTOM_ID: h:1f016a1a-f4ef-4ef0-be01-1fd68ca0d951
 :END:
 
-#+INCLUDE: "./init.el" src emacs-lisp :range-begin "Pinentry" :range-end "-PinEntry" :lines "119-123"
+#+INCLUDE: "../tools/emacs/init.el" src emacs-lisp :range-begin "Pinentry" :range-end "-PinEntry" :lines "119-123"
 
 *** Loading configuration files
 :PROPERTIES:
@@ -327,29 +326,29 @@
 
 Let's define some functions that would do the job.
 
-#+INCLUDE: "./init.el" src emacs-lisp :range-begin "LoadCfgFunc" :range-end "-LoadCfgFunc" :lines "126-136"
+#+INCLUDE: "../tools/emacs/init.el" src emacs-lisp :range-begin "LoadCfgFunc" :range-end "-LoadCfgFunc" :lines "126-136"
 
 Let's define some constants early, based on the system, and the environment, to be able to
 use those later on to skip some package or change some configuration accordingly.
 
-#+INCLUDE: "./init.el" src emacs-lisp :range-begin "CfgConstant" :range-end "-CfgConstant" :lines "139-170"
+#+INCLUDE: "../tools/emacs/init.el" src emacs-lisp :range-begin "CfgConstant" :range-end "-CfgConstant" :lines "139-170"
 
 Now, in order to load ~lisp~ and ~config~ files, it's just a matter of calling this
 function with the right argument.
 
-#+INCLUDE: "./init.el" src emacs-lisp :range-begin "CfgLoad" :range-end "-CfgLoad" :lines "173-176"
+#+INCLUDE: "../tools/emacs/init.el" src emacs-lisp :range-begin "CfgLoad" :range-end "-CfgLoad" :lines "173-176"
 
 Finally, I want to be able to load files for a specific machine, in case I need it (not
 entirely sure why yet but…)
 
-#+INCLUDE: "./init.el" src emacs-lisp :range-begin "CfgHostLoad" :range-end "-CfgHostLoad" :lines "179-181"
+#+INCLUDE: "../tools/emacs/init.el" src emacs-lisp :range-begin "CfgHostLoad" :range-end "-CfgHostLoad" :lines "179-181"
 
 *** Counting the time of loading
 :PROPERTIES:
 :CUSTOM_ID: h:2b645e95-6776-4f5b-a318-e5a915943881
 :END:
 
-#+INCLUDE: "./init.el" src emacs-lisp :range-begin "LastInit" :range-end "-LastInit" :lines "184-195"
+#+INCLUDE: "../tools/emacs/init.el" src emacs-lisp :range-begin "LastInit" :range-end "-LastInit" :lines "184-195"
 
 ** ~PATH~'s customization
 :PROPERTIES:
@@ -492,7 +491,7 @@
 My current setup involves a =emacs --daemon= systemd service. We want to start the server
 if it's not already running, so that =emacsclient= can connect to it.
 
-#+INCLUDE: "./config/01-server.el" src emacs-lisp :range-begin "UseServer" :range-end "-UseServer" :lines "4-6"
+#+INCLUDE: "../tools/emacs/config/01-server.el" src emacs-lisp :range-begin "UseServer" :range-end "-UseServer" :lines "4-6"
 
 * TODO Selection candidates and search methods
 :PROPERTIES:
@@ -561,7 +560,7 @@
 
 First, let's define some basic constants, mainly on how my main =org= folder is organized.
 
-#+INCLUDE: "./config/setup-org.el" src emacs-lisp :range-begin "OrgConstants" :range-end "-OrgConstants" :lines "4-14"
+#+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgConstants" :range-end "-OrgConstants" :lines "4-14"
 
 In a nutshell, I am currently trying the following organization, with =~/desktop/org/= as
 the base of almost all =org-mode= things:
@@ -592,7 +591,7 @@
 =inbox.org=. For this, we can use the emacs [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Registers.html][registers]] and more accurately the [[https://www.gnu.org/software/emacs/manual/html_node/emacs/File-Registers.html#File-Registers][file
 registers]].
 
-#+INCLUDE: "./config/setup-org.el" src emacs-lisp :range-begin "OrgRegisters" :range-end "-OrgRegisters" :lines "17-22"
+#+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgRegisters" :range-end "-OrgRegisters" :lines "17-22"
 
 With this, I can jump to the inbox with ~C-x r j i~, to the journal using ~C-x r j j~, …
 
@@ -685,7 +684,7 @@
 /The =ensure org-plus-contrib= is there to make sure I am loading the =org= module from my
 nix configuration and not the built-in =org= module (that might lag in terms of version)/
 
-#+INCLUDE: "./config/setup-org.el" src emacs-lisp :range-begin "OrgMain" :range-end "-OrgMain" :lines "25-92"
+#+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgMain" :range-end "-OrgMain" :lines "25-92"
 
 I've set-up an =org-mode= hook to add few modes to the default setup.
 - I am really annoyed by trailing white-space so I want them to be shown
@@ -694,15 +693,15 @@
   + I turn on =auto-revert-mode= so that the buffer is always up-to-date.
   + I like to have header indented, so I'm enabling =org-indent-mode=.
 
-#+INCLUDE: "./config/setup-org.el" src emacs-lisp :range-begin "OrgHook" :range-end "-OrgHook" :lines "95-104"
+#+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgHook" :range-end "-OrgHook" :lines "95-104"
 
 Let's also use =org-id=…
 
-#+INCLUDE: "./config/setup-org.el" src emacs-lisp :range-begin "OrgId" :range-end "-OrgId" :lines "107-136"
+#+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgId" :range-end "-OrgId" :lines "107-136"
 
 … and =org-crypt= (for encrypted =org-mode= files).
 
-#+INCLUDE: "./config/setup-org.el" src emacs-lisp :range-begin "OrgCrypt" :range-end "-OrgCrypt" :lines "139-144"
+#+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgCrypt" :range-end "-OrgCrypt" :lines "139-144"
 
 **** TODO Refiling
 :PROPERTIES:
@@ -737,11 +736,11 @@
 agenda views. This allows to group things and overall set-up the agenda view I want. This
 agenda view uses the =n= key.
 
-#+INCLUDE: "./config/setup-org.el" src emacs-lisp :range-begin "OrgAgenda" :range-end "-OrgAgenda" :lines "147-196"
+#+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgAgenda" :range-end "-OrgAgenda" :lines "147-196"
 
 Let's try to get my work calendar entries in my agenda too. It is a little bit tricky 👼.
 
-#+INCLUDE: "./config/setup-org.el" src emacs-lisp :range-begin "OrgGcal" :range-end "-OrgGcal" :lines "199-213"
+#+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgGcal" :range-end "-OrgGcal" :lines "199-213"
 
 *** Habits                                                         :ATTACH:
 :PROPERTIES:
@@ -774,14 +773,14 @@
 
 [[att:2020-02-29-14-41-59.png]]
 
-#+INCLUDE: "./config/setup-org.el" src emacs-lisp :range-begin "OrgHabit" :range-end "-OrgHabit" :lines "216-221"
+#+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgHabit" :range-end "-OrgHabit" :lines "216-221"
 
 *** TODO Sources
 :PROPERTIES:
 :CUSTOM_ID: h:82c3b800-9d80-408d-b3b6-54dc15b0590c
 :END:
 
-#+INCLUDE: "./config/setup-org.el" src emacs-lisp :range-begin "OrgSrc" :range-end "-OrgSrc" :lines "224-231"
+#+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgSrc" :range-end "-OrgSrc" :lines "224-231"
 
 *** TODO Capture
 :PROPERTIES:
@@ -798,7 +797,7 @@
 options. This is very interesting when you want to group some capture template together
 (like templates related to /work/, …).
 
-#+INCLUDE: "./config/setup-org.el" src emacs-lisp :range-begin "OrgCaptureStart" :range-end "-OrgCaptureStart" :lines "234-238"
+#+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgCaptureStart" :range-end "-OrgCaptureStart" :lines "234-238"
 
 Some of my capture template are big and hard to read if embedded in the =emacs-lisp=
 code. The good thing is that =org-mode= is able to load the template from files too 💃.
@@ -806,44 +805,44 @@
 Here is a list of my templates:
 - Default :: Store a link (mainly used with =org-protocol=) and take a random note
 
-  #+INCLUDE: "./config/setup-org.el" src emacs-lisp :range-begin "OrgCaptureOldTemplate" :range-end "-OrgCaptureOldTemplate" :lines "241-250"
+  #+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgCaptureOldTemplate" :range-end "-OrgCaptureOldTemplate" :lines "241-250"
 
 - Tasks :: /work/ task, like reviewing a PR, or cleaning a folder.
 
-  #+INCLUDE: "./config/setup-org.el" src emacs-lisp :range-begin "OrgCaptureTask" :range-end "-OrgCaptureTask" :lines "253-265"
+  #+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgCaptureTask" :range-end "-OrgCaptureTask" :lines "253-265"
 
 - journaling :: As I use =org-mode= for my /journal/ too, I need capture entry for
   it. I currently have two types of journal entry :
 
-  #+INCLUDE: "./config/setup-org.el" src emacs-lisp :range-begin "OrgCaptureJournalBase" :range-end "-OrgCaptureJournalBase" :lines "268-270"
+  #+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgCaptureJournalBase" :range-end "-OrgCaptureJournalBase" :lines "268-270"
 
   + standard: one title and some text
 
-    #+INCLUDE: "etc/orgmode/journal.org" src org
+    #+INCLUDE: "../tools/emacs/etc/orgmode/journal.org" src org
 
-    #+INCLUDE: "./config/setup-org.el" src emacs-lisp :range-begin "OrgCaptureJournalEntry" :range-end "-OrgCaptureJournalEntry" :lines "273-280"
+    #+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgCaptureJournalEntry" :range-end "-OrgCaptureJournalEntry" :lines "273-280"
 
   + worklog: related to work, to be able to say what I did, what I wanted to do, problems,
     … during the daily
 
-    #+INCLUDE: "etc/orgmode/worklog.org" src org
+    #+INCLUDE: "../tools/emacs/etc/orgmode/worklog.org" src org
 
-    #+INCLUDE: "./config/setup-org.el" src emacs-lisp :range-begin "OrgCaptureWorklog" :range-end "-OrgCaptureWorklog" :lines "283-288"
+    #+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgCaptureWorklog" :range-end "-OrgCaptureWorklog" :lines "283-288"
 
 - weekly review :: each and every week, I am going through this item to make my review of
   the week.
 
-  #+INCLUDE: "etc/orgmode/weekly.org" src org
+  #+INCLUDE: "../tools/emacs/etc/orgmode/weekly.org" src org
 
-  #+INCLUDE: "./config/setup-org.el" src emacs-lisp :range-begin "OrgCaptureWeekly" :range-end "-OrgCaptureWeekly" :lines "291-296"
+  #+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgCaptureWeekly" :range-end "-OrgCaptureWeekly" :lines "291-296"
 
 - blog posts ::
 
-  #+INCLUDE: "./config/setup-org.el" src emacs-lisp :range-begin "OrgCaptureBlog" :range-end "-OrgCaptureBlog" :lines "299-309"
+  #+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgCaptureBlog" :range-end "-OrgCaptureBlog" :lines "299-309"
 
-#+INCLUDE: "./config/setup-org.el" src emacs-lisp :range-begin "OrgCaptureEnd" :range-end "-OrgCaptureEnd" :lines "312-313"
+#+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgCaptureEnd" :range-end "-OrgCaptureEnd" :lines "312-313"
 
-#+INCLUDE: "./config/setup-org.el" src emacs-lisp :range-begin "OrgProtocol" :range-end "-OrgProtocol" :lines "316-318"
+#+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgProtocol" :range-end "-OrgProtocol" :lines "316-318"
 
 *** Clocking
 :PROPERTIES:
@@ -863,32 +862,32 @@
 In addition to that workflow, I want to switch the state of the task to =STARTED= when I
 am clocking-in, if it's not already =STARTED=.
 
-#+INCLUDE: "./config/setup-org.el" src emacs-lisp :range-begin "OrgClock" :range-end "-OrgClock" :lines "321-414"
+#+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgClock" :range-end "-OrgClock" :lines "321-414"
 
 *** TODO Links
 :PROPERTIES:
 :CUSTOM_ID: h:afc81fbb-f7a0-401c-8b56-19f51edebd88
 :END:
 
-#+INCLUDE: "./config/setup-org.el" src emacs-lisp :range-begin "OrgAttach" :range-end "-OrgAttach" :lines "417-420"
+#+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgAttach" :range-end "-OrgAttach" :lines "417-420"
 
-#+INCLUDE: "./config/setup-org.el" src emacs-lisp :range-begin "OrgLinks" :range-end "-OrgLinks" :lines "423-448"
+#+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgLinks" :range-end "-OrgLinks" :lines "423-448"
 
 *** TODO Litterate programming
 :PROPERTIES:
 :CUSTOM_ID: h:b5f6beba-6195-4ff0-a194-502ac2a9e3da
 :END:
 
-#+INCLUDE: "./config/setup-org.el" src emacs-lisp :range-begin "OrgBabel" :range-end "-OrgBabel" :lines "451-459"
+#+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgBabel" :range-end "-OrgBabel" :lines "451-459"
 
 *** TODO Exporting
 :PROPERTIES:
 :CUSTOM_ID: h:afad00e0-367c-4c7b-b191-e3ed72be754b
 :END:
 
-#+INCLUDE: "./config/setup-org.el" src emacs-lisp :range-begin "OrgExportConstants" :range-end "-OrgExportConstants" :lines "462-464"
+#+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgExportConstants" :range-end "-OrgExportConstants" :lines "462-464"
 
-#+INCLUDE: "./config/setup-org.el" src emacs-lisp :range-begin "OrgExportCfg" :range-end "-OrgExportCfg" :lines "467-478"
+#+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgExportCfg" :range-end "-OrgExportCfg" :lines "467-478"
 
 ** TODO Email and newsgroup
 :PROPERTIES:
@@ -918,7 +917,7 @@
 Before configuring any email client, we need to establish some essentials: who we are,
 where our credentials are stored and whether encryption is supported.
 
-#+INCLUDE: "./config/setup-mails.el" src emacs-lisp :range-begin "AuthSource" :range-end "-AuthSource" :lines "4-9"
+#+INCLUDE: "../tools/emacs/config/setup-mails.el" src emacs-lisp :range-begin "AuthSource" :range-end "-AuthSource" :lines "4-9"
 
 *** Gnus
 :PROPERTIES:
@@ -977,11 +976,11 @@
 - [[http://www.cataclysmicmutation.com/2010/11/multiple-gmail-accounts-in-gnus/][Multiple GMail Accounts in Gnus - Cataclysmic Mutation]]
 - [[https://github.com/redguardtoo/mastering-emacs-in-one-year-guide/blob/master/gnus-guide-en.org][mastering-emacs-in-one-year-guide/gnus-guide-en.org at master · redguardtoo/mastering-emacs-in-one-year-guide]]
 
-#+INCLUDE: "./config/setup-mails.el" src emacs-lisp :range-begin "GnusCfg" :range-end "-GnusCfg" :lines "20-77"
+#+INCLUDE: "../tools/emacs/config/setup-mails.el" src emacs-lisp :range-begin "GnusCfg" :range-end "-GnusCfg" :lines "20-77"
 
 Let's also give to gnus my GnuPG key.
 
-#+INCLUDE: "./config/setup-mails.el" src emacs-lisp :range-begin "GnusMmlSec" :range-end "-GnusMmlSec" :lines "80-84"
+#+INCLUDE: "../tools/emacs/config/setup-mails.el" src emacs-lisp :range-begin "GnusMmlSec" :range-end "-GnusMmlSec" :lines "80-84"
 
 
 **** Gnus agent
@@ -998,7 +997,7 @@
 local messages.  For example, we can set an expiry date, after which the message is
 deleted, or we can create a queue of outgoing messages when Gnus is in an unplugged state.
 
-#+INCLUDE: "./config/setup-mails.el" src emacs-lisp :range-begin "GnusAgent" :range-end "-GnusAgent" :lines "87-101"
+#+INCLUDE: "../tools/emacs/config/setup-mails.el" src emacs-lisp :range-begin "GnusAgent" :range-end "-GnusAgent" :lines "87-101"
 
 **** Gnus asynchronous operations
 :PROPERTIES:
@@ -1009,7 +1008,7 @@
 is blocked until Gnus has finished. By enabling this library, we can use certain functions
 in a non-blocking way. I do this for [[#h:8cd8c972-ba38-40c2-b30f-68a4233593d6][sending email]].
 
-#+INCLUDE: "./config/setup-mails.el" src emacs-lisp :range-begin "GnusAsync" :range-end "-GnusAsync" :lines "104-109"
+#+INCLUDE: "../tools/emacs/config/setup-mails.el" src emacs-lisp :range-begin "GnusAsync" :range-end "-GnusAsync" :lines "104-109"
 
 **** Gnus group
 :PROPERTIES:
@@ -1035,7 +1034,7 @@
 Note that =gnus-group-sort-functions= requires the most important function to be declared
 last.
 
-#+INCLUDE: "./config/setup-mails.el" src emacs-lisp :range-begin "GnusGroup" :range-end "-GnusGroup" :lines "112-128"
+#+INCLUDE: "../tools/emacs/config/setup-mails.el" src emacs-lisp :range-begin "GnusGroup" :range-end "-GnusGroup" :lines "112-128"
 
 **** Gnus Summary
 :PROPERTIES:
@@ -1054,7 +1053,7 @@
 was within the day or the one before, else falls back to a default value. It is then
 called with =%&user-date;=.
 
-#+INCLUDE: "./config/setup-mails.el" src emacs-lisp :range-begin "GnusSummary" :range-end "-GnusSummary" :lines "140-183"
+#+INCLUDE: "../tools/emacs/config/setup-mails.el" src emacs-lisp :range-begin "GnusSummary" :range-end "-GnusSummary" :lines "140-183"
 
 Gnus summary displays a mark for each messages, those `O`, `!`, … Let's first describe
 what are those marks (from the [[https://www.gnu.org/software/emacs/manual/html_node/gnus/Marking-Articles.html#Marking-Articles][documentation]]) and which one make the more sense for me.
@@ -1098,7 +1097,7 @@
 "gnus" to see all the relevant key bindings and the functions they call. I only ever use
 =C-c C-m C-a= (=C-m= is the same as =RET=).
 
-#+INCLUDE: "./config/setup-mails.el" src emacs-lisp :range-begin "GnusDired" :range-end "-GnusDired" :lines "186-189"
+#+INCLUDE: "../tools/emacs/config/setup-mails.el" src emacs-lisp :range-begin "GnusDired" :range-end "-GnusDired" :lines "186-189"
 
 **** TODO Searching mails
 :PROPERTIES:
@@ -1115,16 +1114,16 @@
 :CUSTOM_ID: h:8cd8c972-ba38-40c2-b30f-68a4233593d6
 :END:
 
-#+INCLUDE: "./config/setup-mails.el" src emacs-lisp :range-begin "SendmailCfg" :range-end "-SendmailCfg" :lines "193-207"
+#+INCLUDE: "../tools/emacs/config/setup-mails.el" src emacs-lisp :range-begin "SendmailCfg" :range-end "-SendmailCfg" :lines "193-207"
 
-#+INCLUDE: "./config/setup-mails.el" src emacs-lisp :range-begin "MessageCfg" :range-end "-MessageCfg" :lines "210-221"
+#+INCLUDE: "../tools/emacs/config/setup-mails.el" src emacs-lisp :range-begin "MessageCfg" :range-end "-MessageCfg" :lines "210-221"
 
 *** TODO ~notmuch~ configuration
 :PROPERTIES:
 :CUSTOM_ID: h:b67b377e-0fbc-4237-857c-641cdf2de1cf
 :END:
 
-#+INCLUDE: "./config/setup-mails.el" src emacs-lisp :range-begin "Notmuch" :range-end "-Notmuch" :lines "224-241"
+#+INCLUDE: "../tools/emacs/config/setup-mails.el" src emacs-lisp :range-begin "Notmuch" :range-end "-Notmuch" :lines "224-241"
 
 * User interface and interactions
 :PROPERTIES:
@@ -1202,9 +1201,7 @@
 
   [[att:2020-03-03-21-57-41.png]]
 
-#+INCLUDE: lisp/shortbrain-light-theme.el src emacs-lisp
-
-See [[https://github.com/vdemeester/emacs-config/blob/master/lisp/shortbrain-light-theme.el][=lisp/shortbrain-light-theme.el=]].
+#+INCLUDE: ../tools/emacs/lisp/shortbrain-light-theme.el src emacs-lisp
 
 **** Dark theme
 :PROPERTIES:
@@ -1215,15 +1212,44 @@
 
   [[att:2020-03-03-21-59-22.png]]
 
-#+INCLUDE: lisp/shortbrain-theme.el src emacs-lisp
-
-See [[https://github.com/vdemeester/emacs-config/blob/master/lisp/shortbrain-theme.el][=lisp/shortbrain-theme.el=]].
+#+INCLUDE: ../tools/emacs/lisp/shortbrain-theme.el src emacs-lisp
 
 * TODO Programming
 :PROPERTIES:
 :CUSTOM_ID: h:635a27c4-5ff9-46e4-8d42-283d316cf4d6
 :END:
 
+* Nix-ies
+:PROPERTIES:
+:CUSTOM_ID: h:8bc69da9-b49c-4ddd-a6c9-b944aad993a1
+:END:
+
+This is where the magic happens, when using [[https://nixos.org/nix/][~nix~]] or [[https://nixos.org][NixOS]] with [[https://github.com/rycee/home-manager][~home-manager~]]. In a gist
+we will create a set of nix files that tangle, get dependencies and generate the correct
+emacs package with the packages used inside the configuration. This means, if I add a
+=(use-package magit)= in my configuration, and I tangle / re-execute this script(s), I now
+have a new packaged installed as part of my Emacs package. This is *heavily* inspired by
+[[https://matthewbauer.us/bauer/][Matthew Bauer's bauer]] emacs configuration.
+
+** Required lisp libraries
+:PROPERTIES:
+:CUSTOM_ID: h:316fd3ee-ab99-4f01-ba5a-1a91c54bc334
+:END:
+
+We need a way to list packages used in the configuration using ~use-package~. This is
+coming straight from [[https://matthewbauer.us/bauer/][Matthew Bauer's bauer]].
+
+#+INCLUDE: ../tools/emacs/lisp/use-package-list.el src emacs-lisp
+
+The idea is to run some like the following.
+
+#+begin_src bash :tangle no
+emacs --batch --quick \
+      -L /nix/store/acm9rskhx237xb16zdy7vx6r1m5n8q58-emacs-packages-deps/share/emacs/site-lisp/elpa/use-package-20191126.2034/use-package-* \
+      -l /home/vincent/.emacs.d/lisp/use-package-list.el \
+      --eval "(use-package-list \"/home/vincent/.emacs.d/init.el\")"
+#+end_src
+
 * External libraries
 :PROPERTIES:
 :CUSTOM_ID: h:96ce2856-182e-42c8-a8b3-418c38124dcc
@@ -1234,7 +1260,7 @@
 :CUSTOM_ID: h:bd8804a0-df0e-4aca-b748-429ea9402cd6
 :END:
 
-#+INCLUDE: lisp/use-package-list.el src emacs-lisp
+#+INCLUDE: ../tools/emacs/lisp/use-package-list.el src emacs-lisp
 
 ** ~gotest-ui.el~
 :PROPERTIES:
@@ -1243,7 +1269,7 @@
 
 From [[https://github.com/antifuchs/gotest-ui-mode/][antifuchs/gotest-ui-mode]].
 
-#+INCLUDE: lisp/gotest-ui.el src emacs-lisp
+#+INCLUDE: ../tools/emacs/lisp/gotest-ui.el src emacs-lisp
 
 ** Org mode links
 :PROPERTIES:
@@ -1254,18 +1280,18 @@
 
 - ~ol-github.el~: link to GitHub repositories, issues and pull-requests.
 
-  #+INCLUDE: lisp/ol-github.el src emacs-lisp
+  #+INCLUDE: ../tools/emacs/lisp/ol-github.el src emacs-lisp
 
 - ~ol-gitlab.el~: link to GitLab repositories, issues and merge-requests.
 
-  #+INCLUDE: lisp/ol-gitlab.el src emacs-lisp
+  #+INCLUDE: ../tools/emacs/lisp/ol-gitlab.el src emacs-lisp
 
 - ~ol-ripgrep.el~: link to a =ripgrep= search buffer.
 
-  #+INCLUDE: lisp/ol-ripgrep.el src emacs-lisp
+  #+INCLUDE: ../tools/emacs/lisp/ol-ripgrep.el src emacs-lisp
 
 - ~ol-grep.el~: link to a =grep= search buffer.
 
-  #+INCLUDE: lisp/ol-grep.el src emacs-lisp
+  #+INCLUDE: ../tools/emacs/lisp/ol-grep.el src emacs-lisp
 
 And that's all folks 💃
docs/index.org
@@ -1,5 +1,4 @@
 #+TITLE: Configurations
-#+OPTIONS: toc:nil
 #+FILETAGS: @home infra configuration dotfiles
 
 This set of pages and articles are describing and discussion my
@@ -32,4 +31,4 @@
 Those are =work-in-progress= document, that needs to be refined, redefined or completed.
 
 - [[file:mails.org][My email setup]]
-- [[file:emacs.old.org][Vincent Demeester's .emacs.d]]
+- [[file:emacs.org][Vincent Demeester's .emacs.d]]