47 lines
1.4 KiB
Scheme
47 lines
1.4 KiB
Scheme
|
(define-module (oni home services emacs)
|
||
|
#:use-module (gnu services configuration)
|
||
|
#:use-module (gnu packages emacs)
|
||
|
#:use-module (gnu home services)
|
||
|
#:use-module (gnu home services shepherd)
|
||
|
#:use-module (gnu home services utils)
|
||
|
#:use-module (guix packages)
|
||
|
#:use-module (guix gexp)
|
||
|
|
||
|
#:export (home-emacs-service-type
|
||
|
home-emacs-configuration))
|
||
|
|
||
|
(define-configuration home-emacs-configuration
|
||
|
(package
|
||
|
(package emacs)
|
||
|
"Package to use for setting Emacs"))
|
||
|
|
||
|
(define (add-emacs-packages config)
|
||
|
(list (home-emacs-configuration-package config)))
|
||
|
|
||
|
(define (home-emacs-shepherd-service config)
|
||
|
(list
|
||
|
(shepherd-service
|
||
|
(documentation "Start Emacs")
|
||
|
(provision '(emacs))
|
||
|
(auto-start? #t)
|
||
|
(start
|
||
|
#~(make-forkexec-constructor
|
||
|
(list #$(file-append (home-emacs-configuration-package config) "/bin/emacs")
|
||
|
"--fg-daemon")
|
||
|
#:log-file (format #f "~a/.local/var/log/xbindkeys.log" (getenv "HOME"))))
|
||
|
(stop #~(make-kill-destructor)))))
|
||
|
|
||
|
(define home-emacs-service-type
|
||
|
(service-type
|
||
|
(name 'home-emacs)
|
||
|
(extensions
|
||
|
(list (service-extension
|
||
|
home-profile-service-type
|
||
|
add-emacs-packages)
|
||
|
(service-extension
|
||
|
home-shepherd-service-type
|
||
|
home-emacs-shepherd-service)))
|
||
|
(compose identity)
|
||
|
(default-value (home-emacs-configuration))
|
||
|
(description "Install and configure Emacs.")))
|