system/nix/progs/hledger.nix

46 lines
830 B
Nix

{ 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
];
home.file = {
"finance/commodities.journal".text = ''
; Fiat currencies
commodity RUB 1000.00
commodity $1000.00
; Investment commodities
; Cryptocurrencies
; Other
; Default commodity
D RUB 1000.00
'';
};
programs.zsh.shellAliases = mkIf config.shell.zsh.enable hledgerAliases;
};
}