From ba3d6a902d3619b69be50f4558adc65ca9a98cf0 Mon Sep 17 00:00:00 2001 From: Simon Walker Date: Wed, 11 Sep 2024 12:08:41 +0100 Subject: [PATCH] Add helper for pr urls --- derivations/gh-pr-url/default.nix | 10 ++++++++++ derivations/gh-pr-url/gh-pr-url | 4 ++++ flake.nix | 1 + 3 files changed, 15 insertions(+) create mode 100644 derivations/gh-pr-url/default.nix create mode 100755 derivations/gh-pr-url/gh-pr-url diff --git a/derivations/gh-pr-url/default.nix b/derivations/gh-pr-url/default.nix new file mode 100644 index 00000000..bd525cc7 --- /dev/null +++ b/derivations/gh-pr-url/default.nix @@ -0,0 +1,10 @@ +{pkgs ? import {}}: +pkgs.stdenvNoCC.mkDerivation { + pname = "gh-pr-url"; + version = "unstable"; + src = ./.; + doBuild = false; + installPhase = '' + install -Dm755 ./gh-pr-url $out/bin/gh-pr-url + ''; +} diff --git a/derivations/gh-pr-url/gh-pr-url b/derivations/gh-pr-url/gh-pr-url new file mode 100755 index 00000000..b9c86aed --- /dev/null +++ b/derivations/gh-pr-url/gh-pr-url @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +set -e + +gh pr view --json url -t '{{.url}}' $* diff --git a/flake.nix b/flake.nix index 2c2e01af..ec2d9a34 100644 --- a/flake.nix +++ b/flake.nix @@ -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 {};