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.

182 lines
5.6 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
  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 *GNU Emacs*[fn:1] dotfiles. Built for Life, Liberty, and the Open Road.
  13. + 100% Literate
  14. + 100% Immutable
  15. + 100% Reproducible
  16. * What is it?
  17. From the documentation[fn:1]:
  18. #+begin_quote
  19. *An extensible, customizable, free/libre text editor -- and more*
  20. At its core is an interpreter for *Emacs Lisp*[fn:2], a dialect of the Lisp programming language with extensions to support text editing.
  21. #+end_quote
  22. To highlight some of the features available out of the box:
  23. + Content aware editing modes
  24. + Complete built-in documentation
  25. + Full unicode support for all human languages
  26. + Packaging sysystem for third party extensions
  27. + Wide range of functionality beyond text editing
  28. * How does it work?
  29. 1. *Emacs* reads the configuration at ~$HOME/.emacs.d/init.el~ at startup
  30. 2. *This file* outputs some startup code to that location
  31. 1. Defines all of the options for hosts
  32. 2. Runs some required startup code
  33. 3. Loads the host definition file at ~$HOME/.emacs.d/host/$HOSTNAME~
  34. 4. Lodas the enabled modules in ~dotfiles/modules~
  35. ** Options
  36. Here's a complete list of all of the options configurable for each host, and their default values. All variables prefixed with ~dotfiles/~. If you need to make configurations to another variable, consider creating a new option.
  37. #+begin_src emacs-lisp
  38. (defvar dotfiles/font
  39. "Fira Code"
  40. "Unified system font family.")
  41. (defvar dotfiles/font-size
  42. 96
  43. "Unified system font size.")
  44. (defvar dotfiles/browser
  45. (getenv "BROWSER")
  46. "Default system web browser.")
  47. (defvar dotfiles/language
  48. (getenv "LANG")
  49. "Default system dictionary language.")
  50. (defconst dotfiles/modules-p
  51. '(core
  52. editor
  53. email
  54. encryption
  55. desktop
  56. writing
  57. website
  58. capture
  59. projects
  60. interface)
  61. "All of the available modules.")
  62. (defvar dotfiles/modules
  63. dotfiles/modules-p
  64. "All of the enabled modules.")
  65. (defvar dotfiles/home
  66. user-emacs-directory
  67. "Original value of `user-emacs-directory'.")
  68. (defvar dotfiles/cache
  69. (expand-file-name "~/.cache/emacs")
  70. "Redirection target of `user-emacs-directory'.")
  71. (defvar dotfiles/idle
  72. 0.0
  73. "Delay time before offering suggestions and completions.")
  74. (defvar dotfiles/leader-key
  75. "SPC"
  76. "All powerful leader key.")
  77. (defvar dotfiles/leader-key-global
  78. (concat "C-" dotfiles/leader-key)
  79. "Global prefix for the leader key.")
  80. (defvar dotfiles/projects
  81. (expand-file-name "~/.local/source/")
  82. "Location of source code projects.")
  83. (defvar dotfiles/passwords
  84. (expand-file-name "~/.password-store/")
  85. "Location of local password store.")
  86. (defvar dotfiles/public-key
  87. "37AB1CB72B741E478CA026D43025DCBD46F81C0F"
  88. "GPG key to encrypt org files for.")
  89. #+end_src
  90. ** Startup
  91. This project makes heavy use of modern features and libraries. Since *Babel's* used in initialization, *Org* must load prior to importing any of custom modules. This introduces a unique *chicken before the egg* problem. My solution included some initialization code in *Emacs Lisp* called before using any *Babel* APIs.
  92. #+begin_src emacs-lisp
  93. (load-file "~/.emacs.d/bin/cleanup.el")
  94. (load-file "~/.emacs.d/bin/packages.el")
  95. #+end_src
  96. * Getting started
  97. *How to install*
  98. 1. Clone ~git clone git@github.com:chayward1/dotfiles.git ~/.emacs.d~
  99. 2. Run ~~emacs --mm --debug-init~
  100. ** Hosts
  101. 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:
  102. + [[file:hosts/localhost.org][Termux]]
  103. + [[link:hosts/gamingpc.org][GamingPC]]
  104. + [[file:hosts/raspberry.org][Raspberry]]
  105. + [[file:hosts/acernitro.org][Acernitro]]
  106. + [[file:hosts/virtualbox.org][VirtualBox]]
  107. Begin the process by loading any host specific overrides. The host configuration tangles, and loads (if it exist) using the systems name.
  108. #+begin_src emacs-lisp
  109. (let ((host-file (concat dotfiles/home "/hosts/" system-name ".org")))
  110. (when (file-exists-p host-file)
  111. (org-babel-load-file host-file)))
  112. #+end_src
  113. ** Modules
  114. 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. Here are all of the available modules, also listed in the variable ~dotfiles/modules-p~.
  115. + [[file:modules/core.org][Core]]
  116. + [[file:modules/editor.org][Editor]]
  117. + [[file:modules/email.org][Email]]
  118. + [[file:modules/encryption.org][Encryption]]
  119. + [[file:modules/desktop.org][Desktop]]
  120. + [[file:modules/writing.org][Writing]]
  121. + [[file:modules/website.org][Website]]
  122. + [[file:modules/capture.org][Capture]]
  123. + [[file:modules/projects.org][Projects]]
  124. + [[file:modules/interface.org][Interface]]
  125. By default all of the modules will load, override the variable ~dotfiles/modules~ in a host configuration to override this.
  126. #+begin_src emacs-lisp
  127. (dolist (m dotfiles/modules)
  128. (let ((mod-file (concat dotfiles/home "/modules/" (symbol-name m) ".org")))
  129. (when (file-exists-p mod-file)
  130. (org-babel-load-file mod-file))))
  131. #+end_src
  132. * Resources
  133. [fn:1] https://gnu.org/software/emacs
  134. [fn:2] https://gnu.org/software/emacs/manual/html_node/elisp/index.html