(define-module (tw home emacs) #:use-module (gnu) #:use-module (gnu home services) #:use-module (gnu home services shepherd) #:use-module (tw theme)) (use-package-modules base check cmake emacs emacs-xyz databases elf finance gcc haskell-apps llvm python-xyz sqlite) (define-public emacs-services (list (simple-service 'emacs-config home-xdg-configuration-files-service-type `(("emacs/include" ,(local-file "files/emacs-packages" #:recursive? #t)) ("emacs/init.el" ,(local-file "files/emacs-init.el")) (,(string-append "emacs/" (local-file-name catppuccin-emacs-theme)) ,catppuccin-emacs-theme))) (simple-service 'emacsclient-is-editor home-environment-variables-service-type `(("EDITOR" . "emacsclient -qc") ;; Tell emacsclient to return immediately after opening the file. I ;; can't put this in $EDITOR as many programs expect $EDITOR to exit ;; only when the user is done editing. ("ASYNC_EDITOR" . "emacsclient -qcn"))) (simple-service 'emacs-server home-shepherd-service-type (list (shepherd-service (documentation "Emacs server; connect using emacsclient.") (provision '(emacs)) (start #~(make-forkexec-constructor (list #$(file-append emacs "/bin/emacs") "--fg-daemon"))) (stop #~(make-kill-destructor))))))) (define-public emacs-packages (list ;; Development & language servers gnu-make python-yamllint actionlint shellcheck clang ; for clangd glibc ; for ldd gcc binutils patchelf elfutils python-lsp-server ;; Supported OotB by eglot, but not packaged by guix: ;; https://github.com/mads-hartmann/bash-language-server ;; https://github.com/regen100/cmake-language-server ;; https://github.com/hrsh7th/vscode-langservers-extracted ; {html,css,json}-languageserver ;; https://github.com/golang/tools/tree/master/gopls ; maybe? ;; https://github.com/artempyanykh/marksman ; Markdown ;; https://github.com/astoff/digestif ; (La)TeX ;; https://github.com/redhat-developer/yaml-language-server ;; Needs eglot config + not packaged (from lsp-mode): ;; https://github.com/graphql/graphiql/tree/main/packages/graphql-language-service-cli#readme ;; https://github.com/haskell/haskell-language-server / https://github.com/haskell/ghcide ;; https://github.com/eclipse/lemminx ;; Emacs general emacs emacs-use-package emacs-eglot emacs-counsel emacs-counsel-dash sqlite ; emacs-counsel-dash requires the sqlite3 binary emacs-ivy ;; emacs-company emacs-company-quickhelp emacs-company-posframe emacs-corfu emacs-corfu-doc emacs-autothemer ; for catppuccin/emacs emacs-undo-tree emacs-aggressive-indent emacs-which-key emacs-smart-mode-line emacs-diminish emacs-rainbow-mode emacs-form-feed emacs-guix ;; TODO: emacs-editorconfig emacs-sly emacs-sly-macrostep emacs-org ; emacs-org-modern theme? ;; Emacs Evil emacs-evil emacs-evil-collection emacs-evil-expat ; for :reverse, :remove, :rename, :colo, :g*, ... ex commands emacs-evil-surround ;; emacs-evil-owl ; tests failing emacs-evil-args emacs-evil-numbers emacs-evil-multiedit emacs-evil-goggles emacs-evil-traces emacs-evil-commentary emacs-evil-replace-with-register emacs-evil-org emacs-evil-markdown emacs-evil-tex emacs-evil-text-object-python ;; Emacs language modes emacs-geiser emacs-geiser-guile ;; emacs-macrostep-geiser emacs-flymake-collection ; emacs-flymake-flycheck ; if needed emacs-cmake-mode emacs-gnuplot emacs-graphviz-dot-mode emacs-hcl-mode emacs-ledger-mode emacs-mmm-mode emacs-puppet-mode emacs-rec-mode emacs-web-mode emacs-yaml-mode))