diff --git a/home/progs/himalaya.nix b/home/progs/himalaya.nix index bb044fd..98ac38a 100644 --- a/home/progs/himalaya.nix +++ b/home/progs/himalaya.nix @@ -5,20 +5,24 @@ with lib; let cfg = config.progs.himalaya; - himz = with pkgs; stdenv.mkDerivation { - name = "himz-0.1"; + himz = with pkgs; stdenv.mkDerivation rec { + pname = "himz"; + version = "2022-09-04"; src = ../../scripts; nativeBuildInputs = [ makeWrapper ]; - installPhase = '' - runHook preInstall + wrapperPath = makeBinPath [ w3m fzf ]; + installPhase = '' mkdir -p $out/bin cp himz $out/bin/himz - wrapProgram "$out/bin/himz" --prefix PATH : "$out/bin:${lib.makeBinPath [ w3m fzf ]}" + ''; - runHook postInstall + postFixup = '' + # Ensure all dependencies are in PATH + wrapProgram $out/bin/himz \ + --prefix PATH : "${wrapperPath}" ''; }; in @@ -35,7 +39,7 @@ in home.packages = [ himz ]; programs.himalaya = { enable = true; - package = pkgs.my-himalaya; + package = pkgs.himalaya-fixed; settings = { default-page-size = 20; downloads-dir = "${config.home.homeDirectory}/downloads/email"; diff --git a/overlays/himalaya.nix b/overlays/himalaya.nix index 879dbac..89ab972 100644 --- a/overlays/himalaya.nix +++ b/overlays/himalaya.nix @@ -1,5 +1,5 @@ final: prev: { - my-himalaya = prev.himalaya.overrideAttrs (oldAttrs: rec { + himalaya-fixed = prev.himalaya.overrideAttrs (oldAttrs: rec { src = prev.fetchFromGitHub { owner = "pleshevskiy"; repo = "himalaya"; diff --git a/scripts/himz b/scripts/himz index e0e1957..d13fc40 100755 --- a/scripts/himz +++ b/scripts/himz @@ -16,10 +16,8 @@ function accounts() { function emails() { if [ "$#" != "0" ]; then local acc=$1 - local size=${2-50} - local w3m_cmd="w3m ${w3m_opts[@]}" - - local HIM_CMD="himalaya $himalaya_opts -a $acc list -s $size -w 150" + 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 \ @@ -29,7 +27,7 @@ function emails() { 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} +echo \$res | tail -n +3 | ${W3M_CMD} " \ --preview-window=down,70% \ --bind='ctrl-r:reload(eval $FZF_DEFAULT_COMMAND)'