49 lines
991 B
Nix
49 lines
991 B
Nix
{ 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";
|
|
};
|
|
};
|
|
};
|
|
}
|