I showed you my source code, pls respond
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

180 lines
7.5 KiB

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
  1. #+TITLE: Dotfiles
  2. #+AUTHOR: Christopher James Hayward
  3. #+EMAIL: chris@chrishayward.xyz
  4. #+PROPERTY: header-args:emacs-lisp :tangle init.el :comments org
  5. #+PROPERTY: header-args :results silent :eval no-export
  6. #+OPTIONS: num:nil toc:nil todo:nil tasks:nil tags:nil
  7. #+OPTIONS: skip:nil author:nil email:nil creator:nil timestamp:nil
  8. #+ATTR_ORG: :width 420px
  9. #+ATTR_HTML: :width 420px
  10. #+ATTR_LATEX: :width 420px
  11. [[./docs/images/desktop-alt.png]]
  12. Portable [[https://gnu.org/software/emacs][GNU/Emacs]][fn:1] dotfiles. Built for Life, Liberty, and the Open Road.
  13. + 100% Literate
  14. + 100% Immutable
  15. + 100% Reproducible
  16. * Options
  17. All of the options available for configuration are defined here. They may be overriden in a host configuration, and are read by the definitions in the modules. All of the variables are prefixed with ~dotfiles/~ to avoid name collision with other functions and packages. All of the available modules are defined in ~dotfiles/modules-p~. The variable is constant, meaning it cannot be modified. Each time a new module is added, it must be included in this list.
  18. #+begin_src emacs-lisp
  19. (defconst dotfiles/modules-p
  20. '(core
  21. editor
  22. shell
  23. email
  24. terminal
  25. encryption
  26. desktop
  27. writing
  28. presentations
  29. website
  30. capture
  31. projects
  32. development
  33. interface
  34. dashboard)
  35. "All of the available modules.")
  36. #+end_src
  37. After the host configuration has loaded, the modules defined in ~dotfiles/modules~ are loaded sequentially. By default, the value of ~dotfiles/modules~ is equal to ~dotfiles/modules-p~. This means that all of the modules will load by default. Remove symbols from this list in a host configuration, or override it entirely to modify this behaviour.
  38. #+begin_src emacs-lisp
  39. (defvar dotfiles/modules dotfiles/modules-p
  40. "All of the enable modules, default value equal to `dotfiles/modules-p'.")
  41. #+end_src
  42. ** Environment variables
  43. Some of the behaviour in Emacs depends on the values of mutable environment variables. To reduce confusion in my own configuration, the values are read when Emacs starts, and then written to once the configuration has loaded. This allows the values to be overriden in a host configuration, without modifying the environment variable prior to starting.
  44. #+begin_src emacs-lisp
  45. (defvar dotfiles/browser (getenv "BROWSER")
  46. "Default system web browser.")
  47. (defvar dotfiles/language (getenv "LANG")
  48. "Default system dictionary language.")
  49. #+end_src
  50. ** Look and feel
  51. Define the options for the unified system font. The default is =Fira Code= due to its readability and support for ligatures. All font faces will be set with this value. Any variations to the font sizes are based on the value defined here as well, reducing the number of places to make modifications to when changing fonts.
  52. #+begin_src emacs-lisp
  53. (defvar dotfiles/font "Fira Code"
  54. "Unified system font family.")
  55. (defvar dotfiles/font-size 96
  56. "Unified system font size.")
  57. #+end_src
  58. Certain actions like code completions, or binding suggestions, can be configured to wait for a specific delay before offering their respective choices. I prefer to keep this value low, so that suggestions are shown immediately. This can have an affect on the performance of Emacs on older hardware. Adjust accordingly.
  59. #+begin_src emacs-lisp
  60. (defvar dotfiles/idle 0.0
  61. "Delay time before offering suggestions and completions.")
  62. #+end_src
  63. Prefix all of the custom keybinding actions with =SPC=, a tehcnique that comes from Doom / Spacemacs. In some situations, namely when using the [[file:modules/desktop.org][Desktop]] module, the leader key may not always be available. The global prefix should be used in these circumstances.
  64. #+begin_src emacs-lisp
  65. (defvar dotfiles/leader-key "SPC"
  66. "The all-powerful leader key.")
  67. (defvar dotfiles/leader-key-global
  68. (concat "C-" dotfiles/leader-key)
  69. "Global prefix for the all-powerful leader key.")
  70. #+end_src
  71. ** Productivity
  72. The location of source code projects for indexing in the [[file:modules/projects.org][Projects]] module are defined here. These projects will integrate their TODOs with the local Agenda. Override this setting in a host configuration, with the =DOTFILES_PROJECTS= environment variable, or use the default value of =~/.local/source/= in compliance with the XDG Base Directory specification.
  73. #+begin_src emacs-lisp
  74. (defvar dotfiles/projects
  75. (or (getenv "DOTFILES_PROJECTS")
  76. (expand-file-name "~/.local/source"))
  77. "Location of source code projects.")
  78. #+end_src
  79. ** Security
  80. The local password store should be cloned prior to initialization. Override this setting in a host configuration, with the =DOTFILES_PASSWORDS= environment variable, or use the default value of =~/.password-store=, which is what GNU pass will assume.
  81. #+begin_src emacs-lisp
  82. (defvar dotfiles/passwords
  83. (or (getenv "DOTFILES_PASSWORDS")
  84. (expand-file-name "~/.password-store"))
  85. "Location of the local password store.")
  86. #+end_src
  87. Since I keep all of my writing in this repository, I encrypt *most* of my Org files with GPG. Define the key to encrypt them for / to. Override this in a host configuration file.
  88. #+begin_src emacs-lisp
  89. (defvar dotfiles/public-key "37AB1CB72B741E478CA026D43025DCBD46F81C0F"
  90. "GPG kley to encrpy org files for/to.")
  91. #+end_src
  92. * Hosts
  93. Each host machines configuration loaded immediately after declaring the options, before applying any configuration. This allows system to system control while remaining immutable. Override any of the available options configurations in a host file. Here's some examples to get started:
  94. + [[file:hosts/acernitro.org][Acernitro]]
  95. + [[file:hosts/gamingpc.org][GamingPC]]
  96. + [[file:hosts/localhost.org][Termux]]
  97. + [[file:hosts/raspberry.org][Raspberry]]
  98. + [[file:hosts/virtualbox.org][VirtualBox]]
  99. Begin the process by loading any host specific option overrides. The host configuration tangles, and loads (if it exist) using the systems name. If a host definition doesn't exist the default values remain.
  100. #+begin_src emacs-lisp
  101. (let ((host-file (concat dotfiles/home "/hosts/" system-name ".org")))
  102. (when (file-exists-p host-file)
  103. (org-babel-load-file host-file)))
  104. #+end_src
  105. * Modules
  106. 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. Below are details of the modules, and their respective dependencies.
  107. + [[file:modules/capture.org][Capture]]
  108. + [[file:modules/core.org][Core]]
  109. + [[file:modules/dashboard.org][Dashboard]]
  110. + [[file:modules/desktop.org][Desktop]]
  111. + [[file:modules/development.org][Development]]
  112. + [[file:modules/editor.org][Editor]]
  113. + [[file:modules/email.org][Email]]
  114. + [[file:modules/encryption.org][Encryption]]
  115. + [[file:modules/interface.org][Interface]]
  116. + [[file:modules/presentations.org][Presentations]]
  117. + [[file:modules/projects.org][Projects]]
  118. + [[file:modules/shell.org][Shell]]
  119. + [[file:modules/terminal.org][Terminal]]
  120. + [[file:modules/website.org][Website]]
  121. + [[file:modules/writing.org][Writing]]
  122. All of the modules in ~dotfiles/modules~ load after the host overrides. By default, all of the packages defined in ~dotfiles/modules-p~ load. Override this behaviour in a host configuration file.
  123. #+begin_src emacs-lisp
  124. (dolist (m dotfiles/modules)
  125. (let ((mod-file (concat dotfiles/home "/modules/" (symbol-name m) ".org")))
  126. (when (file-exists-p mod-file)
  127. (org-babel-load-file mod-file))))
  128. #+end_src
  129. * Footnotes
  130. [fn:1] https://gnu.org/software/emacs
  131. [fn:2] https://orgmode.org/worg/org-contrib/babel/intro.html
  132. [fn:3] https://orgmode.org
  133. [fn:4] https://gnu.org/software/emacs/manual/html_node/elisp/index.html