system/home/progs/himalaya.nix

45 lines
913 B
Nix

{ lib, config, pkgs, ... }:
with lib;
let
cfg = config.progs.himalaya;
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
'';
};
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.my-himalaya;
settings = {
default-page-size = 20;
downloads-dir = "${config.home.homeDirectory}/downloads/email";
};
};
};
}