From 39b3b25396eadb733f92a2a3a992a6a158faea4d Mon Sep 17 00:00:00 2001 From: Sage Date: Tue, 3 Mar 2026 15:49:22 +0000 Subject: [PATCH] Remove program --- modules/home/terminal/gh.nix | 42 ++---------------------------------- 1 file changed, 2 insertions(+), 40 deletions(-) diff --git a/modules/home/terminal/gh.nix b/modules/home/terminal/gh.nix index b1045a2..ce6ddf5 100644 --- a/modules/home/terminal/gh.nix +++ b/modules/home/terminal/gh.nix @@ -3,48 +3,10 @@ lib, config, ... -}: let - gh-pr-review = pkgs.writeShellScriptBin "gh-pr-review" '' - PR_NUMBER=$1 - if [ -z "$PR_NUMBER" ]; then - echo "Usage: gh-pr-review " - exit 1 - fi - - ORIGINAL_BRANCH=$(git branch --show-current) - HAS_CHANGES=$(git status --porcelain) - STASH_NAME="gh-pr-review-auto-stash-$(date +%s)" - - if [ -n "$HAS_CHANGES" ]; then - echo "Stashing local changes..." - git stash push -m "$STASH_NAME" - fi - - echo "Checking out PR #$PR_NUMBER..." - if gh pr checkout "$PR_NUMBER"; then - nvim -c "Octo review" - else - echo "Failed to checkout PR #$PR_NUMBER" - fi - - echo "Restoring original branch: $ORIGINAL_BRANCH" - git checkout "$ORIGINAL_BRANCH" - - if [ -n "$HAS_CHANGES" ]; then - # Find the stash index by message to be safe - STASH_INDEX=$(git stash list | grep "$STASH_NAME" | cut -d: -f1 | head -n1) - if [ -n "$STASH_INDEX" ]; then - echo "Restoring stashed changes..." - git stash pop "$STASH_INDEX" - fi - fi - ''; -in { +}: { options.mods.terminal.gh.enable = lib.mkEnableOption "enables gh and gh-dash"; config = lib.mkIf config.mods.terminal.gh.enable { - home.packages = [gh-pr-review]; - programs.gh = { enable = true; extensions = [pkgs.gh-dash]; @@ -57,7 +19,7 @@ in { prs = [ { key = "d"; - command = "gh-pr-review {{.PrNumber}}"; + command = "nvim -c 'Octo review {{.PrNumber}}'"; } ]; };