about summary refs log tree commit diff
path: root/modules/common/emacs/default.nix
diff options
context:
space:
mode:
authorAzat Bahawi <azat@bahawi.net>2023-11-26 02:03:29 +0300
committerAzat Bahawi <azat@bahawi.net>2023-11-26 02:03:29 +0300
commit2ceeed9040d0b5a015fd634122afcf35f432ba45 (patch)
tree78d3dda30937da38cdda4c9a0367653948538a53 /modules/common/emacs/default.nix
parent2023-11-25 (diff)
2023-11-26
Diffstat (limited to 'modules/common/emacs/default.nix')
-rw-r--r--modules/common/emacs/default.nix58
1 files changed, 34 insertions, 24 deletions
diff --git a/modules/common/emacs/default.nix b/modules/common/emacs/default.nix
index 6c81ce2..94c7729 100644
--- a/modules/common/emacs/default.nix
+++ b/modules/common/emacs/default.nix
@@ -40,7 +40,7 @@ in {
                 "https://github.com/doomemacs/doomemacs" "$EMACSDIR"
             fi
 
-            if [[ ! -d "$DOOMDIR" ]]; then
+            if [[ ! -d "$DOOMDIR/snippets" ]]; then
               mkdir -p "$DOOMDIR/snippets"
             fi
 
@@ -67,6 +67,7 @@ in {
                   [
                     (aspellWithDicts (p: with p; [en ru])) # :checkers (spell +aspell)
                     asmfmt # :editor format
+                    bashdb # :lang sh :tools debugger
                     cargo # :lang rust
                     clang-tools # :lang (cc +lsp) :editor format
                     cmake # :lang cc :term vterm
@@ -80,7 +81,8 @@ in {
                     ghc # :lang haskell
                     gnumake # :term vterm
                     gnuplot # :lang (org +gnuplot)
-                    gnutls # doom!
+                    gnutar # :tools tree-sitter
+                    gnutls # doom! :app irc
                     go # :lang go
                     gocode # :lang go org
                     godef # :lang go
@@ -90,15 +92,18 @@ in {
                     gotests # :lang go
                     gotools # :lang go
                     graphviz # :lang (org +roam2) :lang plantuml
+                    gzip # :tools tree-sitter
                     haskellPackages.cabal-fmt # :lang haskell :editor format
                     haskellPackages.cabal-install # :lang haskell
                     haskellPackages.haskell-language-server # :lang (haskell +lsp)
                     haskellPackages.hoogle # :lang haskell
                     haskellPackages.ormolu # :lang haskell :editor format
                     html-tidy # :lang web :editor format
-                    jre # :lang plantuml
+                    jdk # :lang java :lang plantuml :checkers grammar
+                    languagetool # :checkers grammar
                     libtool # :term vterm
                     libxml2 # :lang data :editor format
+                    markdownlint-cli # :lang markdown
                     nil # :lang (nix +lsp)
                     nodePackages.bash-language-server # :lang (sh +lsp)
                     nodePackages.eslint # :lang (json +lsp)
@@ -121,12 +126,10 @@ in {
                     python3Packages.pyflakes # :lang python :editor format
                     python3Packages.pytest # :lang python
                     python3Packages.python-lsp-server # :lang python :editor format
-                    racket # :lang racket scheme :editor format
                     ripgrep # doom!
                     rust-analyzer # :lang (rust +lsp)
                     rustc # :lang rust
                     rustfmt # :lang rust
-                    sbcl # :lang common-lisp
                     shellcheck # :lang sh
                     shfmt # :lang sh :editor format
                     sqlite # :lang (org +roam2) :tools lookup
@@ -158,9 +161,13 @@ in {
                   concatMapStringsSep ":" (x: "${x}/bin") extraBins
                 }"))
 
-                (appendq! auth-sources '(("${config.secrets.authinfo.path}")))
+                ;; HACK Explicitly load specific Emacs packages from Nixpkgs.
+                ;; For some reason providing them as "extraPackages" doesn't
+                ;; work.
+                (add-to-list 'load-path "${pkgs.mu.mu4e}/share/emacs/site-lisp/mu4e")
+                (add-to-list 'load-path "${pkgs.emacsPackages.vterm}/share/emacs/site-lisp/elpa/vterm-${pkgs.emacsPackages.vterm.version}")
 
-                (setq emacsql-sqlite-executable "${getExe pkgs.emacsql-sqlite}")
+                (appendq! auth-sources '(("${config.secrets.authinfo.path}")))
 
                 ;; The font must be set to n+2, otherwise it looks too small.
                 (setq doom-font (font-spec
@@ -168,28 +175,34 @@ in {
                                   :size ${toString (config.fontScheme.monospaceFont.size + 2)})
                       doom-unicode-font doom-font)
 
-                ;; :app irc
-                (setq circe-default-nick "${my.username}"
-                      circe-default-realname "${my.email}"
-                      circe-default-user circe-default-nick)
-
-                ;; :lang plantuml
-                (setq plantuml-jar-path "${pkgs.plantuml}/lib/plantuml.jar"
-                      plantuml-executable-path "${getExe' pkgs.plantuml "plantuml"}"
-                      org-plantuml-jar-path plantuml-jar-path
-                      org-plantuml-executable-path plantuml-executable-path)
-
                 ;; :input japanese
-                (setq migemo-dictionary "${pkgs.cmigemo}/share/migemo/utf-8/migemo-dict")
+                (setq migemo-dictionary "${pkgs.cmigemo}/share/migemo/utf-8/migemo-dict"
+                      skk-large-jisyo "${pkgs.skk-dicts}/share/SKK-JISYO.L")
 
-                ;; :input japanese
-                (setq skk-large-jisyo "${pkgs.skk-dicts}/share/skk/SKK-JISYO.L")
+                ;; :editor parinfer
+                (setq parinfer-rust-auto-download nil
+                      parinfer-rust-library "${pkgs.parinfer-rust}/lib/libparinfer_rust.so")
 
                 ;; :lang nix
                 ;; HACK Trick `nix-mode' to use alejandra instead of nixfmt.
                 (setq nix-nixfmt-bin "${pkgs.writeShellScript "nixfmt" ''
                   ${getExe pkgs.alejandra} "$@"
                 ''}")
+
+                ;; :lang (org +roam2) :email mu4e
+                (setq emacsql-sqlite-executable "${getExe pkgs.emacsql-sqlite}")
+
+                ;; :lang plantuml
+                (setq plantuml-jar-path "${pkgs.plantuml}/lib/plantuml.jar"
+                      plantuml-executable-path "${getExe' pkgs.plantuml "plantuml"}"
+                      org-plantuml-jar-path plantuml-jar-path
+                      org-plantuml-executable-path plantuml-executable-path)
+
+
+                ;; :app irc
+                (setq circe-default-nick "${my.username}"
+                      circe-default-realname "${my.email}"
+                      circe-default-user circe-default-nick)
               ''
             )
             (with config.hm.accounts.email; let
@@ -214,9 +227,6 @@ in {
                   '')
                 muAccounts;
             in ''
-              ;; HACK Load missing site-lisp for `mu4e'.
-              (add-to-list 'load-path "${pkgs.mu.mu4e}/share/emacs/site-lisp/mu4e")
-
               (setq mu4e-root-maildir "${maildirBasePath}")
 
               ${mu4eAccounts}

Consider giving Nix/NixOS a try! <3