1{
2 boring,
3 buildGoModule,
4 fetchFromGitHub,
5 installShellFiles,
6 lib,
7 stdenv,
8 testers,
9}:
10
11buildGoModule (finalAttrs: {
12 pname = "boring";
13 version = "0.11.6";
14
15 src = fetchFromGitHub {
16 owner = "alebeck";
17 repo = "boring";
18 tag = finalAttrs.version;
19 hash = "sha256-mIR12OkdZll3MqlKF3OMqrc3C73SPmqypj0as9Y5LRQ=";
20 };
21
22 nativeBuildInputs = [
23 installShellFiles
24 ];
25
26 vendorHash = "sha256-1FVSKjsPDe4faaIioJG89556ibREcJt6xi28mp68Ea0=";
27
28 ldflags = [
29 "-s"
30 "-w"
31 "-X main.version=${finalAttrs.version}"
32 ];
33
34 postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
35 installShellCompletion --cmd boring \
36 --bash <($out/bin/boring --shell bash) \
37 --fish <($out/bin/boring --shell fish) \
38 --zsh <($out/bin/boring --shell zsh)
39 '';
40
41 passthru.tests.version = testers.testVersion {
42 package = boring;
43 command = "boring version";
44 version = "boring ${finalAttrs.version}";
45 };
46
47 meta = {
48 description = "SSH tunnel manager";
49 homepage = "https://github.com/alebeck/boring";
50 license = lib.licenses.mit;
51 maintainers = with lib.maintainers; [
52 jacobkoziej
53 ];
54 mainProgram = "boring";
55 };
56})