about summary refs log tree commit diff
path: root/pkgs/servers/webmesh/default.nix
blob: 9b4930eb688843be535e018b2b0c5a0cb55bad10 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
{ lib
, buildGoModule
, fetchFromGitHub
}:

buildGoModule rec {
  pname = "webmesh";
  version = "0.1.2";

  src = fetchFromGitHub {
    owner = "webmeshproj";
    repo = pname;
    rev = "v${version}";
    hash = "sha256-S7kenBrnhM8V0TdbRe+CJP2XGHG/dZbfGVwdRurPeP8=";
  };

  vendorHash = "sha256-LBd5IrNFGkEhz+joDv6juL7WuoFyoqCXnmEHFB1K6Nc=";

  CGO_ENABLED = 0;

  subPackages = [ "cmd/node" "cmd/wmctl" ];

  ldflags = [
    "-w"
    "-s"
    "-X github.com/webmeshproj/webmesh/pkg/version.Version=${version}"
    "-X github.com/webmeshproj/webmesh/pkg/version.Commit=v${version}"
  ];

  postInstall = ''
    mv $out/bin/node $out/bin/webmesh-node
  '';

  meta = with lib; {
    description = "A simple, distributed, zero-configuration WireGuard mesh provider";
    homepage = "https://webmeshproj.github.io";
    license = licenses.asl20;
    maintainers = with maintainers; [ bbigras ];
  };
}