From 457394ea2229274fa8c81e20cc1d7ca7d96e981e Mon Sep 17 00:00:00 2001 From: janabhumi Date: Sun, 9 Oct 2022 14:14:04 +0300 Subject: [PATCH] refac: remove himalaya --- overlays/default.nix | 1 - overlays/himalaya.nix | 16 ----------- users/jan/home.nix | 1 - users/jan/progs/default.nix | 1 - users/jan/progs/himalaya.nix | 49 ------------------------------- users/jan/scripts/himz | 56 ------------------------------------ users/jan/shell/zsh.nix | 5 ---- 7 files changed, 129 deletions(-) delete mode 100644 overlays/himalaya.nix delete mode 100644 users/jan/progs/himalaya.nix delete mode 100755 users/jan/scripts/himz diff --git a/overlays/default.nix b/overlays/default.nix index 62257f2..2c5a6af 100644 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -1,4 +1,3 @@ [ - (import ./himalaya.nix) (import ./pass.nix) ] diff --git a/overlays/himalaya.nix b/overlays/himalaya.nix deleted file mode 100644 index 89ab972..0000000 --- a/overlays/himalaya.nix +++ /dev/null @@ -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="; - }); - }); -} diff --git a/users/jan/home.nix b/users/jan/home.nix index 44bb41d..97ff0a7 100644 --- a/users/jan/home.nix +++ b/users/jan/home.nix @@ -84,7 +84,6 @@ in pass.enable = true; # email manager - himalaya.enable = false; aerc.enable = true; # finance manager diff --git a/users/jan/progs/default.nix b/users/jan/progs/default.nix index 516420f..f31bf30 100644 --- a/users/jan/progs/default.nix +++ b/users/jan/progs/default.nix @@ -3,7 +3,6 @@ ./aerc ./exa.nix ./git.nix - ./himalaya.nix ./hledger.nix ./nvim.nix ./pass.nix diff --git a/users/jan/progs/himalaya.nix b/users/jan/progs/himalaya.nix deleted file mode 100644 index 98ac38a..0000000 --- a/users/jan/progs/himalaya.nix +++ /dev/null @@ -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"; - }; - }; - }; -} diff --git a/users/jan/scripts/himz b/users/jan/scripts/himz deleted file mode 100755 index d13fc40..0000000 --- a/users/jan/scripts/himz +++ /dev/null @@ -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 - diff --git a/users/jan/shell/zsh.nix b/users/jan/shell/zsh.nix index 41c7952..6a48b71 100644 --- a/users/jan/shell/zsh.nix +++ b/users/jan/shell/zsh.nix @@ -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