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.

170 lines
4.1 KiB

3 years ago
3 years ago
1 year ago
3 years ago
1 year ago
  1. # This file is controlled by /etc/dotfiles/README.org
  2. # This module MUST be included within home manager
  3. { config, options, lib, pkgs, ... }:
  4. with lib;
  5. with lib.types;
  6. let
  7. cfg = config.modules.emacs;
  8. myEmacs = pkgs.emacsWithPackagesFromUsePackage {
  9. config = ../README.org;
  10. package = pkgs.emacs-unstable;
  11. alwaysEnsure = true;
  12. alwaysTangle = true;
  13. extraEmacsPackages = epkgs: [
  14. # Required packages...
  15. epkgs.exwm
  16. epkgs.evil
  17. epkgs.evil-collection
  18. epkgs.evil-surround
  19. epkgs.evil-nerd-commenter
  20. epkgs.general
  21. epkgs.which-key
  22. # Optional packages.
  23. epkgs.org
  24. epkgs.org-roam
  25. epkgs.org-roam-ui
  26. epkgs.websocket
  27. epkgs.simple-httpd
  28. epkgs.org-drill
  29. epkgs.org-pomodoro
  30. epkgs.writegood-mode
  31. epkgs.ob-http
  32. epkgs.ox-hugo
  33. epkgs.password-store
  34. epkgs.docker
  35. epkgs.dockerfile-mode
  36. epkgs.mu4e-alert
  37. epkgs.dired-single
  38. epkgs.nerd-icons
  39. epkgs.all-the-icons
  40. epkgs.all-the-icons-dired
  41. epkgs.all-the-icons-ivy-rich
  42. epkgs.emojify
  43. epkgs.eshell-prompt-extras
  44. epkgs.vterm
  45. epkgs.multi-vterm
  46. epkgs.magit
  47. epkgs.hydra
  48. epkgs.ligature
  49. epkgs.elfeed
  50. epkgs.nix-mode
  51. epkgs.projectile
  52. epkgs.lsp-mode
  53. epkgs.lsp-ui
  54. epkgs.company
  55. epkgs.gdscript-mode
  56. epkgs.ccls
  57. epkgs.go-mode
  58. epkgs.dart-mode
  59. epkgs.lsp-dart
  60. epkgs.hover
  61. epkgs.pretty-mode
  62. epkgs.rustic
  63. epkgs.protobuf-mode
  64. epkgs.typescript-mode
  65. epkgs.yaml-mode
  66. epkgs.plantuml-mode
  67. # User interface packages.
  68. epkgs.neotree
  69. epkgs.ivy
  70. epkgs.counsel
  71. epkgs.ivy-rich
  72. epkgs.ivy-posframe
  73. epkgs.ivy-prescient
  74. epkgs.desktop-environment
  75. epkgs.doom-themes
  76. epkgs.doom-modeline
  77. ];
  78. };
  79. in {
  80. options.modules.emacs = {
  81. enable = mkOption {
  82. type = bool;
  83. default = false;
  84. };
  85. };
  86. config = mkIf cfg.enable {
  87. home.packages = [
  88. pkgs.arandr
  89. pkgs.nitrogen
  90. pkgs.autorandr
  91. pkgs.pass
  92. (pkgs.writeShellScriptBin "pass-init" ''
  93. ${pkgs.git}/bin/git clone git@git.chrishayward.xyz:chris/passwords /home/chris/.password-store
  94. ${pkgs.pass}/bin/pass init
  95. '')
  96. pkgs.mu
  97. pkgs.isync
  98. (pkgs.writeShellScriptBin "mail-init" ''
  99. ${pkgs.mu}/bin/mu init --maildir="/home/chris/.cache/mail" --my-address="chris@chrishayward.xyz"
  100. ${pkgs.mu}/bin/mu index
  101. '')
  102. (pkgs.writeShellScriptBin "mail-sync" ''
  103. ${pkgs.isync}/bin/mbsync -a
  104. '')
  105. pkgs.aspell
  106. pkgs.aspellDicts.en
  107. pkgs.aspellDicts.en-science
  108. pkgs.aspellDicts.en-computers
  109. # pkgs.texlive.combined.scheme-full
  110. pkgs.brightnessctl
  111. pkgs.plantuml
  112. pkgs.nixfmt
  113. pkgs.rnix-lsp
  114. (pkgs.writeShellScriptBin "dotfiles-theme" ''
  115. ${myEmacs}/bin/emacsclient --no-wait --eval '(json-encode (dotfiles/theme))' | sed "s/\\\\//g" | sed -e 's/^"//' -e 's/"$//'
  116. '')
  117. ];
  118. programs.emacs = {
  119. enable = true;
  120. package = myEmacs;
  121. };
  122. xsession = {
  123. enable = true;
  124. windowManager.command = ''
  125. ${pkgs.nitrogen}/bin/nitrogen --restore
  126. ${myEmacs}/bin/emacs --daemon -f exwm-enable
  127. ${myEmacs}/bin/emacsclient -c
  128. '';
  129. };
  130. home.file.".xinitrc" = {
  131. text = ''
  132. exec ./.xsession
  133. '';
  134. };
  135. # Deploy the authinfo file.
  136. home.file.".authinfo.gpg".source = ../config/authinfo.gpg;
  137. # Deploy the isync configuration file.
  138. home.file.".mbsyncrc" = {
  139. text = ''
  140. IMAPStore xyz-remote
  141. Host mail.chrishayward.xyz
  142. User chris@chrishayward.xyz
  143. PassCmd "pass chrishayward.xyz/chris"
  144. SSLType IMAPS
  145. MaildirStore xyz-local
  146. Path ~/.cache/mail/
  147. Inbox ~/.cache/mail/inbox
  148. SubFolders Verbatim
  149. Channel xyz
  150. Far :xyz-remote:
  151. Near :xyz-local:
  152. Patterns * !Archives
  153. Create Both
  154. Expunge Both
  155. SyncState *
  156. '';
  157. };
  158. };
  159. }