1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 nixosTests,
6 autoreconfHook,
7 pkg-config,
8 libnl,
9 iptables,
10}:
11
12let
13 sourceAttrs = (import ./source.nix) { inherit fetchFromGitHub; };
14in
15
16stdenv.mkDerivation {
17 pname = "jool-cli";
18 version = sourceAttrs.version;
19
20 src = sourceAttrs.src;
21
22 patches = [ ./validate-config.patch ];
23
24 outputs = [
25 "out"
26 "man"
27 ];
28
29 nativeBuildInputs = [
30 autoreconfHook
31 pkg-config
32 ];
33 buildInputs = [
34 libnl
35 iptables
36 ];
37
38 makeFlags = [
39 "-C"
40 "src/usr"
41 ];
42
43 prePatch = ''
44 sed -e 's%^XTABLES_SO_DIR = .*%XTABLES_SO_DIR = '"$out"'/lib/xtables%g' -i src/usr/iptables/Makefile
45 '';
46
47 passthru.tests = {
48 inherit (nixosTests) jool;
49 };
50
51 meta = {
52 homepage = "https://www.jool.mx/";
53 description = "Fairly compliant SIIT and Stateful NAT64 for Linux - CLI tools";
54 platforms = lib.platforms.linux;
55 license = lib.licenses.gpl2Only;
56 maintainers = with lib.maintainers; [ fpletz ];
57 };
58}