From 4267ecbfb60827dd9d85070cf2fa7bff74a6b729 Mon Sep 17 00:00:00 2001 From: Timo Wilken Date: Tue, 21 Nov 2023 22:25:59 +0100 Subject: Package neomutt's mutt_oauth2.py script This gets rid of the last git submodule. --- tw/home/cern.scm | 11 +++-------- tw/home/files/neomutt | 1 - tw/home/lap.scm | 11 +++-------- tw/packages/mail.scm | 31 +++++++++++++++++++++++++++++++ 4 files changed, 37 insertions(+), 17 deletions(-) delete mode 160000 tw/home/files/neomutt create mode 100644 tw/packages/mail.scm (limited to 'tw') diff --git a/tw/home/cern.scm b/tw/home/cern.scm index e6ceffb0..8f446e3b 100644 --- a/tw/home/cern.scm +++ b/tw/home/cern.scm @@ -23,6 +23,7 @@ #:use-module (tw packages alice) #:use-module (tw packages ci) #:use-module (tw packages catppuccin) + #:use-module (tw packages mail) #:use-module (tw packages xorg) #:use-module (tw gexp) #:use-module (tw services desktop) @@ -33,7 +34,7 @@ (use-package-modules calendar dav mail web-browsers xdisorg xorg) (define pim-packages - (list vdirsyncer khal khard aerc lynx)) ; lynx for HTML mail + (list vdirsyncer khal khard aerc lynx mutt_oauth2.py)) ; lynx for HTML mail (define pim-services (list @@ -42,13 +43,7 @@ ("aerc/aerc.conf" ,(local-file "files/aerc/aerc.conf")) ("aerc/binds.conf" ,(local-file "files/aerc/binds.conf")) ("aerc/filters" ,(local-file "files/aerc/filters" #:recursive? #t)) - ("aerc/stylesets" ,(local-file "files/aerc/stylesets" #:recursive? #t)))) - - (simple-service 'mail-files home-files-service-type - `(;; The file from git main is newer than the one bundled with the - ;; packaged neomutt version and contains a few fixes. - (".local/bin/mutt_oauth2.py" - ,(local-file "files/neomutt/contrib/oauth2/mutt_oauth2.py" #:recursive? #t)))))) + ("aerc/stylesets" ,(local-file "files/aerc/stylesets" #:recursive? #t)))))) (define-public %cern-home (home-environment diff --git a/tw/home/files/neomutt b/tw/home/files/neomutt deleted file mode 160000 index 34816020..00000000 --- a/tw/home/files/neomutt +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 34816020295ace8f4b94a4da4c89367354457f47 diff --git a/tw/home/lap.scm b/tw/home/lap.scm index 9b79fb68..4f68ecd6 100644 --- a/tw/home/lap.scm +++ b/tw/home/lap.scm @@ -35,15 +35,16 @@ #:use-module ((tw packages games) ; (nongnu packages steam-client) #:select (steam-nvidia)) #:use-module (tw home) + #:use-module (tw packages mail) + #:use-module (tw packages scanner) #:use-module (tw services desktop) #:use-module (tw services git) #:use-module (tw services gnupg) - #:use-module (tw packages scanner) #:use-module (tw services restic) #:use-module (tw theme)) (define pim-packages - (list newsboat vdirsyncer khal khard aerc lynx)) ; lynx for HTML mail + (list newsboat vdirsyncer khal khard aerc lynx mutt_oauth2.py)) ; lynx for HTML mail (define pim-services (list @@ -67,12 +68,6 @@ #~(job "0,30 * * * *" ; every half hour (string-append #$(file-append vdirsyncer "/bin/vdirsyncer") " sync")))) - (simple-service 'mail-files home-files-service-type - `(;; The file from git main is newer than the one bundled with the - ;; packaged neomutt version and contains a few fixes. - (".local/bin/mutt_oauth2.py" - ,(local-file "files/neomutt/contrib/oauth2/mutt_oauth2.py" #:recursive? #t)))) - (service home-msmtp-service-type (home-msmtp-configuration (defaults (msmtp-configuration diff --git a/tw/packages/mail.scm b/tw/packages/mail.scm new file mode 100644 index 00000000..b45cabf7 --- /dev/null +++ b/tw/packages/mail.scm @@ -0,0 +1,31 @@ +(define-module (tw packages mail) + #:use-module (gnu packages mail) + #:use-module (gnu packages python) + #:use-module (guix build-system copy) + #:use-module (guix git-download) + #:use-module (guix packages)) + +(define-public mutt_oauth2.py + (package + (name "mutt_oauth2.py") + (version "20231103") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/neomutt/neomutt") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 "1z0c19nppf2bjzc5xxhx5ahms449cr1ycww2lq1qqx6f120xixgp")))) + (inputs (list python)) ; It's a Python script! + (build-system copy-build-system) + (arguments + '(#:install-plan '(("contrib/oauth2/mutt_oauth2.py" "bin/")))) + (home-page (package-home-page neomutt)) + (synopsis "OAuth2 authentication script from NeoMutt") + (description "Microsoft Exchange Online mail accounts require XOAUTH2 +login. This can be done with the @code{mutt_oauth2.py} script packaged with +NeoMutt, but the version of the script in Guix' NeoMutt package is too old, so +this package includes the latest script only.") + (license (package-license neomutt)))) -- cgit v1.2.3