Add Emacs Pinentry configuration

This commit is contained in:
Tom Willemse 2023-11-08 15:13:10 -08:00
parent 9f7b08def2
commit bf912c42ff
2 changed files with 66 additions and 5 deletions

View file

@ -89,7 +89,8 @@
home-emacs-eros-service-type home-emacs-eros-service-type
home-emacs-ace-link-service-type home-emacs-ace-link-service-type
home-emacs-ace-link-configuration home-emacs-ace-link-configuration
home-emacs-golden-ratio-service-type)) home-emacs-golden-ratio-service-type
home-emacs-pinentry-service-type))
#:use-module ((oni home services environment) #:use-module ((oni home services environment)
#:select (home-environment-service)) #:select (home-environment-service))
#:use-module ((oni home services flameshot) #:use-module ((oni home services flameshot)
@ -447,6 +448,7 @@
(goto-address-key "C-S-e") (goto-address-key "C-S-e")
(org-mode-key "C-S-e"))) (org-mode-key "C-S-e")))
(service home-emacs-golden-ratio-service-type) (service home-emacs-golden-ratio-service-type)
(service home-emacs-pinentry-service-type)
(service home-flameshot-service-type) (service home-flameshot-service-type)

View file

@ -13,7 +13,8 @@
#:select (emacs-helpful #:select (emacs-helpful
emacs-dashboard emacs-dashboard
emacs-eros emacs-eros
emacs-ace-link)) emacs-ace-link
emacs-pinentry))
#:use-module ((gnu home services) #:use-module ((gnu home services)
#:select (service-type #:select (service-type
service-extension service-extension
@ -52,10 +53,15 @@
home-emacs-ace-link-configuration home-emacs-ace-link-configuration
home-emacs-golden-ratio-service-type home-emacs-golden-ratio-service-type
home-emacs-golden-ratio-configuration)) home-emacs-golden-ratio-configuration
home-emacs-pinentry-service-type
home-emacs-pinentry-configuration))
(define-maybe string) (define-maybe string)
;;; Emacs
(define-configuration/no-serialization home-emacs-extension (define-configuration/no-serialization home-emacs-extension
(configurations (configurations
(text-config '()) (text-config '())
@ -116,6 +122,8 @@
(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 (define-configuration/no-serialization home-emacs-helpful-configuration
(package (package
(package emacs-helpful) (package emacs-helpful)
@ -145,6 +153,8 @@
(default-value (home-emacs-helpful-configuration)) (default-value (home-emacs-helpful-configuration))
(description "Install and configure emacs-helpful."))) (description "Install and configure emacs-helpful.")))
;;; Emacs Yasnippet Capf
(define-configuration/no-serialization home-emacs-yasnippet-capf-configuration (define-configuration/no-serialization home-emacs-yasnippet-capf-configuration
(package (package
(package emacs-yasnippet-capf) (package emacs-yasnippet-capf)
@ -178,6 +188,8 @@
(default-value (home-emacs-yasnippet-capf-configuration)) (default-value (home-emacs-yasnippet-capf-configuration))
(description "Install and configure emacs-yasnippet-capf."))) (description "Install and configure emacs-yasnippet-capf.")))
;;; Emacs Dashboard
(define-configuration/no-serialization home-emacs-dashboard-configuration (define-configuration/no-serialization home-emacs-dashboard-configuration
(package (package
(package emacs-dashboard) (package emacs-dashboard)
@ -212,6 +224,7 @@
(default-value (home-emacs-dashboard-configuration)) (default-value (home-emacs-dashboard-configuration))
(description "Install and configure emacs-dashboard."))) (description "Install and configure emacs-dashboard.")))
;;; Emacs Eros
(define-configuration/no-serialization home-emacs-eros-configuration (define-configuration/no-serialization home-emacs-eros-configuration
(package (package
@ -246,6 +259,8 @@
(default-value (home-emacs-eros-configuration)) (default-value (home-emacs-eros-configuration))
(description "Install and configure emacs-eros."))) (description "Install and configure emacs-eros.")))
;;; Emacs Ace Link
(define-configuration/no-serialization home-emacs-ace-link-configuration (define-configuration/no-serialization home-emacs-ace-link-configuration
(package (package
(package emacs-ace-link) (package emacs-ace-link)
@ -303,6 +318,8 @@
(default-value (home-emacs-ace-link-configuration)) (default-value (home-emacs-ace-link-configuration))
(description "Install and configure emacs-ace-link."))) (description "Install and configure emacs-ace-link.")))
;;; Emacs Golden Ratio
(define-configuration/no-serialization home-emacs-golden-ratio-configuration (define-configuration/no-serialization home-emacs-golden-ratio-configuration
(package (package
(package emacs-golden-ratio) (package emacs-golden-ratio)
@ -339,3 +356,45 @@
(compose identity) (compose identity)
(default-value (home-emacs-golden-ratio-configuration)) (default-value (home-emacs-golden-ratio-configuration))
(description "Install and configure emacs-golden-ratio."))) (description "Install and configure emacs-golden-ratio.")))
;;; Emacs Pinentry
(define-configuration/no-serialization home-emacs-pinentry-configuration
(package
(package emacs-pinentry)
"Package to use for setting emacs-pinentry.")
(auto-start?
(boolean #t)
"Should Emacs pinentry be enabled automatically?")
(extra-content
(text-config '())
"Extra content for emacs-pinentry configuration."))
(define (add-emacs-pinentry-configuration config)
(home-emacs-extension
(configurations
(append
(list (mixed-text-file "pinentry-config"
";;;;; pinentry-config starts here.\n"
(if (home-emacs-pinentry-configuration-auto-start? config)
"(pinentry-start)\n"
"")
";;;;; pinentry-config ends here.\n"))
(home-emacs-pinentry-configuration-extra-content config)))))
(define (add-emacs-pinentry-packages config)
(list (home-emacs-pinentry-configuration-package config)))
(define home-emacs-pinentry-service-type
(service-type
(name 'home-emacs-pinentry)
(extensions
(list (service-extension
home-emacs-service-type
add-emacs-pinentry-configuration)
(service-extension
home-profile-service-type
add-emacs-pinentry-packages)))
(compose identity)
(default-value (home-emacs-pinentry-configuration))
(description "Install and configure emacs-pinentry.")))