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.

175 lines
6.8 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
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. * Init
  17. This project makes heavy use of modern features and libraries. Since [[https://orgmode.org/worg/org-contrib/babel/intro.html][Org-babel]][fn:2]'s used during the initialization, [[https://orgmode.org][Org-mode]][fn:3] must load prior to importing any custom modules. My solution includes the introduction of some early intitialization code written in [[https://gnu.org/software/emacs/manual/html_node/elisp/index.html][Emacs Lisp]][fn:4].
  18. #+begin_src emacs-lisp
  19. (load-file "~/.emacs.d/bin/options.el")
  20. (load-file "~/.emacs.d/bin/cleanup.el")
  21. (load-file "~/.emacs.d/bin/packages.el")
  22. #+end_src
  23. ** Load host definition
  24. 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.
  25. #+begin_src emacs-lisp
  26. (let ((host-file (concat dotfiles/home "/hosts/" system-name ".org")))
  27. (when (file-exists-p host-file)
  28. (org-babel-load-file host-file)))
  29. #+end_src
  30. ** Load enabled modules
  31. 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.
  32. #+begin_src emacs-lisp
  33. (dolist (m dotfiles/modules)
  34. (let ((mod-file (concat dotfiles/home "/modules/" (symbol-name m) ".org")))
  35. (when (file-exists-p mod-file)
  36. (org-babel-load-file mod-file))))
  37. #+end_src
  38. * Hosts
  39. 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:
  40. + [[file:hosts/acernitro.org][Acernitro]]
  41. + [[file:hosts/gamingpc.org][GamingPC]]
  42. + [[file:hosts/localhost.org][Termux]]
  43. + [[file:hosts/raspberry.org][Raspberry]]
  44. + [[file:hosts/virtualbox.org][VirtualBox]]
  45. * Modules
  46. 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.
  47. #+begin_src plantuml :file docs/images/modules.png :exports none
  48. left to right direction
  49. allowmixing
  50. package Core
  51. package Editor
  52. package Shell
  53. package Email
  54. package Terminal
  55. package Encryption
  56. package Desktop
  57. package Writing
  58. package Presentations
  59. package Website
  60. package Capture
  61. package Projects
  62. package Development
  63. package Interface
  64. package Dashboard
  65. Editor --> Core
  66. Shell --> Editor
  67. Email --> Editor
  68. Projects --> Editor
  69. Terminal --> Editor
  70. Interface --> Editor
  71. Encryption --> Editor
  72. Desktop --> Shell
  73. Writing --> Encryption
  74. Capture --> Writing
  75. Website --> Writing
  76. Presentations --> Writing
  77. Development --> Projects
  78. Dashboard --> Interface
  79. #+end_src
  80. #+ATTR_ORG: :width 420px
  81. #+ATTR_HTML: :width 420px
  82. #+ATTR_LATEX: :width 420px
  83. [[./docs/images/modules.png]]
  84. + [[file:modules/capture.org][Capture]]
  85. + [[file:modules/core.org][Core]]
  86. + [[file:modules/dashboard.org][Dashboard]]
  87. + [[file:modules/desktop.org][Desktop]]
  88. + [[file:modules/development.org][Development]]
  89. + [[file:modules/editor.org][Editor]]
  90. + [[file:modules/email.org][Email]]
  91. + [[file:modules/encryption.org][Encryption]]
  92. + [[file:modules/interface.org][Interface]]
  93. + [[file:modules/presentations.org][Presentations]]
  94. + [[file:modules/projects.org][Projects]]
  95. + [[file:modules/shell.org][Shell]]
  96. + [[file:modules/terminal.org][Terminal]]
  97. + [[file:modules/website.org][Website]]
  98. + [[file:modules/writing.org][Writing]]
  99. * Options
  100. Here's a complete list of all of the options configurable for each host, and their default values.
  101. + All variables prefixed with ~dotfiles/~
  102. + Initialized prior to loading of packages or hosts
  103. ** Constants
  104. | Symbol | Default | Description |
  105. |----------------------+------------------+---------------------------------------------|
  106. | ~dotfiles/home~ | =~/.emacs.d= | Origininal value of ~user-emacs-directory~. |
  107. | ~dotfiles/cache~ | =~/.cache/emacs= | Redirection target of ~user-emacs-dictory~. |
  108. | ~dotfiles/modules-p~ | [[file:modules/][Modules]] | All of the available system modules. |
  109. ** Variables
  110. | Symbol | Default | Description |
  111. |------------------------------+-------------------------+-----------------------------------|
  112. | ~dotfiles/browser~ | =$BROWSER= | Default system web browser. |
  113. | ~dotfiles/language~ | =$LANG= | Default system language. |
  114. |------------------------------+-------------------------+-----------------------------------|
  115. | ~dotfiles/modules~ | ~dotfiles/modules-p~ | All of the enabled modules. |
  116. |------------------------------+-------------------------+-----------------------------------|
  117. | ~dotfiles/font~ | Fira Code | Unified system font family. |
  118. | ~dotfiles/font-size~ | 96 | Unified system font size. |
  119. |------------------------------+-------------------------+-----------------------------------|
  120. | ~dotfiles/idle~ | 0.0 | Completion delay time. |
  121. |------------------------------+-------------------------+-----------------------------------|
  122. | ~dotfiles/leader-key~ | SPC | All powerful leader key. |
  123. | ~dotfiles/leader-key-global~ | C-(dotfiles/leader-key) | Global prefix for the leader key. |
  124. |------------------------------+-------------------------+-----------------------------------|
  125. | ~dotfiles/projects~ | =~/.local/source= | Location of source code projects. |
  126. | ~dotfiles/passwords~ | =~/.password-store= | Location of local password store. |
  127. |------------------------------+-------------------------+-----------------------------------|
  128. | ~dotfiles/public-key~ | =5EAG356GFAE...= | GPG key to encrypt org files for. |
  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