From fac6e98dbf977ffaf716566e8b6d6f862bfb64ec Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Fri, 29 Sep 2023 14:35:02 -0700 Subject: [PATCH] Add custom emacs-notmuch package This fixes a bug that exists in the package that the Notmuch logo doesn't show up in notmuch-hello. I'll try and make a couple of other changes before opening a pull request back to Guix to fix it. --- oni/home/config/rincewind.scm | 12 ++++++++---- oni/packages/emacs.scm | 34 +++++++++++++++++++++++++++++++++- 2 files changed, 41 insertions(+), 5 deletions(-) diff --git a/oni/home/config/rincewind.scm b/oni/home/config/rincewind.scm index 9f54bcb..d8600eb 100644 --- a/oni/home/config/rincewind.scm +++ b/oni/home/config/rincewind.scm @@ -53,7 +53,8 @@ #:select (local-file mixed-text-file)) #:use-module ((guix packages) - #:select (package-name)) + #:select (package-name + package-input-rewriting)) #:use-module ((guix transformations) #:select (options->transformation)) #:use-module ((nongnu packages emacs) @@ -119,7 +120,8 @@ #:use-module ((oni packages count-emails) #:select (count-emails)) #:use-module ((oni packages emacs) - #:select (emacs-inkplate)) + #:select (emacs-inkplate + oni-emacs-notmuch)) #:use-module ((oni packages emacs-config) #:select (emacs-oni-org-roam emacs-oni-vterm @@ -195,6 +197,9 @@ `((with-branch . ,(string-append (package-name package) "=master")))) package)) +(define with-my-emacs-notmuch-package + (package-input-rewriting `((,emacs-notmuch . ,oni-emacs-notmuch)))) + (define rincewind-picom-service (service home-picom-service-type (home-picom-configuration @@ -262,7 +267,6 @@ tmsu mpd-random-albums notmuch - emacs-notmuch emacs-inkplate emacs-outli emacs-guix @@ -277,7 +281,7 @@ emacs-oni-common-lisp emacs-oni-gui emacs-oni-magit - emacs-oni-notmuch + (with-my-emacs-notmuch-package emacs-oni-notmuch) emacs-oni-hy emacs-oni-project emacs-oni-bookmark diff --git a/oni/packages/emacs.scm b/oni/packages/emacs.scm index 526f96c..d6d9128 100644 --- a/oni/packages/emacs.scm +++ b/oni/packages/emacs.scm @@ -2,10 +2,14 @@ #:use-module (guix packages) #:use-module (guix utils) #:use-module (guix download) + #:use-module ((guix gexp) + #:select (gexp)) #:use-module (guix git-download) #:use-module (guix build-system emacs) #:use-module ((guix licenses) #:prefix license:) - #:use-module (gnu packages emacs-xyz)) + #:use-module (gnu packages emacs-xyz) + #:use-module ((gnu packages mail) + #:select (notmuch))) (define-public emacs-inkplate (let ((commit "0897721a7b3d84aa3f200ae85fddd5fdd370fc42") @@ -412,3 +416,31 @@ new-theme for a while. I couldn't think of a name so I named it after him.") (synopsis "Completion-At-Point Extension for YASnippet") (description "A simple capf (Completion-At-Point Function) for completing yasnippet snippets.") (license license:gpl3)))) + +(define-public oni-emacs-notmuch + (package + (inherit notmuch) + (name "oni-emacs-notmuch") + (build-system emacs-build-system) + (native-inputs '()) + (inputs + (list notmuch)) + (arguments + (list + #:exclude #~(cons* "make-deps.el" "rstdoc.el" %default-exclude) + #:include #~(cons* "notmuch-logo.svg" "notmuch-emacs-mua" %default-include) + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'chdir + (lambda _ + (chdir "emacs"))) + (add-after 'chdir 'patch-paths + (lambda* (#:key inputs #:allow-other-keys) + (let ((notmuch (search-input-file inputs "/bin/notmuch"))) + (substitute* "notmuch-lib.el" + (("\"notmuch\"") + (string-append "\"" notmuch "\""))))))))) + (synopsis "Run Notmuch within Emacs") + (description + "This package provides an Emacs-based interface to the Notmuch mail +system.")))