(oni home services emacs): Make helpful service config part of emacs
This commit is contained in:
parent
7a4a81229e
commit
d199525e1b
2 changed files with 34 additions and 41 deletions
|
@ -85,7 +85,6 @@
|
|||
#:use-module ((oni home services emacs)
|
||||
#:select (home-emacs-service-type
|
||||
home-emacs-configuration
|
||||
home-emacs-helpful-service-type
|
||||
home-emacs-helpful-configuration
|
||||
home-emacs-yasnippet-capf-service-type
|
||||
home-emacs-dashboard-service-type
|
||||
|
@ -411,6 +410,11 @@
|
|||
(service home-emacs-service-type
|
||||
(home-emacs-configuration
|
||||
(package my-emacs)
|
||||
(helpful-configuration
|
||||
(home-emacs-helpful-configuration
|
||||
(configurations
|
||||
(list
|
||||
(local-file "../services/emacs/oni-helpful.el")))))
|
||||
(configurations
|
||||
(list
|
||||
(local-file "../services/emacs/init.el")
|
||||
|
@ -423,11 +427,6 @@
|
|||
"(load custom-file)\n"
|
||||
"(provide 'init)\n"
|
||||
";;; init.el ends here\n")))))
|
||||
(service home-emacs-helpful-service-type
|
||||
(home-emacs-helpful-configuration
|
||||
(configurations
|
||||
(list
|
||||
(local-file "../services/emacs/oni-helpful.el")))))
|
||||
(service home-emacs-yasnippet-capf-service-type)
|
||||
(service home-emacs-dashboard-service-type
|
||||
(home-emacs-dashboard-configuration
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
text-config?
|
||||
serialize-text-config
|
||||
define-maybe
|
||||
maybe-value
|
||||
maybe-value-set?))
|
||||
#:use-module ((gnu packages emacs)
|
||||
#:select (emacs))
|
||||
|
@ -50,8 +51,6 @@
|
|||
|
||||
#:export (home-emacs-service-type
|
||||
home-emacs-configuration
|
||||
|
||||
home-emacs-helpful-service-type
|
||||
home-emacs-helpful-configuration
|
||||
|
||||
home-emacs-yasnippet-capf-service-type
|
||||
|
@ -109,19 +108,38 @@
|
|||
(text-config '())
|
||||
"The configuration for the extension."))
|
||||
|
||||
(define-configuration home-emacs-configuration
|
||||
(define-configuration/no-serialization home-emacs-helpful-configuration
|
||||
(package
|
||||
(package emacs-helpful)
|
||||
"Package to use for setting emacs-helpful.")
|
||||
(configurations
|
||||
(text-config '())
|
||||
"Configuration for emacs-helpful."))
|
||||
|
||||
(define-maybe home-emacs-helpful-configuration)
|
||||
|
||||
(define-configuration/no-serialization home-emacs-configuration
|
||||
(package
|
||||
(package emacs)
|
||||
"Package to use for setting Emacs")
|
||||
(custom-file
|
||||
(string "custom.el")
|
||||
"Location of the Custom file where customization settings are stored.")
|
||||
(helpful-configuration
|
||||
maybe-home-emacs-helpful-configuration
|
||||
"Configuration for helpful.")
|
||||
(configurations
|
||||
(text-config '())
|
||||
"A list of other configuration files to autoload"))
|
||||
|
||||
(define (add-emacs-packages config)
|
||||
(list (home-emacs-configuration-package config)))
|
||||
(delete *unspecified*
|
||||
(list (home-emacs-configuration-package config)
|
||||
(when (maybe-value-set?
|
||||
(home-emacs-configuration-helpful-configuration config))
|
||||
(home-emacs-helpful-configuration-package
|
||||
(maybe-value
|
||||
(home-emacs-configuration-helpful-configuration config)))))))
|
||||
|
||||
(define (home-emacs-extensions original-config extension-configs)
|
||||
(home-emacs-configuration
|
||||
|
@ -148,6 +166,13 @@
|
|||
,(mixed-text-file
|
||||
"init.el"
|
||||
(serialize-text-config config (home-emacs-configuration-configurations config))
|
||||
(if (maybe-value-set?
|
||||
(home-emacs-configuration-helpful-configuration config))
|
||||
(serialize-text-config
|
||||
config (home-emacs-helpful-configuration-configurations
|
||||
(maybe-value
|
||||
(home-emacs-configuration-helpful-configuration config))))
|
||||
"")
|
||||
(format #f "(setq custom-file (expand-file-name ~s user-emacs-directory))~%"
|
||||
(home-emacs-configuration-custom-file config))
|
||||
"(load custom-file :noerror)\n"
|
||||
|
@ -172,37 +197,6 @@
|
|||
(default-value (home-emacs-configuration))
|
||||
(description "Install and configure Emacs.")))
|
||||
|
||||
;;; Emacs Helpful
|
||||
|
||||
(define-configuration/no-serialization home-emacs-helpful-configuration
|
||||
(package
|
||||
(package emacs-helpful)
|
||||
"Package to use for setting emacs-helpful.")
|
||||
(configurations
|
||||
(text-config '())
|
||||
"Configuration for emacs-helpful."))
|
||||
|
||||
(define (add-emacs-helpful config)
|
||||
(home-emacs-extension
|
||||
(configurations (home-emacs-helpful-configuration-configurations config))))
|
||||
|
||||
(define (add-emacs-helpful-packages config)
|
||||
(list (home-emacs-helpful-configuration-package config)))
|
||||
|
||||
(define home-emacs-helpful-service-type
|
||||
(service-type
|
||||
(name 'home-emacs-helpful)
|
||||
(extensions
|
||||
(list (service-extension
|
||||
home-emacs-service-type
|
||||
add-emacs-helpful)
|
||||
(service-extension
|
||||
home-profile-service-type
|
||||
add-emacs-helpful-packages)))
|
||||
(compose identity)
|
||||
(default-value (home-emacs-helpful-configuration))
|
||||
(description "Install and configure emacs-helpful.")))
|
||||
|
||||
;;; Emacs Yasnippet Capf
|
||||
|
||||
(define-configuration/no-serialization home-emacs-yasnippet-capf-configuration
|
||||
|
|
Loading…
Add table
Reference in a new issue