2022-05-03 23:35:29 +03:00
|
|
|
{ lib, config, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
cfg = config.progs.hledger;
|
|
|
|
hledgerAliases = {
|
|
|
|
# TODO: add aliases for business and family accounts
|
|
|
|
};
|
|
|
|
in
|
|
|
|
{
|
|
|
|
options.progs.hledger = {
|
|
|
|
enable = mkOption {
|
|
|
|
type = types.bool;
|
|
|
|
default = false;
|
|
|
|
description = "Add and configure hledger tool to manage finance";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
home.packages = with pkgs; [
|
|
|
|
hledger
|
|
|
|
hledger-ui
|
2022-05-15 13:19:20 +03:00
|
|
|
hledger-interest
|
2022-05-03 23:35:29 +03:00
|
|
|
];
|
|
|
|
|
|
|
|
home.file = {
|
|
|
|
"finance/commodities.journal".text = ''
|
|
|
|
; Fiat currencies
|
2022-05-15 13:19:20 +03:00
|
|
|
commodity 1.000,00 RUB
|
|
|
|
commodity 1.000,00 USD
|
2022-05-03 23:35:29 +03:00
|
|
|
|
|
|
|
; Investment commodities
|
|
|
|
|
|
|
|
; Cryptocurrencies
|
|
|
|
|
|
|
|
; Other
|
|
|
|
|
|
|
|
; Default commodity
|
2022-05-15 13:19:20 +03:00
|
|
|
; D 1.000,00 RUB
|
2022-05-03 23:35:29 +03:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
programs.zsh.shellAliases = mkIf config.shell.zsh.enable hledgerAliases;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|