diff options
-rw-r--r-- | users/grfn/emacs.d/email.el | 11 | ||||
-rw-r--r-- | users/grfn/pkgs/notmuch-extract-patch.nix | 18 | ||||
-rw-r--r-- | users/grfn/system/home/modules/email.nix | 1 |
3 files changed, 30 insertions, 0 deletions
diff --git a/users/grfn/emacs.d/email.el b/users/grfn/emacs.d/email.el index 83076898b4dc..70360d00727c 100644 --- a/users/grfn/emacs.d/email.el +++ b/users/grfn/emacs.d/email.el @@ -40,3 +40,14 @@ (eq (car action) 'display-buffer-same-window)) :ignore t) + +(defun apply-thread-patchset (repo branch) + (interactive "Dgit repo: \nsnew branch name: ") + (let ((tid notmuch-show-thread-id) + (tmp "/tmp/notmuch-patchset")) + (shell-command (format "notmuch-extract-patch %s > %s && ( cd %s && git checkout -b %s && git am %s )" + (shell-quote-argument tid) + (shell-quote-argument tmp) + (shell-quote-argument (expand-file-name repo)) + (shell-quote-argument branch) + (shell-quote-argument tmp))))) diff --git a/users/grfn/pkgs/notmuch-extract-patch.nix b/users/grfn/pkgs/notmuch-extract-patch.nix new file mode 100644 index 000000000000..54dad260a041 --- /dev/null +++ b/users/grfn/pkgs/notmuch-extract-patch.nix @@ -0,0 +1,18 @@ +{ pkgs, ... }: + +let + inherit (pkgs) lib; + src = pkgs.fetchurl { + url = "https://raw.githubusercontent.com/aaptel/notmuch-extract-patch/f732a53e12a7c91a06755ebfab2007adc9b3063b/notmuch-extract-patch"; + sha256 = "0nawkl04sj7psw6ikzay7kydj3dhd0fkwghcsf5rzaw4bmp4kbax"; + }; + +in +pkgs.runCommandNoCC "notmuch-extract-patch" +{ + buildInputs = [ pkgs.python3 ]; +} '' + mkdir -p $out/bin + install -m 755 ${src} $out/bin/notmuch-extract-patch + patchShebangs $out/bin +'' diff --git a/users/grfn/system/home/modules/email.nix b/users/grfn/system/home/modules/email.nix index 63dfeeb6f480..4d5f3df69587 100644 --- a/users/grfn/system/home/modules/email.nix +++ b/users/grfn/system/home/modules/email.nix @@ -37,6 +37,7 @@ in home.packages = with pkgs; [ mu msmtp + config.lib.depot.users.grfn.pkgs.notmuch-extract-patch ]; systemd.user.services = mapAttrs' |