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
4.1 KiB

3 years ago
3 years ago
12 months 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
  37. epkgs.mu4e-alert
  38. epkgs.dired-single
  39. epkgs.nerd-icons
  40. epkgs.all-the-icons
  41. epkgs.all-the-icons-dired
  42. epkgs.all-the-icons-ivy-rich
  43. epkgs.emojify
  44. epkgs.eshell-prompt-extras
  45. epkgs.vterm
  46. epkgs.multi-vterm
  47. epkgs.magit
  48. epkgs.hydra
  49. epkgs.ligature
  50. epkgs.elfeed
  51. epkgs.nix-mode
  52. epkgs.projectile
  53. epkgs.lsp-mode
  54. epkgs.lsp-ui
  55. epkgs.company
  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.writeShellScriptBin "g" ''
  92. pushd $HOME
  93. startx
  94. popd /dev/null
  95. '')
  96. pkgs.pass
  97. (pkgs.writeShellScriptBin "pass-init" ''
  98. ${pkgs.git}/bin/git clone git@git.chrishayward.xyz:chris/passwords /home/chris/.password-store
  99. ${pkgs.pass}/bin/pass init
  100. '')
  101. pkgs.mu
  102. pkgs.isync
  103. (pkgs.writeShellScriptBin "mail-init" ''
  104. ${pkgs.mu}/bin/mu init --maildir="/home/chris/.cache/mail" --my-address="chris@chrishayward.xyz"
  105. ${pkgs.mu}/bin/mu index
  106. '')
  107. (pkgs.writeShellScriptBin "mail-sync" ''
  108. ${pkgs.isync}/bin/mbsync -a
  109. '')
  110. pkgs.aspell
  111. pkgs.aspellDicts.en
  112. pkgs.aspellDicts.en-science
  113. pkgs.aspellDicts.en-computers
  114. # pkgs.texlive.combined.scheme-full
  115. pkgs.brightnessctl
  116. pkgs.plantuml
  117. pkgs.nixfmt
  118. pkgs.rnix-lsp
  119. (pkgs.writeShellScriptBin "dotfiles-theme" ''
  120. ${myEmacs}/bin/emacsclient --no-wait --eval '(json-encode (dotfiles/theme))' | sed "s/\\\\//g" | sed -e 's/^"//' -e 's/"$//'
  121. '')
  122. ];
  123. programs.emacs = {
  124. enable = true;
  125. package = myEmacs;
  126. };
  127. xsession = {
  128. enable = true;
  129. windowManager.command = ''
  130. ${pkgs.nitrogen}/bin/nitrogen --restore
  131. ${myEmacs}/bin/emacs --daemon -f exwm-enable
  132. ${myEmacs}/bin/emacsclient -c
  133. '';
  134. };
  135. home.file.".xinitrc" = {
  136. text = ''
  137. exec ./.xsession
  138. '';
  139. };
  140. # Deploy the authinfo file.
  141. home.file.".authinfo.gpg".source = ../config/authinfo.gpg;
  142. # Deploy the isync configuration file.
  143. home.file.".mbsyncrc" = {
  144. text = ''
  145. IMAPStore xyz-remote
  146. Host mail.chrishayward.xyz
  147. User chris@chrishayward.xyz
  148. PassCmd "pass chrishayward.xyz/chris"
  149. SSLType IMAPS
  150. MaildirStore xyz-local
  151. Path ~/.cache/mail/
  152. Inbox ~/.cache/mail/inbox
  153. SubFolders Verbatim
  154. Channel xyz
  155. Far :xyz-remote:
  156. Near :xyz-local:
  157. Patterns * !Archives
  158. Create Both
  159. Expunge Both
  160. SyncState *
  161. '';
  162. };
  163. };
  164. }