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