From 6362b4d9b4c63dab8e156e918969e1da9aedbb3d Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Fri, 9 Apr 2021 13:47:58 -0400 Subject: [PATCH] Add himalaya read helper --- features/email/himalaya-client.nix | 13 +++++++++++++ flake.lock | 18 +++++++++--------- 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/features/email/himalaya-client.nix b/features/email/himalaya-client.nix index b8529a5..0829b17 100644 --- a/features/email/himalaya-client.nix +++ b/features/email/himalaya-client.nix @@ -9,8 +9,21 @@ # HACK: See note in flake.nix exec himalaya $* ''; + # Helper to read and display the (HTML) email message in Markdown, + # highlighted with pager. + himalayaReadMail = + pkgs.writeScriptBin "h-read" '' + #!${pkgs.stdenv.shell} + ${himalayaWithSslEnv}/bin/h read $* \ + | ${pkgs.pandoc}/bin/pandoc -f html -t markdown_strict \ + | ${pkgs.bat}/bin/bat -l md + ''; + # TODO more helpers + # - `h move` with fzf-selector for target folder in [ himalayaWithSslEnv + # Helpers + himalayaReadMail ]; } diff --git a/flake.lock b/flake.lock index 2d835e7..52a39ee 100644 --- a/flake.lock +++ b/flake.lock @@ -57,11 +57,11 @@ "utils": "utils" }, "locked": { - "lastModified": 1617900449, - "narHash": "sha256-p4zD94Y5cUI4ixQxh3OVf7ltayis3VXAUOkNcixPPy4=", + "lastModified": 1617989539, + "narHash": "sha256-478bA0h32oeVpQqnrqFd0nbPIpzMPquk7Zx7WBRgD9A=", "owner": "srid", "repo": "himalaya", - "rev": "7b0924286ceb6c5aa5a6c7d244d1dbd7ac103e52", + "rev": "470ab3019a1c43fe20bbdbd3c1da207d60dcc836", "type": "github" }, "original": { @@ -138,11 +138,11 @@ }, "nixpkgs_3": { "locked": { - "lastModified": 1617899217, - "narHash": "sha256-gd5JHH7IkeoIQ/oiGZSqDpGdGt7DMRJTQ8JiD8+hdOQ=", + "lastModified": 1617987980, + "narHash": "sha256-0D5vcBHvccMIpdZN9h4TqPGdiiRuGMpaO4jaj4iJu50=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "9e377a6ce42dccd9b624ae4ce8f978dc892ba0e2", + "rev": "ae09772927566314ad11e366ddb46a9c7ffb666a", "type": "github" }, "original": { @@ -152,11 +152,11 @@ }, "nixpkgs_4": { "locked": { - "lastModified": 1617636226, - "narHash": "sha256-iZhBWrOR2DoDs1C+0FlnM9AQLMol/qoGQ+d+S43CKJM=", + "lastModified": 1617899217, + "narHash": "sha256-gd5JHH7IkeoIQ/oiGZSqDpGdGt7DMRJTQ8JiD8+hdOQ=", "owner": "nixos", "repo": "nixpkgs", - "rev": "3d1a7716d7f1fccbd7d30ab3b2ed3db831f43bde", + "rev": "9e377a6ce42dccd9b624ae4ce8f978dc892ba0e2", "type": "github" }, "original": {