From fc494ab25bfe60fb3680b105092ec66e8498631c Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Fri, 19 Apr 2024 22:58:03 -0700 Subject: [PATCH] =?UTF-8?q?feat(emacs):=20Add=20=E2=80=98org-modern?= =?UTF-8?q?=E2=80=99=20configuration?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- oni/home/config/rincewind.scm | 4 ++- oni/home/services/emacs.scm | 47 ++++++++++++++++++++++++++++++++--- 2 files changed, 47 insertions(+), 4 deletions(-) diff --git a/oni/home/config/rincewind.scm b/oni/home/config/rincewind.scm index a2ab0a9..e4f3f2e 100644 --- a/oni/home/config/rincewind.scm +++ b/oni/home/config/rincewind.scm @@ -96,7 +96,8 @@ home-emacs-golden-ratio-service-type home-emacs-pinentry-service-type home-emacs-vterm-service-type - home-emacs-vterm-configuration)) + home-emacs-vterm-configuration + home-emacs-org-modern-service-type)) #:use-module ((oni home services environment) #:select (home-environment-service)) #:use-module ((oni home services flameshot) @@ -445,6 +446,7 @@ (service home-emacs-vterm-service-type (home-emacs-vterm-configuration (buffer-name-string "*vterm* %s"))) + (service home-emacs-org-modern-service-type) (service home-flameshot-service-type) diff --git a/oni/home/services/emacs.scm b/oni/home/services/emacs.scm index 2155b4c..2018be5 100644 --- a/oni/home/services/emacs.scm +++ b/oni/home/services/emacs.scm @@ -15,7 +15,8 @@ emacs-eros emacs-ace-link emacs-pinentry - emacs-vterm)) + emacs-vterm + emacs-org-modern)) #:use-module ((gnu home services) #:select (service-type service-extension @@ -67,7 +68,10 @@ home-emacs-pinentry-configuration home-emacs-vterm-service-type - home-emacs-vterm-configuration)) + home-emacs-vterm-configuration + + home-emacs-org-modern-service-type + home-emacs-org-modern-configuration)) (define-maybe string) @@ -475,7 +479,7 @@ (format #f "(setq vterm-buffer-name-string ~s)\n" buffer-name-string) "")) ";;;;; vterm-config ends here.\n")) - (home-emacs-vterm-configuration-extra-content config))))) + (home-emacs-vterm-configuration-extra-content config))))) (define (add-emacs-vterm-zsh-configuration config) (home-zsh-extension @@ -538,3 +542,40 @@ (compose identity) (default-value (home-emacs-vterm-configuration)) (description "Install and configure emacs-vterm."))) + +;;; Org-modern + +(define-configuration/no-serialization home-emacs-org-modern-configuration + (package + (package emacs-org-modern) + "Package to use for setting emacs-org-modern.") + (extra-content + (text-config '()) + "Extra content for emacs-org-modern configuration.")) + +(define (add-emacs-org-modern-configuration config) + (home-emacs-extension + (configurations + (append + (list (mixed-text-file "org-modern-config" + ";;;;; org-modern-config starts here.\n" + "(with-eval-after-load 'org (global-org-modern-mode))" + ";;;;; org-modern-config ends here.\n")) + (home-emacs-org-modern-configuration-extra-content config))))) + +(define (add-emacs-org-modern-packages config) + (list (home-emacs-org-modern-configuration-package config))) + +(define home-emacs-org-modern-service-type + (service-type + (name 'home-emacs-org-modern) + (extensions + (list (service-extension + home-emacs-service-type + add-emacs-org-modern-configuration) + (service-extension + home-profile-service-type + add-emacs-org-modern-packages))) + (compose identity) + (default-value (home-emacs-org-modern-configuration)) + (description "Install and configure emacs-org-modern.")))