nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 buildGoModule,
5 fetchFromGitHub,
6 installShellFiles,
7}:
8
9buildGoModule rec {
10 pname = "ghorg";
11 version = "1.11.7";
12
13 src = fetchFromGitHub {
14 owner = "gabrie30";
15 repo = "ghorg";
16 rev = "v${version}";
17 sha256 = "sha256-3aFEpSyKICJ6jWZAMprE4nV6OxMFVvM82bmKSV87Sng=";
18 };
19
20 doCheck = false;
21 vendorHash = null;
22
23 subPackages = [ "." ];
24
25 ldflags = [
26 "-s"
27 "-w"
28 "-X main.version=${version}"
29 ];
30
31 nativeBuildInputs = [ installShellFiles ];
32 postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
33 installShellCompletion --cmd ghorg \
34 --bash <($out/bin/ghorg completion bash) \
35 --fish <($out/bin/ghorg completion fish) \
36 --zsh <($out/bin/ghorg completion zsh)
37 '';
38
39 meta = {
40 description = "Quickly clone an entire org/users repositories into one directory";
41 longDescription = ''
42 ghorg allows you to quickly clone all of an orgs, or users repos into a
43 single directory. This can be useful in many situations including
44 - Searching an orgs/users codebase with ack, silver searcher, grep etc..
45 - Bash scripting
46 - Creating backups
47 - Onboarding
48 - Performing Audits
49 '';
50 homepage = "https://github.com/gabrie30/ghorg";
51 license = lib.licenses.asl20;
52 mainProgram = "ghorg";
53 };
54}