Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{
2 lib,
3 stdenv,
4 buildGoModule,
5 buildPackages,
6 fetchFromGitHub,
7 installShellFiles,
8}:
9
10buildGoModule (finalAttrs: {
11 pname = "rospo";
12 version = "0.15.0";
13
14 src = fetchFromGitHub {
15 owner = "ferama";
16 repo = "rospo";
17 tag = "v${finalAttrs.version}";
18 hash = "sha256-xfCjRAsKJxtYeY2Mx+l1tDtqAF0SKjTCJCh1gCG+Rl8=";
19 };
20
21 vendorHash = "sha256-6hCaguJP7XXdxYYS2KuBegwPaKP8rD9YI5727HZo7uA=";
22
23 ldflags = [
24 "-s"
25 "-w"
26 "-X github.com/ferama/rospo/cmd.Version=${finalAttrs.version}"
27 ];
28
29 nativeBuildInputs = [ installShellFiles ];
30
31 doCheck = false;
32
33 postInstall =
34 let
35 rospoBin =
36 if stdenv.buildPlatform.canExecute stdenv.hostPlatform then
37 placeholder "out"
38 else
39 buildPackages.rospo;
40 in
41 ''
42 installShellCompletion --cmd rospo \
43 --bash <(${rospoBin}/bin/rospo completion bash) \
44 --fish <(${rospoBin}/bin/rospo completion fish) \
45 --zsh <(${rospoBin}/bin/rospo completion zsh)
46 '';
47
48 meta = {
49 description = "Simple, reliable, persistent ssh tunnels with embedded ssh server";
50 homepage = "https://github.com/ferama/rospo";
51 license = lib.licenses.mit;
52 maintainers = with lib.maintainers; [ sikmir ];
53 mainProgram = "rospo";
54 };
55})