Skip to content

Commit

Permalink
Add helper for pr urls
Browse files Browse the repository at this point in the history
  • Loading branch information
simonrw committed Sep 11, 2024
1 parent b0f0dd3 commit 4a5ac3f
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
10 changes: 10 additions & 0 deletions derivations/gh-pr-url/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{pkgs ? import <nixpkgs> {}}:
pkgs.stdenvNoCC.mkDerivation {
pname = "gh-pr-url";
version = "unstable";
src = ./.;
doBuild = false;
installPhase = ''
install -Dm755 ./gh-pr-url $out/bin/gh-pr-url
'';
}
4 changes: 4 additions & 0 deletions derivations/gh-pr-url/gh-pr-url
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env bash
set -e

gh pr view --json url -t '{{.url}}' $*
1 change: 1 addition & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
cert-info = cert-info.packages.${system}.default;
simpleproxy = inputs.simpleproxy.packages.${system}.default;
gh-repo-url = final.callPackage ./derivations/gh-repo-url {};
gh-pr-url = final.callPackage ./derivations/gh-pr-url {};
gh-rebase-pr = final.callPackage ./derivations/gh-rebase-pr {};
wlman = final.callPackage ./derivations/wlman {};
check-certificate-revocation = final.callPackage ./derivations/check-certificate-revocation {};
Expand Down
1 change: 1 addition & 0 deletions home/gh.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
extensions = [
pkgs.gh-dash
pkgs.gh-repo-url
pkgs.gh-pr-url
pkgs.gh-rebase-pr
pkgs.gh-markdown-preview
];
Expand Down

0 comments on commit 4a5ac3f

Please sign in to comment.