aboutsummaryrefslogtreecommitdiff
path: root/tw/home/emacs.scm
diff options
context:
space:
mode:
Diffstat (limited to 'tw/home/emacs.scm')
-rw-r--r--tw/home/emacs.scm51
1 files changed, 24 insertions, 27 deletions
diff --git a/tw/home/emacs.scm b/tw/home/emacs.scm
index d3696ac2..5b7b0437 100644
--- a/tw/home/emacs.scm
+++ b/tw/home/emacs.scm
@@ -7,6 +7,30 @@
(use-package-modules base cmake emacs emacs-xyz databases finance 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
@@ -74,30 +98,3 @@
emacs-hcl-mode emacs-ledger-mode emacs-mmm-mode
emacs-puppet-mode emacs-rec-mode emacs-web-mode
emacs-yaml-mode))
-
-(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
- 'emacs-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)))))))