From 8cef9bfb590b1a1bfca07192231d71f056d1153e Mon Sep 17 00:00:00 2001 From: Noah Masur <7386960+nmasur@users.noreply.github.com> Date: Tue, 28 Jul 2026 10:20:53 -0400 Subject: [PATCH] feat(jjui): add custom github ruleset bypass commands --- docs/CHANGELOG.md | 1 + .../nmasur/presets/programs/jujutsu.nix | 26 +++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index dfba9d32..822f7e8a 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -2,6 +2,7 @@ ## 2026-07-25 +- Added jjui config generation to `jujutsu.nix` in Home Manager to include custom GitHub ruleset bypass commands (`ctrl+b` and `ctrl+shift+b`). - Added `overlays/cheetah3.nix` to disable `pythonMetadataCheckPhase` for `cheetah3`. This fixes an issue where the NixOS rebuild fails for `sabnzbd` due to `importlib.metadata.PackageNotFoundError: No package metadata was found for cheetah3` during the Python package evaluation in `nixos-unstable`. diff --git a/platforms/home-manager/modules/nmasur/presets/programs/jujutsu.nix b/platforms/home-manager/modules/nmasur/presets/programs/jujutsu.nix index 285e02c1..c32834c1 100644 --- a/platforms/home-manager/modules/nmasur/presets/programs/jujutsu.nix +++ b/platforms/home-manager/modules/nmasur/presets/programs/jujutsu.nix @@ -7,6 +7,7 @@ let cfg = config.nmasur.presets.programs.jujutsu; + tomlFormat = pkgs.formats.toml { }; in { @@ -31,6 +32,31 @@ in }; }; + xdg.configFile."jjui/config.toml".source = tomlFormat.generate "jjui-config" { + actions = [ + { + name = "set-github-bypass"; + lua = '' + exec_shell([[gh api --method PATCH -H "Accept: application/vnd.github+json" /repos/$(gh repo view --json nameWithOwner -q .nameWithOwner)/properties/values -f 'properties[][property_name]=Allow-Ruleset-Bypass' -f 'properties[][value]=true']]) + flash("Set GitHub rule bypass") + ''; + key = "ctrl+b"; + scope = "revisions"; + desc = "Set GitHub rule bypass"; + } + { + name = "remove-github-bypass"; + lua = '' + exec_shell([[gh api --method PATCH -H "Accept: application/vnd.github+json" /repos/$(gh repo view --json nameWithOwner -q .nameWithOwner)/properties/values -f 'properties[][property_name]=Allow-Ruleset-Bypass' -f 'properties[][value]=']]) + flash("Removed GitHub rule bypass") + ''; + key = "ctrl+shift+b"; + scope = "revisions"; + desc = "Remove GitHub rule bypass"; + } + ]; + }; + home.packages = [ # Required for the fsmonitor to auto-snapshot pkgs.stable.watchman