2022-04-27 01:17:51 +03:00
|
|
|
{ lib, config, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
cfg = config.progs.himalaya;
|
2022-05-24 10:58:09 +03:00
|
|
|
|
|
|
|
devHimalaya = pkgs.himalaya.overrideAttrs (oldAttrs: {
|
|
|
|
src = builtins.fetchGit {
|
|
|
|
url = "https://github.com/soywod/himalaya.git";
|
|
|
|
ref = "development";
|
|
|
|
rev = "ba8ef9adf6effc40674765f995d19e9cfd1a8636";
|
|
|
|
};
|
|
|
|
});
|
|
|
|
|
2022-08-31 00:34:26 +03:00
|
|
|
himz = with pkgs; stdenv.mkDerivation {
|
|
|
|
name = "himz-0.1";
|
|
|
|
src = ../../scripts;
|
|
|
|
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
mkdir -p $out/bin
|
|
|
|
cp himz $out/bin/himz
|
|
|
|
wrapProgram "$out/bin/himz" --prefix PATH : "$out/bin:${lib.makeBinPath [ w3m fzf ]}"
|
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2022-05-24 10:58:09 +03:00
|
|
|
bin = "${devHimalaya}/bin/himalaya";
|
2022-04-27 01:17:51 +03:00
|
|
|
in
|
|
|
|
{
|
|
|
|
options.progs.himalaya = {
|
|
|
|
enable = mkOption {
|
|
|
|
type = types.bool;
|
|
|
|
default = false;
|
|
|
|
description = "Add himalaya with my personal configuration";
|
|
|
|
};
|
|
|
|
};
|
2022-08-29 15:40:41 +03:00
|
|
|
|
2022-04-27 01:17:51 +03:00
|
|
|
config = mkIf cfg.enable {
|
2022-08-31 00:34:26 +03:00
|
|
|
home.packages = [ himz ];
|
2022-04-27 01:17:51 +03:00
|
|
|
programs.himalaya = {
|
|
|
|
enable = true;
|
2022-05-24 10:58:09 +03:00
|
|
|
package = devHimalaya;
|
2022-04-27 01:17:51 +03:00
|
|
|
settings = {
|
2022-05-11 18:23:12 +03:00
|
|
|
default-page-size = 20;
|
2022-04-27 01:17:51 +03:00
|
|
|
downloads-dir = "${config.home.homeDirectory}/downloads/email";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|