Commit 27b2746

HPCesia <me@hpcesia.com>
2026-10-02 17:17:03
jujutsu: add oyui as diff editor
1 parent d404a10
Changed files (1)
modules
modules/dev/jujutsu.nix
@@ -21,6 +21,7 @@
         packages = [
           jujutsu
           pkgs.jjui
+          pkgs.oyui
         ];
 
         xdg.config.files."jj/config.toml" = {
@@ -39,9 +40,47 @@
                   width = "$width";
                 })
                 ++ ["$left" "$right"];
+
+              diff-editor = [(lib.getExe pkgs.oyui) "diff" "$left" "$right"];
+              diff-instructions = false;
+            };
+            merge-tools.oyui = {
+              program = lib.getExe pkgs.oyui;
+              edit-args = ["diff" "$left" "$right"];
             };
           };
         };
+
+        xdg.config.files."oyui/config.rn" = {
+          generator = cfg: ''
+            pub fn config() {
+              // Theme
+              ${lib.concatMapAttrsStringSep "  \n"
+              (key: value:
+                if (key == "name")
+                then "theme::set(\"${value}\");"
+                else "theme::${key}::set(\"${value}\");")
+              cfg.theme or {}}
+
+              // Keybinds
+              ${lib.concatMapAttrsStringSep "  \n"
+              (key: value: "keybind(\"${key}\", || ${value});")
+              cfg.keybinds.global or {}}
+              on_mode("file", || {
+                ${lib.concatMapAttrsStringSep "    \n"
+              (key: value: "keybind(\"${key}\", || ${value});")
+              cfg.keybinds.file or {}}
+              });
+              on_mode("tree", || {
+                ${lib.concatMapAttrsStringSep "    \n"
+              (key: value: "keybind(\"${key}\", || ${value});")
+              cfg.keybinds.tree or {}}
+              });
+            }
+          '';
+          value = {
+          };
+        };
       };
     };
   };
@@ -57,6 +96,10 @@
           sign-on-push = true;
         };
       };
+
+      xdg.config.files."oyui/config.rn".value = {
+        theme.name = "catppuccin_mocha";
+      };
     };
   };
 }