From 586f6ba6b68873aa36f957183114249a57e2c2c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Tue, 27 Sep 2022 14:11:35 +0200 Subject: [PATCH] :bug: fix emacs ledger xcat not working --- modules/programs/ledger/default.nix | 31 ++++++++++++++++------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/modules/programs/ledger/default.nix b/modules/programs/ledger/default.nix index 3efcfab..29f8ee6 100644 --- a/modules/programs/ledger/default.nix +++ b/modules/programs/ledger/default.nix @@ -18,13 +18,22 @@ in }; config = mkIf cfg.enable { - my.shell.aliases = { - bal = "ledger bal"; - balcash = "ledger bal -R -X € --current --flat ^assets:bank ^liabilities"; - balnet = "ledger bal -R -X € --current --depth 2 ^assets ^liabilities"; - bud = ''ledger --budget --unbudgeted bal ^expenses -p "this month"''; - budr = ''ledger --budget reg -p "this month" ^expenses''; - reg = "ledger reg -R -V --tail 15"; + my.shell = { + variables = { + LEDGER_FILE = "/home/moritz/Nextcloud/Notes/ledger/main.ledger"; + }; + aliases = + let + applyCommon = name: command: "${command} --payee note --strict --explicit"; + in + mapAttrs applyCommon { + bal = "ledger bal"; + balcash = "ledger bal -R -X € --current --flat ^assets:bank ^liabilities"; + balnet = "ledger bal -R -X € --current --depth 2 ^assets ^liabilities"; + bud = ''ledger bal --budget --unbudgeted -p "this month"''; + budr = ''ledger reg --budget --unbudgeted -p "this month"''; + reg = "ledger reg -R -V --tail 15"; + }; }; home-manager.users.moritz = { home.packages = with pkgs; let @@ -40,17 +49,11 @@ in ''; }; in - [ ledger reg-copy ]; + [ ledger reg-copy hledger hledger-ui hledger-web ]; xdg.configFile = { "fish/completions/ledger.fish" = { text = builtins.readFile ./ledger.fish; }; - "ledger/ledgerrc".text = '' - --strict - --explicit - --payee note - --file ~/Notes/ledger/main.ledger - ''; }; }; };