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.

185 lines
5.9 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
  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. Loads 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.
  37. + All variables prefixed with ~dotfiles/~
  38. + Initialized prior to loading of packages or hosts
  39. #+begin_src emacs-lisp
  40. (defvar dotfiles/home user-emacs-directory
  41. "Original value of `user-emacs-directory'.")
  42. (defvar dotfiles/cache (expand-file-name "~/.cache/emacs")
  43. "Redirection target of `user-emacs-directory'.")
  44. (defvar dotfiles/browser (getenv "BROWSER")
  45. "Default system web browser.")
  46. (defvar dotfiles/language (getenv "LANG")
  47. "Default system dictionary language.")
  48. (defconst dotfiles/modules-p
  49. '(core
  50. editor
  51. shell
  52. email
  53. terminal
  54. encryption
  55. desktop
  56. writing
  57. website
  58. capture
  59. projects
  60. development
  61. interface
  62. dashboard)
  63. "All of the available modules.")
  64. (defvar dotfiles/modules dotfiles/modules-p
  65. "All of the enabled modules.")
  66. (defvar dotfiles/font "Fira Code"
  67. "Unified system font family.")
  68. (defvar dotfiles/font-size 96
  69. "Unified system font size.")
  70. (defvar dotfiles/idle 0.0
  71. "Delay time before offering suggestions and completions.")
  72. (defvar dotfiles/leader-key "SPC"
  73. "All powerful leader key.")
  74. (defvar dotfiles/leader-key-global
  75. (concat "C-" dotfiles/leader-key)
  76. "Global prefix for the leader key.")
  77. (defvar dotfiles/projects
  78. (expand-file-name "~/.local/source/")
  79. "Location of source code projects.")
  80. (defvar dotfiles/passwords
  81. (expand-file-name "~/.password-store/")
  82. "Location of local password store.")
  83. (defvar dotfiles/public-key
  84. "37AB1CB72B741E478CA026D43025DCBD46F81C0F"
  85. "GPG key to encrypt org files for.")
  86. #+end_src
  87. ** Startup
  88. This project makes heavy use of modern features and libraries. Since *Babel's* [fn:3] used in initialization, *Org* [fn:4] must load prior to importing any of custom modules. This introduces a unique *chicken or the egg* [fn:5] problem. My solution included some initialization code in *Emacs Lisp* [fn:2] called before using any *Babel* [fn:3] APIs.
  89. #+begin_src emacs-lisp
  90. (load-file "~/.emacs.d/bin/cleanup.el")
  91. (load-file "~/.emacs.d/bin/packages.el")
  92. #+end_src
  93. * Getting started
  94. *How to install*
  95. 1. Clone ~git clone git@github.com:chayward1/dotfiles.git ~/.emacs.d~
  96. 2. Run ~emacs --mm --debug-init~
  97. ** Hosts
  98. 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:
  99. + [[file:hosts/localhost.org][Termux]]
  100. + [[file:hosts/gamingpc.org][Gamingpc]]
  101. + [[file:hosts/raspberry.org][Raspberry]]
  102. + [[file:hosts/acernitro.org][Acernitro]]
  103. + [[file:hosts/virtualbox.org][Virtualbox]]
  104. Begin the process by loading any host specific overrides. The host configuration tangles, and loads (if it exist) using the systems name.
  105. #+begin_src emacs-lisp
  106. (let ((host-file (concat dotfiles/home "/hosts/" system-name ".org")))
  107. (when (file-exists-p host-file)
  108. (org-babel-load-file host-file)))
  109. #+end_src
  110. ** Modules
  111. 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~.
  112. + [[file:modules/core.org][Core]]
  113. + [[file:modules/editor.org][Editor]]
  114. + [[file:modules/email.org][Email]]
  115. + [[file:modules/encryption.org][Encryption]]
  116. + [[file:modules/shell.org][Shell]]
  117. + [[file:modules/desktop.org][Desktop]]
  118. + [[file:modules/writing.org][Writing]]
  119. + [[file:modules/website.org][Website]]
  120. + [[file:modules/capture.org][Capture]]
  121. + [[file:modules/projects.org][Projects]]
  122. + [[file:modules/development.org][Development]]
  123. + [[file:modules/interface.org][Interface]]
  124. + [[file:modules/dashboard.org][Dashboard]]
  125. By default all of the modules will load, override the variable ~dotfiles/modules~ in a host configuration.
  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
  135. [fn:3] https://orgmode.org/worg/org-contrib/babel/intro.html
  136. [fn:4] https://orgmode.org
  137. [fn:5] https://en.wikipedia.org/wiki/Chicken_or_the_egg