about summary refs log tree commit diff stats
path: root/modules/by-name/hl/lhedger/module.nix
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--modules/by-name/hl/lhedger/module.nix18
1 files changed, 16 insertions, 2 deletions
diff --git a/modules/by-name/hl/lhedger/module.nix b/modules/by-name/hl/lhedger/module.nix
index 36df4450..68de85d0 100644
--- a/modules/by-name/hl/lhedger/module.nix
+++ b/modules/by-name/hl/lhedger/module.nix
@@ -15,6 +15,7 @@
   ...
 }: let
   cfg = config.soispha.hledger;
+  ledgerFile = "${config.home-manager.users.soispha.xdg.dataHome}/hledger/2025.journal";
 in {
   options.soispha.hledger = {
     enable = libraries.base.options.mkEnable "hledger";
@@ -22,20 +23,33 @@ in {
 
   config = lib.mkIf cfg.enable {
     environment.variables = {
-      LEDGER_FILE = "${config.home-manager.users.soispha.xdg.dataHome}/hledger/2025.journal";
+      LEDGER_FILE = ledgerFile;
     };
 
     home-manager.users.soispha = {
       home.packages = [
         pkgs.hledger
+
+        (pkgs.writeShellApplication {
+          name = "hledger-edit";
+
+          text = ''
+            "$EDITOR" ${lib.strings.escapeShellArg ledgerFile}
+          '';
+
+          inheritPath = true; # needs access to nvim
+        })
       ];
 
       xdg.configFile = {
         "hledger/hledger.conf".text =
           # ledger
           ''
-            # some comment
+            # Actually enforce more checks.
             --strict
+
+            # Use boxdrawing characters when possible.
+            --pretty
           '';
       };
     };