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
|
|
|
|
2022-09-04 22:26:19 +03:00
|
|
|
himz = with pkgs; stdenv.mkDerivation rec {
|
|
|
|
pname = "himz";
|
|
|
|
version = "2022-09-04";
|
2022-08-31 00:34:26 +03:00
|
|
|
src = ../../scripts;
|
|
|
|
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
|
2022-09-04 22:26:19 +03:00
|
|
|
wrapperPath = makeBinPath [ w3m fzf ];
|
2022-08-31 00:34:26 +03:00
|
|
|
|
2022-09-04 22:26:19 +03:00
|
|
|
installPhase = ''
|
2022-08-31 00:34:26 +03:00
|
|
|
mkdir -p $out/bin
|
|
|
|
cp himz $out/bin/himz
|
2022-09-04 22:26:19 +03:00
|
|
|
'';
|
2022-08-31 00:34:26 +03:00
|
|
|
|
2022-09-04 22:26:19 +03:00
|
|
|
postFixup = ''
|
|
|
|
# Ensure all dependencies are in PATH
|
|
|
|
wrapProgram $out/bin/himz \
|
|
|
|
--prefix PATH : "${wrapperPath}"
|
2022-08-31 00:34:26 +03:00
|
|
|
'';
|
|
|
|
};
|
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-09-04 22:26:19 +03:00
|
|
|
package = pkgs.himalaya-fixed;
|
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";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|