system/home/progs/himalaya.nix

56 lines
1.2 KiB
Nix
Raw Normal View History

{ lib, config, pkgs, ... }:
with lib;
let
cfg = config.progs.himalaya;
devHimalaya = pkgs.himalaya.overrideAttrs (oldAttrs: {
src = builtins.fetchGit {
url = "https://github.com/soywod/himalaya.git";
ref = "development";
rev = "ba8ef9adf6effc40674765f995d19e9cfd1a8636";
};
});
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
'';
};
bin = "${devHimalaya}/bin/himalaya";
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
config = mkIf cfg.enable {
home.packages = [ himz ];
programs.himalaya = {
enable = true;
package = devHimalaya;
settings = {
default-page-size = 20;
downloads-dir = "${config.home.homeDirectory}/downloads/email";
};
};
};
}