fedora-csb-system-manager
1{
2 buildGoModule,
3 lib,
4 makeWrapper,
5 installShellFiles,
6 gh,
7 fzf,
8 jq,
9 fetchFromGitHub,
10}:
11
12buildGoModule rec {
13 pname = "gh-pr";
14 version = "0.1.0";
15
16 src = fetchFromGitHub {
17 owner = "vdemeester";
18 repo = "x";
19 rev = "be677194b497b7610395f9f269418224a9ad999d";
20 hash = "sha256-AfmqSrI7XicmM+tiAvB6bcAR4HHbQmxqeTTEyEXgdng=";
21 };
22
23 vendorHash = "sha256-hocnLCzWN8srQcO3BMNkd2lt0m54Qe7sqAhUxVZlz1k=";
24
25 nativeBuildInputs = [
26 makeWrapper
27 installShellFiles
28 ];
29
30 # Build the gh-pr command
31 subPackages = [ "cmd/gh-pr" ];
32
33 # Wrap binary to include gh, fzf, and jq in PATH and install completions
34 postInstall = ''
35 wrapProgram $out/bin/gh-pr \
36 --prefix PATH : ${
37 lib.makeBinPath [
38 gh
39 fzf
40 jq
41 ]
42 }
43
44 # Generate shell completions
45 installShellCompletion --cmd gh-pr \
46 --bash <($out/bin/gh-pr completion bash) \
47 --fish <($out/bin/gh-pr completion fish) \
48 --zsh <($out/bin/gh-pr completion zsh)
49 '';
50
51 meta = {
52 description = "GitHub Pull Request management tool";
53 homepage = "https://github.com/vdemeester/x";
54 license = lib.licenses.mit;
55 platforms = lib.platforms.unix;
56 mainProgram = "gh-pr";
57 };
58}