refac: remove himalaya

This commit is contained in:
Dmitriy Pleshevskiy 2022-10-09 14:14:04 +03:00
parent b9835b5c6f
commit 457394ea22
Signed by: pleshevskiy
GPG key ID: 1B59187B161C0215
7 changed files with 0 additions and 129 deletions

View file

@ -1,4 +1,3 @@
[
(import ./himalaya.nix)
(import ./pass.nix)
]

View file

@ -1,16 +0,0 @@
final: prev: {
himalaya-fixed = prev.himalaya.overrideAttrs (oldAttrs: rec {
src = prev.fetchFromGitHub {
owner = "pleshevskiy";
repo = "himalaya";
rev = "e3d76874a24addbad542d42491a3d8234fbbca03";
sha256 = "sha256-IiDGZKGLIDgDQe8XE6ekYKzqXwp/v/zuEpMQlKiteT0=";
};
cargoDeps = oldAttrs.cargoDeps.overrideAttrs (prev.lib.const {
name = "${oldAttrs.pname}-vendor.tar.gz";
inherit src;
outputHash = "sha256-HqKHP8sa7Gj6DsaNIzLrslFu0veH9rDnYCnpFK5mxdM=";
});
});
}

View file

@ -84,7 +84,6 @@ in
pass.enable = true;
# email manager
himalaya.enable = false;
aerc.enable = true;
# finance manager

View file

@ -3,7 +3,6 @@
./aerc
./exa.nix
./git.nix
./himalaya.nix
./hledger.nix
./nvim.nix
./pass.nix

View file

@ -1,49 +0,0 @@
{ lib, config, pkgs, ... }:
with lib;
let
cfg = config.progs.himalaya;
himz = with pkgs; stdenv.mkDerivation rec {
pname = "himz";
version = "2022-09-04";
src = ../../scripts;
nativeBuildInputs = [ makeWrapper ];
wrapperPath = makeBinPath [ w3m fzf ];
installPhase = ''
mkdir -p $out/bin
cp himz $out/bin/himz
'';
postFixup = ''
# Ensure all dependencies are in PATH
wrapProgram $out/bin/himz \
--prefix PATH : "${wrapperPath}"
'';
};
in
{
options.progs.himalaya = {
enable = mkOption {
type = types.bool;
default = false;
description = "Add himalaya with my personal configuration";
};
};
config = mkIf cfg.enable {
home.packages = [ himz ];
programs.himalaya = {
enable = true;
package = pkgs.himalaya-fixed;
settings = {
default-page-size = 20;
downloads-dir = "${config.home.homeDirectory}/downloads/email";
};
};
};
}

View file

@ -1,56 +0,0 @@
#! /usr/bin/env bash
himalaya_opts="--color=always"
w3m_opts=("-T" "text/html" "-o" "display_link_number=1" "-dump")
function accounts() {
himalaya ${himalaya_opts[@]} accounts | \
awk '/imap/ { print $1 }' | \
sort | \
fzf --exit-0 --select-1 --ansi --layout=reverse \
--header="Accounts" \
--preview="himalaya $himalaya_opts -a {} list -s 10" \
--preview-window=right,80%
}
function emails() {
if [ "$#" != "0" ]; then
local acc=$1
local W3M_CMD="w3m ${w3m_opts[@]}"
local HIM_CMD="himalaya $himalaya_opts -a $acc list -w 150"
local selected=$(
FZF_DEFAULT_COMMAND="$HIM_CMD | grep '│'" \
fzf --exit-0 --ansi --layout=reverse \
--header-lines=1 \
--header="Account: ${acc}" \
--preview="
res=\$(himalaya $himalaya_opts -a $acc read -t html {1});
echo \$res | head -n 2;
echo -e "\\\\n\===============================================================================\\\\n";
echo \$res | tail -n +3 | ${W3M_CMD}
" \
--preview-window=down,70% \
--bind='ctrl-r:reload(eval $FZF_DEFAULT_COMMAND)'
)
echo $selected | awk '{ print $1 }'
fi
}
while :
do
acc=$(accounts)
if [ "$acc" == "" ]; then
break
fi
eid=$(emails $acc $@)
if [ "$eid" != "" ]; then
IFS=
res=$(himalaya $himalaya_opts -a $acc read -t html $eid)
echo $res | head -n 2
echo -e "\n===============================================================================\n"
echo $res | tail -n +3 | w3m ${w3m_opts[@]}
break
fi
done

View file

@ -39,11 +39,6 @@ in
theme = mkIf (!config.shell.prompt.starship.enable) "robbyrussell";
};
initExtraFirst = ''
# nix
source $HOME/.nix-profile/etc/profile.d/hm-session-vars.sh
'';
initExtra = ''
any-nix-shell zsh --info-right | source /dev/stdin