aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Tom Willemse2025-02-12 22:34:03 -0800
committerGravatar Tom Willemse2025-02-12 22:34:03 -0800
commitd199525e1bb71f4400fab0ba9639814f98e644d6 (patch)
tree0dad9951f505769666e42afdc5623a43a46e2b37
parent7a4a81229e398105a2319a5c74d10c99d1538c77 (diff)
downloadnew-dotfiles-d199525e1bb71f4400fab0ba9639814f98e644d6.tar.gz
new-dotfiles-d199525e1bb71f4400fab0ba9639814f98e644d6.zip
(oni home services emacs): Make helpful service config part of emacs
-rw-r--r--oni/home/config/rincewind.scm11
-rw-r--r--oni/home/services/emacs.scm64
2 files changed, 34 insertions, 41 deletions
diff --git a/oni/home/config/rincewind.scm b/oni/home/config/rincewind.scm
index b1e2aff..e2b73f1 100644
--- a/oni/home/config/rincewind.scm
+++ b/oni/home/config/rincewind.scm
@@ -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
diff --git a/oni/home/services/emacs.scm b/oni/home/services/emacs.scm
index 530cd7d..62dfe00 100644
--- a/oni/home/services/emacs.scm
+++ b/oni/home/services/emacs.scm
@@ -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