system/home/progs/himalaya.nix

50 lines
991 B
Nix
Raw Normal View History

{ lib, config, pkgs, ... }:
with lib;
let
cfg = config.progs.himalaya;
2022-09-04 22:26:19 +03:00
himz = with pkgs; stdenv.mkDerivation rec {
pname = "himz";
version = "2022-09-04";
src = ../../scripts;
nativeBuildInputs = [ makeWrapper ];
2022-09-04 22:26:19 +03:00
wrapperPath = makeBinPath [ w3m fzf ];
2022-09-04 22:26:19 +03:00
installPhase = ''
mkdir -p $out/bin
cp himz $out/bin/himz
2022-09-04 22:26:19 +03:00
'';
2022-09-04 22:26:19 +03:00
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";
};
};
2022-08-29 15:40:41 +03:00
config = mkIf cfg.enable {
home.packages = [ himz ];
programs.himalaya = {
enable = true;
2022-09-04 22:26:19 +03:00
package = pkgs.himalaya-fixed;
settings = {
default-page-size = 20;
downloads-dir = "${config.home.homeDirectory}/downloads/email";
};
};
};
}