summary refs log tree commit diff
path: root/pkgs/tools/networking/cjdns/default.nix
blob: 7f06eb6b3ef778adeb664f3270b6d5b9a825157a (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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
{ lib
, stdenv
, fetchFromGitHub
, rustPlatform
, nodejs
, which
, python39
, libuv
, util-linux
, nixosTests
}:

rustPlatform.buildRustPackage rec {
  pname = "cjdns";
  version = "21.4";

  src = fetchFromGitHub {
    owner = "cjdelisle";
    repo = "cjdns";
    rev = "cjdns-v${version}";
    sha256 = "sha256-vI3uHZwmbFqxGasKqgCl0PLEEO8RNEhwkn5ZA8K7bxU=";
  };

  cargoSha256 = "sha256-x3LxGOhGXrheqdke0eYiQVo/IqgWgcDrDNupdLjRPjA=";

  nativeBuildInputs = [
    which
    python39
    nodejs
  ] ++
    # for flock
    lib.optional stdenv.isLinux util-linux;

  buildInputs = [
    libuv
  ];

  env.NIX_CFLAGS_COMPILE = toString [
    "-O2"
    "-Wno-error=array-bounds"
    "-Wno-error=stringop-overflow"
    "-Wno-error=stringop-truncation"
  ] ++ lib.optionals (stdenv.cc.isGNU && lib.versionAtLeast stdenv.cc.version "11") [
    "-Wno-error=stringop-overread"
  ];

  passthru.tests.basic = nixosTests.cjdns;

  meta = with lib; {
    homepage = "https://github.com/cjdelisle/cjdns";
    description = "Encrypted networking for regular people";
    license = licenses.gpl3Plus;
    maintainers = with maintainers; [ ehmry ];
    platforms = platforms.linux;
  };
}