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.

122 lines
4.0 KiB

3 years ago
  1. ;; This file is controlled by README.org
  2. ;; Please make any modifications there.
  3. ;; The original value of `user-emacs-directory' prior to redirection.
  4. (defconst dotfiles/home
  5. (or (getenv "DOTFILES_HOME")
  6. (expand-file-name user-emacs-directory)))
  7. ;; The redirection target of `user-emacs-directory' during initialization.
  8. (defconst dotfiles/cache
  9. (or (getenv "DOTFILES_CACHE")
  10. (expand-file-name "~/.cache/emacs")))
  11. ;; Make sure `dotfiles/cache' is a valid directory.
  12. (unless (file-exists-p dotfiles/cache)
  13. (make-directory dotfiles/cache t))
  14. ;; Redirect the value of `user-emacs-directory'.
  15. (setq user-emacs-directory dotfiles/cache)
  16. ;; Remove the eln-cache subdirectory.
  17. (delete (expand-file-name "eln-cache" dotfiles/home) comp-eln-load-path)
  18. ;; Add a new eln-cache folder.
  19. (add-to-list 'comp-eln-load-path (expand-file-name "eln-cache" dotfiles/cache))
  20. ;; Disable error messages for packages that don't support native-comp.
  21. (setq comp-async-report-warnings-errors nil)
  22. ;; Disable unwanted features.
  23. (setq make-backup-files nil
  24. create-lockfiles nil)
  25. ;; Apply the configurations prior to bootstrapping the package manager.
  26. (setq straight-repository-branch "master"
  27. straight-use-package-by-default t
  28. package-enable-at-startup nil)
  29. ;; BUGFIX https://github.com/raxod502/straight.el/issues/757
  30. (defvar native-comp-deferred-compilation-deny-list ())
  31. ;; Bootstrap the package manager.
  32. (defvar bootstrap-version)
  33. (let ((bootstrap-file
  34. (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
  35. (bootstrap-version 5))
  36. (unless (file-exists-p bootstrap-file)
  37. (with-current-buffer
  38. (url-retrieve-synchronously
  39. "https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el"
  40. 'silent 'inhibit-cookies)
  41. (goto-char (point-max))
  42. (eval-print-last-sexp)))
  43. (load bootstrap-file nil 'nomessage))
  44. ;; Integrate with `use-package' by installing it via `straight'.
  45. (straight-use-package 'use-package)
  46. ;; Specify core package sources.
  47. (straight-use-package 'no-littering)
  48. (straight-use-package '(org :local-repo nil))
  49. ;; All of the modules available sorted in their default load order.
  50. (defconst dotfiles/modules-p
  51. '(trash keys org evil dired magit shell
  52. emms mu4e elfeed eshell vterm gpg pass
  53. x11 exwm roam agenda spelling grammar
  54. reveal hugo capture projects docker
  55. lsp dap cc go uml conf python fonts
  56. nix ivy themes modeline dashboard))
  57. ;; All of the enabled modules.
  58. (defvar dotfiles/modules dotfiles/modules-p)
  59. ;; The default system language.
  60. (defvar dotfiles/language (getenv "LANG"))
  61. ;; Configure a unified system font.
  62. (defvar dotfiles/font "Fira Code")
  63. ;; Default system font size.
  64. (defvar dotfiles/font-size 96)
  65. ;; Delay time before offering suggestions and completions.
  66. (defvar dotfiles/idle 0.0)
  67. ;; The all powerful leader key.
  68. (defvar dotfiles/leader-key "SPC")
  69. ;; Global prefix for the leader key under X11 windows.
  70. (defvar dotfiles/leader-key-global
  71. (concat "C-" dotfiles/leader-key))
  72. ;; The location on disk of source code projects.
  73. (defvar dotfiles/projects
  74. (or (getenv "DOTFILES_PROJECTS")
  75. (expand-file-name "~/.local/source")))
  76. ;; The location on disk of the local copy of the password store.
  77. (defvar dotfiles/passwords
  78. (or (getenv "DOTFILES_PASSWORDS")
  79. (expand-file-name "~/.password-store")))
  80. ;; The public GPG key to encrpyt files, and emails for / to / with.
  81. (defvar dotfiles/public-key "37AB1CB72B741E478CA026D43025DCBD46F81C0F")
  82. ;; Load a host configuration.
  83. (defun dotfiles/load-host (host-name)
  84. "Load the host configuration file for the system `host-name'."
  85. (interactive)
  86. (let ((host-file (concat dotfiles/home "/hosts/" host-name ".org")))
  87. (when (file-exists-p host-file)
  88. (org-babel-load-file host-file))))
  89. ;; Load a module definition.
  90. (defun dotfiles/load-modules (modules)
  91. "Load the `modules' in sequential order."
  92. (interactive)
  93. (dolist (m modules)
  94. (let ((mod-file (concat dotfiles/home "/modules/" (symbol-name m) ".org")))
  95. (when (file-exists-p mod-file)
  96. (org-babel-load-file mod-file)))))