about summary refs log tree commit diff
path: root/modules/emacs
diff options
context:
space:
mode:
Diffstat (limited to 'modules/emacs')
-rw-r--r--modules/emacs/default.nix11
-rw-r--r--modules/emacs/doom/config.el183
-rw-r--r--modules/emacs/doom/init.el1
-rw-r--r--modules/emacs/doom/packages.el13
4 files changed, 101 insertions, 107 deletions
diff --git a/modules/emacs/default.nix b/modules/emacs/default.nix
index eccf179..a182d4c 100644
--- a/modules/emacs/default.nix
+++ b/modules/emacs/default.nix
@@ -125,7 +125,7 @@ in
                       nixfmt # :lang nix :editor format
                       nls # :lang (nickel +lsp)
                       nodePackages.bash-language-server # :lang (sh +lsp)
-                      nodePackages.eslint # :lang (json +lsp)
+                      # nodePackages.eslint # :lang (json +lsp)
                       nodePackages.js-beautify # :lang web
                       nodePackages.prettier # :editor format
                       nodePackages.stylelint # :lang web
@@ -157,8 +157,6 @@ in
                       vscode-langservers-extracted # :lang (json +lsp) (web +lsp)
                       wordnet # :tools (lookup +dictionary +offline)
                       yaml-language-server # :lang (yaml +lsp)
-                      zig # :lang zig :editor format
-                      zls # :lang (zig +lsp)
                       zstd # :emacs undo
                     ];
                   in
@@ -181,8 +179,7 @@ in
                           skk-large-jisyo "${pkgs.skk-dicts}/share/SKK-JISYO.L")
 
                     ;; :editor parinfer
-                    (setq parinfer-rust-auto-download nil
-                          parinfer-rust-library "${pkgs.parinfer-rust-emacs}/lib/libparinfer_rust.so")
+                    (setq parinfer-rust-library "${pkgs.parinfer-rust-emacs}/lib/libparinfer_rust.so")
 
                     ;; :lang (org +roam2) :email mu4e
                     (setq emacsql-sqlite-executable "${getExe pkgs.emacsql-sqlite}")
@@ -202,8 +199,8 @@ in
                 (with config.stylix.fonts; ''
                   (setq doom-font "${monospace.name}-${toString sizes.terminal}"
                         doom-serif-font "${serif.name}-${toString sizes.terminal}"
-                        doom-variable-pitch-font "${sansSerif.name}-${toString sizes.terminal}")
-                        doom-emoji-font "${emoji.name}-${toString sizes.terminal}"
+                        doom-variable-pitch-font "${sansSerif.name}-${toString sizes.terminal}"
+                        doom-emoji-font "${emoji.name}-${toString sizes.terminal}")
                 '')
                 (
                   with config.hm.accounts.email;
diff --git a/modules/emacs/doom/config.el b/modules/emacs/doom/config.el
index 206e5cd..fe3b5b4 100644
--- a/modules/emacs/doom/config.el
+++ b/modules/emacs/doom/config.el
@@ -2,15 +2,15 @@
 ;;; Misc
 ;;
 
-(setq frame-title-format '("GNU Emacs"))
+(setq! frame-title-format '("GNU Emacs"))
 
 (setq-hook! '(prog-mode-hook yaml-mode-hook)
   display-line-numbers-type 'relative
   scroll-margin 10
   hscroll-margin 10)
 
-(setq browse-url-generic-program (executable-find "firefox")
-      browse-url-browser-function 'browse-url-generic)
+(setq! browse-url-generic-program (executable-find "firefox")
+       browse-url-browser-function 'browse-url-generic)
 
 (use-package! xclip
   :config
@@ -19,34 +19,47 @@
         xclip-mode t
         xclip-method 'wl-copy))
 
-(setq migemo-options '("--quiet" "--emacs")
-      skk-show-inline t)
+(setq! migemo-options '("--quiet" "--emacs")
+       skk-show-inline t)
 
 ;;
 ;;; Doom-specific
 ;;
 
-(setq doom-theme 'modus-operandi
-      doom-modeline-icon nil
-      doom-modeline-indent-info t
-      doom-modeline-total-line-number t
-      doom-modeline-height 30)
+(setq! doom-theme 'modus-operandi
+       doom-modeline-icon nil
+       doom-modeline-indent-info t
+       doom-modeline-total-line-number t
+       doom-modeline-height 30)
+
+;;
+;;; TVL
+;;
+
+(use-package! tvl)
 
 ;;
 ;;; Editorconfig
 ;;
 
-(setq +editorconfig-mode-alist '((sh-mode . "sh"))
-      editorconfig-exclude-modes '(lisp-mode
-                                   common-lisp-mode
-                                   emacs-lisp-mode))
+(setq! +editorconfig-mode-alist '((sh-mode . "sh"))
+       ;; It's never a good idea to force specific indentation rules for Lisp,
+       ;; the only rule should be is not to use tabs.
+       editorconfig-exclude-modes '(emacs-lisp-mode
+                                    clojure-mode
+                                    scheme-mode
+                                    lisp-mode
+                                    racket-mode
+                                    fennel-mode
+                                    hy-mode
+                                    dune-mode))
 
 ;;
 ;;; LSP
 ;;
 
-(setq lsp-enable-suggest-server-download nil
-      lsp-modeline-code-actions-enable nil)
+(setq! lsp-enable-suggest-server-download nil
+       lsp-modeline-code-actions-enable nil)
 
 ;;
 ;;; Nix
@@ -66,9 +79,9 @@
 ;;; Go
 ;;
 
-(setq lsp-go-analyses '((unsedvariable . t)
-                        (unusedparams . t)
-                        (unusedwrite . t)))
+(setq! lsp-go-analyses '((unsedvariable . t)
+                         (unusedparams . t)
+                         (unusedwrite . t)))
 
 ;;
 ;;; Org
@@ -79,38 +92,38 @@
 ;; For some reason only using `after!' work here. `setq-hook!' and etc doesn't
 ;; produce expected results.
 (after! org
-  (setq org-todo-keywords '((sequence
-                             "TODO(t)"
-                             "LOOP(r)"
-                             "STRT(s@)"
-                             "WAIT(w@/!)"
-                             "HOLD(h@/!)"
-                             "IDEA(i)"
-                             "PROJ(p)"
-                             "|"
-                             "DONE(d@/!)"
-                             "KILL(k@/!)"))
-        org-todo-keyword-faces '(("STRT" . +org-todo-active)
-                                 ("WAIT" . +org-todo-onhold)
-                                 ("HOLD" . +org-todo-onhold)
-                                 ("PROJ" . +org-todo-project)
-                                 ("KILL" . +org-todo-cancel))
-        org-capture-templates '(("t" "Todo" entry
-                                 (file+headline +org-capture-todo-file "Inbox")
-                                 "* TODO %?\n%i\n%a" :prepend t)
-                                ("n" "Note" entry
-                                 (file+headline +org-capture-notes-file "Inbox")
-                                 "* %u %?\n%i\n%a" :prepend t)
-                                ("j" "Journal" entry
-                                 (file+olp+datetree +org-capture-journal-file)
-                                 "* %U %?\n%i\n%a" :prepend t))))
+  (setq! org-todo-keywords '((sequence
+                              "TODO(t)"
+                              "LOOP(r)"
+                              "STRT(s@)"
+                              "WAIT(w@/!)"
+                              "HOLD(h@/!)"
+                              "IDEA(i)"
+                              "PROJ(p)"
+                              "|"
+                              "DONE(d@/!)"
+                              "KILL(k@/!)"))
+         org-todo-keyword-faces '(("STRT" . +org-todo-active)
+                                  ("WAIT" . +org-todo-onhold)
+                                  ("HOLD" . +org-todo-onhold)
+                                  ("PROJ" . +org-todo-project)
+                                  ("KILL" . +org-todo-cancel))
+         org-capture-templates '(("t" "Todo" entry
+                                  (file+headline +org-capture-todo-file "Inbox")
+                                  "* TODO %?\n%i\n%a" :prepend t)
+                                 ("n" "Note" entry
+                                  (file+headline +org-capture-notes-file "Inbox")
+                                  "* %u %?\n%i\n%a" :prepend t)
+                                 ("j" "Journal" entry
+                                  (file+olp+datetree +org-capture-journal-file)
+                                  "* %U %?\n%i\n%a" :prepend t))))
 
 (add-hook! 'org-mode-hook 'auto-fill-mode)
 
 (setq-hook! 'org-mode-hook fill-column 80)
 
-(setq org-roam-directory "~/doc/roam/"
-      org-roam-db-location (concat org-roam-directory ".db"))
+(setq! org-roam-directory "~/doc/roam/"
+       org-roam-db-location (concat org-roam-directory ".db"))
 
 (use-package! org-roam-ui
   :requires websocket
@@ -132,8 +145,8 @@
 ;;; PlantUML
 ;;
 
-(setq plantuml-default-exec-mode 'executable
-      org-plantuml-exec-mode 'plantuml)
+(setq! plantuml-default-exec-mode 'executable
+       org-plantuml-exec-mode 'plantuml)
 
 ;;
 ;;; Elisp
@@ -142,15 +155,11 @@
 (after! flycheck
   (pushnew! flycheck-disabled-checkers 'emacs-lisp-checkdoc))
 
-;; Turn this off because it leaves face artifacts when changing indentation.
-(add-hook! 'emacs-lisp-mode-hook
-  (highlight-indent-guides-mode -1))
-
 ;;
 ;;; Haskell
 ;;
 
-(setq lsp-haskell-formatting-provider "ormolu")
+(setq! lsp-haskell-formatting-provider "ormolu")
 
 ;;
 ;;; Nickel
@@ -186,38 +195,23 @@
 ;;; Elfeed
 ;;
 
-(setq elfeed-db-directory "~/.elfeed"
-      elfeed-enclosure-default-dir (concat elfeed-db-directory "/enclosures")
-      rmh-elfeed-org-files (list (concat elfeed-db-directory "/index.org"))
-      elfeed-goodies/powerline-default-separator nil
-      elfeed-goodies/entry-pane-size 0.75
-      elfeed-goodies/entry-pane-position 'bottom)
-
-(add-hook! 'elfeed-new-entry-hook
-           '((elfeed-make-tagger
-              :before "2 weeks ago"
-              :remove 'unread)
-             (elfeed-make-tagger
-              :feed-title "SberMarket Tech"
-              :entry-title (not ".*(DevOps|Golang).*")
-              :add 'junk
-              :remove 'unread)
-             (elfeed-make-tagger
-              :feed-title "dotconferences"
-              :entry-title (not ".*dotGo.*")
-              :add 'junk
-              :remove 'unread)))
+(setq! elfeed-db-directory "~/.elfeed"
+       elfeed-enclosure-default-dir (concat elfeed-db-directory "/enclosures")
+       rmh-elfeed-org-files (list (concat elfeed-db-directory "/index.org"))
+       elfeed-goodies/powerline-default-separator nil
+       elfeed-goodies/entry-pane-size 0.75
+       elfeed-goodies/entry-pane-position 'bottom)
 
 ;;
 ;;; mu4e
 ;;
 
 (after! mu4e
-  (setq sendmail-program (executable-find "msmtp")
-        send-mail-function #'smtpmail-send-it
-        message-sendmail-f-is-evil t
-        message-sendmail-extra-arguments '("--read-envelope-from")
-        message-send-mail-function #'message-send-mail-with-sendmail))
+  (setq! sendmail-program (executable-find "msmtp")
+         send-mail-function #'smtpmail-send-it
+         message-sendmail-f-is-evil t
+         message-sendmail-extra-arguments '("--read-envelope-from")
+         message-send-mail-function #'message-send-mail-with-sendmail))
 
 (setq-hook! 'mu4e-main-mode-hook mu4e-update-interval 30)
 
@@ -225,26 +219,25 @@
 ;;; Circe
 ;;
 
-(setq circe-network-options
-      (mapcar (lambda (server)
-                `(,server
-                  :server-buffer-name ,server
-                  :host "azahi.cc"
-                  :port 6697
-                  :tls t
-                  :logging nil
-                  :user ,(concat circe-default-user "/" server)
-                  :pass ,(lambda (&rest _)
-                           (+pass-get-secret "server/soju.shire.net/azahi"))))
-              '("libera" "oftc" "hackint" "rizon")))
+(setq! circe-network-options
+       (mapcar (lambda (server)
+                 `(,server
+                   :server-buffer-name ,server
+                   :host "azahi.cc"
+                   :port 6697
+                   :tls t
+                   :logging nil
+                   :user ,(concat circe-default-user "/" server)
+                   :pass ,(lambda (&rest _)
+                            (+pass-get-secret "server/soju.shire.net/azahi"))))
+               '("libera" "oftc" "hackint" "rizon")))
 
 ;;
 ;;; Sops
 ;;
 
 (use-package! sops
-  :config
-  (global-sops-mode 1))
+  :hook (doom-first-file . global-sops-mode))
 
 ;;
 ;;; Hledger
@@ -256,7 +249,7 @@
   :hook ((hledger-view-mode . hl-line-mode)
          (hledger-view-mode . center-text-for-reading))
   :init
-  (setq hledger-jfile "~/doc/accounting/current.journal")
+  (setq! hledger-jfile "~/doc/accounting/current.journal")
   :config
   (set-company-backend! 'hledger-mode 'hledger-company)
   (add-hook! 'hledger-mode-hook
@@ -272,4 +265,4 @@
                                  (make-local-variable 'compay-idle-delay)
                                  (setq-local company-idle-delay 0.1))))
   :init
-  (setq hledger-input-buffer-height 20))
+  (setq! hledger-input-buffer-height 20))
diff --git a/modules/emacs/doom/init.el b/modules/emacs/doom/init.el
index 5788fcc..b031880 100644
--- a/modules/emacs/doom/init.el
+++ b/modules/emacs/doom/init.el
@@ -83,7 +83,6 @@
        (sh +lsp +tree-sitter)
        web
        (yaml +lsp +tree-sitter)
-       (zig +lsp +tree-sitter)
 
        :email
        mu4e
diff --git a/modules/emacs/doom/packages.el b/modules/emacs/doom/packages.el
index 2edbf1a..0f908df 100644
--- a/modules/emacs/doom/packages.el
+++ b/modules/emacs/doom/packages.el
@@ -1,5 +1,7 @@
 (disable-packages! writegood-mode)
 
+(unpin! (:editor parinfer))
+
 (package! xclip)
 
 (package! org-roam-ui)
@@ -9,12 +11,15 @@
 (package! hledger-mode)
 
 (package! sops
-  :recipe (:type git
-           :host github
+  :recipe (:host github
            :repo "djgoku/sops"))
 
 (unpin! ansible)
 (package! ansible
-  :recipe (:type git
-           :host gitlab
+  :recipe (:host gitlab
            :repo "emacs-ansible/emacs-ansible"))
+
+(package! tvl
+  :recipe (:host nil
+           :repo "https://code.tvl.fyi/depot.git:/tools/emacs-pkgs/tvl.git"
+           :build nil))

Consider giving Nix/NixOS a try! <3