diff options
Diffstat (limited to 'nixpkgs/pkgs/tools/networking')
589 files changed, 27644 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/tools/networking/6tunnel/default.nix b/nixpkgs/pkgs/tools/networking/6tunnel/default.nix new file mode 100644 index 000000000000..fbdd23f754ef --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/6tunnel/default.nix @@ -0,0 +1,23 @@ +{ stdenv, lib, fetchFromGitHub, autoreconfHook }: + +stdenv.mkDerivation rec { + pname = "6tunnel"; + version = "0.13"; + + src = fetchFromGitHub { + owner = "wojtekka"; + repo = pname; + rev = version; + sha256 = "0zsx9d6xz5w8zvrqsm8r625gpbqqhjzvjdzc3z8yix668yg8ff8h"; + }; + + nativeBuildInputs = [ autoreconfHook ]; + + meta = with lib; { + description = "Tunnelling for application that don't speak IPv6"; + homepage = "https://github.com/wojtekka/6tunnel"; + license = licenses.gpl2; + maintainers = with maintainers; [ Br1ght0ne ]; + platforms = platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/acme-client/default.nix b/nixpkgs/pkgs/tools/networking/acme-client/default.nix new file mode 100644 index 000000000000..f20d4eefb479 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/acme-client/default.nix @@ -0,0 +1,31 @@ +{ lib, stdenv +, fetchurl +, libbsd +, libressl +, pkg-config +}: + +with lib; + +stdenv.mkDerivation rec { + pname = "acme-client"; + version = "1.2.0"; + + src = fetchurl { + url = "https://data.wolfsden.cz/sources/acme-client-${version}.tar.xz"; + sha256 = "sha256-fRSYwQmyV0WapjUJNG0UGO/tUDNTGUraj/BWq/a1QTo="; + }; + + nativeBuildInputs = [ pkg-config ]; + buildInputs = [ libbsd libressl ]; + + makeFlags = [ "PREFIX=${placeholder "out"}" ]; + + meta = { + homepage = "https://sr.ht/~graywolf/acme-client-portable/"; + description = "Secure ACME/Let's Encrypt client"; + platforms = platforms.unix; + license = licenses.isc; + maintainers = with maintainers; [ pmahoney ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/ahcpd/default.nix b/nixpkgs/pkgs/tools/networking/ahcpd/default.nix new file mode 100644 index 000000000000..75a7fc83858a --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/ahcpd/default.nix @@ -0,0 +1,22 @@ +{ lib, stdenv, fetchurl }: + +stdenv.mkDerivation rec { + name = "ahcpd-0.53"; + + src = fetchurl { + url = "http://www.pps.univ-paris-diderot.fr/~jch/software/files/${name}.tar.gz"; + sha256 = "0lhdmky3zdyk51hclv2lrhw3hzymbdc8bw2khs3rnaibgn0jwqm4"; + }; + + preBuild = '' + makeFlags="PREFIX=$out ETCDIR=$out/etc" + sed -i -e s,etc,$out/etc, Makefile + ''; + + meta = { + homepage = "http://www.pps.univ-paris-diderot.fr/~jch/software/ahcp/"; + description = "Autoconfiguration protocol for IPv6 and dual-stack IPv6/IPv4 networks"; + license = lib.licenses.mit; + platforms = lib.platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/aircrack-ng/default.nix b/nixpkgs/pkgs/tools/networking/aircrack-ng/default.nix new file mode 100644 index 000000000000..33a90636659a --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/aircrack-ng/default.nix @@ -0,0 +1,33 @@ +{ lib, stdenv, fetchurl, libpcap, openssl, zlib, wirelesstools +, iw, ethtool, pciutils, libnl, pkg-config, makeWrapper +, autoreconfHook, usbutils }: + +stdenv.mkDerivation rec { + name = "aircrack-ng-1.6"; + + src = fetchurl { + url = "https://download.aircrack-ng.org/${name}.tar.gz"; + sha256 = "0ix2k64qg7x3w0bzdsbk1m50kcpq1ws59g3zkwiafvpwdr4gs2sg"; + }; + + nativeBuildInputs = [ pkg-config makeWrapper autoreconfHook ]; + buildInputs = [ libpcap openssl zlib libnl iw ethtool pciutils ]; + + patchPhase = '' + sed -e 's@/usr/local/bin@'${wirelesstools}@ -i lib/osdep/linux.c + ''; + + postFixup = '' + wrapProgram $out/bin/airmon-ng --prefix PATH : ${lib.makeBinPath [ + ethtool iw pciutils usbutils + ]} + ''; + + meta = with lib; { + description = "Wireless encryption cracking tools"; + homepage = "http://www.aircrack-ng.org/"; + license = licenses.gpl2Plus; + maintainers = with maintainers; [ ]; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/airfield/default.nix b/nixpkgs/pkgs/tools/networking/airfield/default.nix new file mode 100644 index 000000000000..374a76871cb0 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/airfield/default.nix @@ -0,0 +1,71 @@ +{ lib, stdenv, fetchFromGitHub +, pkgs, makeWrapper, buildEnv +, nodejs, runtimeShell +}: + +let + nodePackages = import ./node.nix { + inherit pkgs; + system = stdenv.hostPlatform.system; + }; + + runtimeEnv = buildEnv { + name = "airfield-runtime"; + paths = with nodePackages; [ + nodePackages."express-3.0.5" nodePackages."swig-0.14.0" + nodePackages."consolidate-0.10.0" redis connect-redis + async request + ]; + }; + + name = "airfield-${version}"; + version = "2015-01-04"; + + src = stdenv.mkDerivation { + name = "${name}-src"; + inherit version; + + src = fetchFromGitHub { + owner = "emblica"; + repo = "airfield"; + rev = "f021b19a35be3db9be7780318860f3b528c48641"; + sha256 = "1xk69x89kgg98hm7c2ysyfmg7pkvgkpg4wym6v5cmdkdid08fsgs"; + }; + + dontBuild = true; + + installPhase = '' + mkdir $out + cp -R . $out + ''; + }; +in stdenv.mkDerivation { + inherit name version src; + + nativeBuildInputs = [ makeWrapper ]; + buildInputs = [ nodejs ]; + + dontBuild = true; + + installPhase = '' + mkdir -p $out/bin + cat >$out/bin/airfield <<EOF + #!${runtimeShell} + ${nodejs}/bin/node ${src}/airfield.js + EOF + ''; + + postFixup = '' + chmod +x $out/bin/airfield + wrapProgram $out/bin/airfield \ + --set NODE_PATH "${runtimeEnv}/lib/node_modules" + ''; + + meta = with lib; { + description = "A web-interface for hipache-proxy"; + license = licenses.mit; + homepage = "https://github.com/emblica/airfield"; + maintainers = with maintainers; [ offline ]; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/airfield/deps.json b/nixpkgs/pkgs/tools/networking/airfield/deps.json new file mode 100644 index 000000000000..f6b3c5a91468 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/airfield/deps.json @@ -0,0 +1,8 @@ +[ { "express": "3.0.5" } +, { "swig": "0.14.0" } +, { "consolidate": "0.10.0" } +, "redis" +, "connect-redis" +, "async" +, "request" +] diff --git a/nixpkgs/pkgs/tools/networking/airfield/deps.sh b/nixpkgs/pkgs/tools/networking/airfield/deps.sh new file mode 100755 index 000000000000..f33ec8e2ab56 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/airfield/deps.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env nix-shell +#! nix-shell -i bash -p nodePackages.node2nix + +node2nix --nodejs-10 -i deps.json \ + --no-copy-node-env \ + -e ../../../development/node-packages/node-env.nix -c node.nix diff --git a/nixpkgs/pkgs/tools/networking/airfield/node-packages.nix b/nixpkgs/pkgs/tools/networking/airfield/node-packages.nix new file mode 100644 index 000000000000..b43d29380090 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/airfield/node-packages.nix @@ -0,0 +1,829 @@ +# This file has been generated by node2nix 1.9.0. Do not edit! + +{nodeEnv, fetchurl, fetchgit, nix-gitignore, stdenv, lib, globalBuildInputs ? []}: + +let + sources = { + "ajv-6.12.6" = { + name = "ajv"; + packageName = "ajv"; + version = "6.12.6"; + src = fetchurl { + url = "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz"; + sha512 = "j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g=="; + }; + }; + "asn1-0.2.4" = { + name = "asn1"; + packageName = "asn1"; + version = "0.2.4"; + src = fetchurl { + url = "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz"; + sha512 = "jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg=="; + }; + }; + "assert-plus-1.0.0" = { + name = "assert-plus"; + packageName = "assert-plus"; + version = "1.0.0"; + src = fetchurl { + url = "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz"; + sha1 = "f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525"; + }; + }; + "asynckit-0.4.0" = { + name = "asynckit"; + packageName = "asynckit"; + version = "0.4.0"; + src = fetchurl { + url = "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz"; + sha1 = "c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79"; + }; + }; + "aws-sign2-0.7.0" = { + name = "aws-sign2"; + packageName = "aws-sign2"; + version = "0.7.0"; + src = fetchurl { + url = "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz"; + sha1 = "b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8"; + }; + }; + "aws4-1.11.0" = { + name = "aws4"; + packageName = "aws4"; + version = "1.11.0"; + src = fetchurl { + url = "https://registry.npmjs.org/aws4/-/aws4-1.11.0.tgz"; + sha512 = "xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA=="; + }; + }; + "bcrypt-pbkdf-1.0.2" = { + name = "bcrypt-pbkdf"; + packageName = "bcrypt-pbkdf"; + version = "1.0.2"; + src = fetchurl { + url = "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz"; + sha1 = "a4301d389b6a43f9b67ff3ca11a3f6637e360e9e"; + }; + }; + "buffer-crc32-0.1.1" = { + name = "buffer-crc32"; + packageName = "buffer-crc32"; + version = "0.1.1"; + src = fetchurl { + url = "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.1.1.tgz"; + sha1 = "7e110dc9953908ab7c32acdc70c9f945b1cbc526"; + }; + }; + "bytes-0.1.0" = { + name = "bytes"; + packageName = "bytes"; + version = "0.1.0"; + src = fetchurl { + url = "https://registry.npmjs.org/bytes/-/bytes-0.1.0.tgz"; + sha1 = "c574812228126d6369d1576925a8579db3f8e5a2"; + }; + }; + "caseless-0.12.0" = { + name = "caseless"; + packageName = "caseless"; + version = "0.12.0"; + src = fetchurl { + url = "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz"; + sha1 = "1b681c21ff84033c826543090689420d187151dc"; + }; + }; + "combined-stream-1.0.8" = { + name = "combined-stream"; + packageName = "combined-stream"; + version = "1.0.8"; + src = fetchurl { + url = "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz"; + sha512 = "FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg=="; + }; + }; + "commander-0.6.1" = { + name = "commander"; + packageName = "commander"; + version = "0.6.1"; + src = fetchurl { + url = "https://registry.npmjs.org/commander/-/commander-0.6.1.tgz"; + sha1 = "fa68a14f6a945d54dbbe50d8cdb3320e9e3b1a06"; + }; + }; + "connect-2.7.1" = { + name = "connect"; + packageName = "connect"; + version = "2.7.1"; + src = fetchurl { + url = "https://registry.npmjs.org/connect/-/connect-2.7.1.tgz"; + sha1 = "b869df9acf3dd8a0af7523c7c6f1aa8b4b761daa"; + }; + }; + "cookie-0.0.5" = { + name = "cookie"; + packageName = "cookie"; + version = "0.0.5"; + src = fetchurl { + url = "https://registry.npmjs.org/cookie/-/cookie-0.0.5.tgz"; + sha1 = "f9acf9db57eb7568c9fcc596256b7bb22e307c81"; + }; + }; + "cookie-signature-0.0.1" = { + name = "cookie-signature"; + packageName = "cookie-signature"; + version = "0.0.1"; + src = fetchurl { + url = "https://registry.npmjs.org/cookie-signature/-/cookie-signature-0.0.1.tgz"; + sha1 = "13d3603b5cf63befbf85a8801e37aa900db46985"; + }; + }; + "core-util-is-1.0.2" = { + name = "core-util-is"; + packageName = "core-util-is"; + version = "1.0.2"; + src = fetchurl { + url = "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz"; + sha1 = "b5fd54220aa2bc5ab57aab7140c940754503c1a7"; + }; + }; + "crc-0.2.0" = { + name = "crc"; + packageName = "crc"; + version = "0.2.0"; + src = fetchurl { + url = "https://registry.npmjs.org/crc/-/crc-0.2.0.tgz"; + sha1 = "f4486b9bf0a12df83c3fca14e31e030fdabd9454"; + }; + }; + "dashdash-1.14.1" = { + name = "dashdash"; + packageName = "dashdash"; + version = "1.14.1"; + src = fetchurl { + url = "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz"; + sha1 = "853cfa0f7cbe2fed5de20326b8dd581035f6e2f0"; + }; + }; + "debug-4.3.2" = { + name = "debug"; + packageName = "debug"; + version = "4.3.2"; + src = fetchurl { + url = "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz"; + sha512 = "mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw=="; + }; + }; + "delayed-stream-1.0.0" = { + name = "delayed-stream"; + packageName = "delayed-stream"; + version = "1.0.0"; + src = fetchurl { + url = "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz"; + sha1 = "df3ae199acadfb7d440aaae0b29e2272b24ec619"; + }; + }; + "denque-1.5.0" = { + name = "denque"; + packageName = "denque"; + version = "1.5.0"; + src = fetchurl { + url = "https://registry.npmjs.org/denque/-/denque-1.5.0.tgz"; + sha512 = "CYiCSgIF1p6EUByQPlGkKnP1M9g0ZV3qMIrqMqZqdwazygIA/YP2vrbcyl1h/WppKJTdl1F85cXIle+394iDAQ=="; + }; + }; + "ecc-jsbn-0.1.2" = { + name = "ecc-jsbn"; + packageName = "ecc-jsbn"; + version = "0.1.2"; + src = fetchurl { + url = "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz"; + sha1 = "3a83a904e54353287874c564b7549386849a98c9"; + }; + }; + "extend-3.0.2" = { + name = "extend"; + packageName = "extend"; + version = "3.0.2"; + src = fetchurl { + url = "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz"; + sha512 = "fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g=="; + }; + }; + "extsprintf-1.3.0" = { + name = "extsprintf"; + packageName = "extsprintf"; + version = "1.3.0"; + src = fetchurl { + url = "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz"; + sha1 = "96918440e3041a7a414f8c52e3c574eb3c3e1e05"; + }; + }; + "fast-deep-equal-3.1.3" = { + name = "fast-deep-equal"; + packageName = "fast-deep-equal"; + version = "3.1.3"; + src = fetchurl { + url = "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz"; + sha512 = "f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q=="; + }; + }; + "fast-json-stable-stringify-2.1.0" = { + name = "fast-json-stable-stringify"; + packageName = "fast-json-stable-stringify"; + version = "2.1.0"; + src = fetchurl { + url = "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz"; + sha512 = "lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw=="; + }; + }; + "forever-agent-0.6.1" = { + name = "forever-agent"; + packageName = "forever-agent"; + version = "0.6.1"; + src = fetchurl { + url = "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz"; + sha1 = "fbc71f0c41adeb37f96c577ad1ed42d8fdacca91"; + }; + }; + "form-data-2.3.3" = { + name = "form-data"; + packageName = "form-data"; + version = "2.3.3"; + src = fetchurl { + url = "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz"; + sha512 = "1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ=="; + }; + }; + "formidable-1.0.11" = { + name = "formidable"; + packageName = "formidable"; + version = "1.0.11"; + src = fetchurl { + url = "https://registry.npmjs.org/formidable/-/formidable-1.0.11.tgz"; + sha1 = "68f63325a035e644b6f7bb3d11243b9761de1b30"; + }; + }; + "fresh-0.1.0" = { + name = "fresh"; + packageName = "fresh"; + version = "0.1.0"; + src = fetchurl { + url = "https://registry.npmjs.org/fresh/-/fresh-0.1.0.tgz"; + sha1 = "03e4b0178424e4c2d5d19a54d8814cdc97934850"; + }; + }; + "getpass-0.1.7" = { + name = "getpass"; + packageName = "getpass"; + version = "0.1.7"; + src = fetchurl { + url = "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz"; + sha1 = "5eff8e3e684d569ae4cb2b1282604e8ba62149fa"; + }; + }; + "har-schema-2.0.0" = { + name = "har-schema"; + packageName = "har-schema"; + version = "2.0.0"; + src = fetchurl { + url = "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz"; + sha1 = "a94c2224ebcac04782a0d9035521f24735b7ec92"; + }; + }; + "har-validator-5.1.5" = { + name = "har-validator"; + packageName = "har-validator"; + version = "5.1.5"; + src = fetchurl { + url = "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz"; + sha512 = "nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w=="; + }; + }; + "http-signature-1.2.0" = { + name = "http-signature"; + packageName = "http-signature"; + version = "1.2.0"; + src = fetchurl { + url = "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz"; + sha1 = "9aecd925114772f3d95b65a60abb8f7c18fbace1"; + }; + }; + "is-typedarray-1.0.0" = { + name = "is-typedarray"; + packageName = "is-typedarray"; + version = "1.0.0"; + src = fetchurl { + url = "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz"; + sha1 = "e479c80858df0c1b11ddda6940f96011fcda4a9a"; + }; + }; + "isstream-0.1.2" = { + name = "isstream"; + packageName = "isstream"; + version = "0.1.2"; + src = fetchurl { + url = "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz"; + sha1 = "47e63f7af55afa6f92e1500e690eb8b8529c099a"; + }; + }; + "jsbn-0.1.1" = { + name = "jsbn"; + packageName = "jsbn"; + version = "0.1.1"; + src = fetchurl { + url = "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz"; + sha1 = "a5e654c2e5a2deb5f201d96cefbca80c0ef2f513"; + }; + }; + "json-schema-0.2.3" = { + name = "json-schema"; + packageName = "json-schema"; + version = "0.2.3"; + src = fetchurl { + url = "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz"; + sha1 = "b480c892e59a2f05954ce727bd3f2a4e882f9e13"; + }; + }; + "json-schema-traverse-0.4.1" = { + name = "json-schema-traverse"; + packageName = "json-schema-traverse"; + version = "0.4.1"; + src = fetchurl { + url = "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz"; + sha512 = "xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg=="; + }; + }; + "json-stringify-safe-5.0.1" = { + name = "json-stringify-safe"; + packageName = "json-stringify-safe"; + version = "5.0.1"; + src = fetchurl { + url = "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz"; + sha1 = "1296a2d58fd45f19a0f6ce01d65701e2c735b6eb"; + }; + }; + "jsprim-1.4.1" = { + name = "jsprim"; + packageName = "jsprim"; + version = "1.4.1"; + src = fetchurl { + url = "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz"; + sha1 = "313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2"; + }; + }; + "methods-0.0.1" = { + name = "methods"; + packageName = "methods"; + version = "0.0.1"; + src = fetchurl { + url = "https://registry.npmjs.org/methods/-/methods-0.0.1.tgz"; + sha1 = "277c90f8bef39709645a8371c51c3b6c648e068c"; + }; + }; + "mime-1.2.6" = { + name = "mime"; + packageName = "mime"; + version = "1.2.6"; + src = fetchurl { + url = "https://registry.npmjs.org/mime/-/mime-1.2.6.tgz"; + sha1 = "b1f86c768c025fa87b48075f1709f28aeaf20365"; + }; + }; + "mime-db-1.45.0" = { + name = "mime-db"; + packageName = "mime-db"; + version = "1.45.0"; + src = fetchurl { + url = "https://registry.npmjs.org/mime-db/-/mime-db-1.45.0.tgz"; + sha512 = "CkqLUxUk15hofLoLyljJSrukZi8mAtgd+yE5uO4tqRZsdsAJKv0O+rFMhVDRJgozy+yG6md5KwuXhD4ocIoP+w=="; + }; + }; + "mime-types-2.1.28" = { + name = "mime-types"; + packageName = "mime-types"; + version = "2.1.28"; + src = fetchurl { + url = "https://registry.npmjs.org/mime-types/-/mime-types-2.1.28.tgz"; + sha512 = "0TO2yJ5YHYr7M2zzT7gDU1tbwHxEUWBCLt0lscSNpcdAfFyJOVEpRYNS7EXVcTLNj/25QO8gulHC5JtTzSE2UQ=="; + }; + }; + "mkdirp-0.3.3" = { + name = "mkdirp"; + packageName = "mkdirp"; + version = "0.3.3"; + src = fetchurl { + url = "https://registry.npmjs.org/mkdirp/-/mkdirp-0.3.3.tgz"; + sha1 = "595e251c1370c3a68bab2136d0e348b8105adf13"; + }; + }; + "ms-2.1.2" = { + name = "ms"; + packageName = "ms"; + version = "2.1.2"; + src = fetchurl { + url = "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz"; + sha512 = "sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="; + }; + }; + "oauth-sign-0.9.0" = { + name = "oauth-sign"; + packageName = "oauth-sign"; + version = "0.9.0"; + src = fetchurl { + url = "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz"; + sha512 = "fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ=="; + }; + }; + "pause-0.0.1" = { + name = "pause"; + packageName = "pause"; + version = "0.0.1"; + src = fetchurl { + url = "https://registry.npmjs.org/pause/-/pause-0.0.1.tgz"; + sha1 = "1d408b3fdb76923b9543d96fb4c9dfd535d9cb5d"; + }; + }; + "performance-now-2.1.0" = { + name = "performance-now"; + packageName = "performance-now"; + version = "2.1.0"; + src = fetchurl { + url = "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz"; + sha1 = "6309f4e0e5fa913ec1c69307ae364b4b377c9e7b"; + }; + }; + "psl-1.8.0" = { + name = "psl"; + packageName = "psl"; + version = "1.8.0"; + src = fetchurl { + url = "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz"; + sha512 = "RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ=="; + }; + }; + "punycode-2.1.1" = { + name = "punycode"; + packageName = "punycode"; + version = "2.1.1"; + src = fetchurl { + url = "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz"; + sha512 = "XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A=="; + }; + }; + "qs-0.5.1" = { + name = "qs"; + packageName = "qs"; + version = "0.5.1"; + src = fetchurl { + url = "https://registry.npmjs.org/qs/-/qs-0.5.1.tgz"; + sha1 = "9f6bf5d9ac6c76384e95d36d15b48980e5e4add0"; + }; + }; + "qs-6.5.2" = { + name = "qs"; + packageName = "qs"; + version = "6.5.2"; + src = fetchurl { + url = "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz"; + sha512 = "N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA=="; + }; + }; + "range-parser-0.0.4" = { + name = "range-parser"; + packageName = "range-parser"; + version = "0.0.4"; + src = fetchurl { + url = "https://registry.npmjs.org/range-parser/-/range-parser-0.0.4.tgz"; + sha1 = "c0427ffef51c10acba0782a46c9602e744ff620b"; + }; + }; + "redis-commands-1.6.0" = { + name = "redis-commands"; + packageName = "redis-commands"; + version = "1.6.0"; + src = fetchurl { + url = "https://registry.npmjs.org/redis-commands/-/redis-commands-1.6.0.tgz"; + sha512 = "2jnZ0IkjZxvguITjFTrGiLyzQZcTvaw8DAaCXxZq/dsHXz7KfMQ3OUJy7Tz9vnRtZRVz6VRCPDvruvU8Ts44wQ=="; + }; + }; + "redis-errors-1.2.0" = { + name = "redis-errors"; + packageName = "redis-errors"; + version = "1.2.0"; + src = fetchurl { + url = "https://registry.npmjs.org/redis-errors/-/redis-errors-1.2.0.tgz"; + sha1 = "eb62d2adb15e4eaf4610c04afe1529384250abad"; + }; + }; + "redis-parser-3.0.0" = { + name = "redis-parser"; + packageName = "redis-parser"; + version = "3.0.0"; + src = fetchurl { + url = "https://registry.npmjs.org/redis-parser/-/redis-parser-3.0.0.tgz"; + sha1 = "b66d828cdcafe6b4b8a428a7def4c6bcac31c8b4"; + }; + }; + "safe-buffer-5.2.1" = { + name = "safe-buffer"; + packageName = "safe-buffer"; + version = "5.2.1"; + src = fetchurl { + url = "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz"; + sha512 = "rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ=="; + }; + }; + "safer-buffer-2.1.2" = { + name = "safer-buffer"; + packageName = "safer-buffer"; + version = "2.1.2"; + src = fetchurl { + url = "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz"; + sha512 = "YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="; + }; + }; + "send-0.1.0" = { + name = "send"; + packageName = "send"; + version = "0.1.0"; + src = fetchurl { + url = "https://registry.npmjs.org/send/-/send-0.1.0.tgz"; + sha1 = "cfb08ebd3cec9b7fc1a37d9ff9e875a971cf4640"; + }; + }; + "sshpk-1.16.1" = { + name = "sshpk"; + packageName = "sshpk"; + version = "1.16.1"; + src = fetchurl { + url = "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz"; + sha512 = "HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg=="; + }; + }; + "tough-cookie-2.5.0" = { + name = "tough-cookie"; + packageName = "tough-cookie"; + version = "2.5.0"; + src = fetchurl { + url = "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz"; + sha512 = "nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g=="; + }; + }; + "tunnel-agent-0.6.0" = { + name = "tunnel-agent"; + packageName = "tunnel-agent"; + version = "0.6.0"; + src = fetchurl { + url = "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz"; + sha1 = "27a5dea06b36b04a0a9966774b290868f0fc40fd"; + }; + }; + "tweetnacl-0.14.5" = { + name = "tweetnacl"; + packageName = "tweetnacl"; + version = "0.14.5"; + src = fetchurl { + url = "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz"; + sha1 = "5ae68177f192d4456269d108afa93ff8743f4f64"; + }; + }; + "underscore-1.12.0" = { + name = "underscore"; + packageName = "underscore"; + version = "1.12.0"; + src = fetchurl { + url = "https://registry.npmjs.org/underscore/-/underscore-1.12.0.tgz"; + sha512 = "21rQzss/XPMjolTiIezSu3JAjgagXKROtNrYFEOWK109qY1Uv2tVjPTZ1ci2HgvQDA16gHYSthQIJfB+XId/rQ=="; + }; + }; + "uri-js-4.4.1" = { + name = "uri-js"; + packageName = "uri-js"; + version = "4.4.1"; + src = fetchurl { + url = "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz"; + sha512 = "7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg=="; + }; + }; + "uuid-3.4.0" = { + name = "uuid"; + packageName = "uuid"; + version = "3.4.0"; + src = fetchurl { + url = "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz"; + sha512 = "HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A=="; + }; + }; + "verror-1.10.0" = { + name = "verror"; + packageName = "verror"; + version = "1.10.0"; + src = fetchurl { + url = "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz"; + sha1 = "3a105ca17053af55d6e270c1f8288682e18da400"; + }; + }; + }; +in +{ + "express-3.0.5" = nodeEnv.buildNodePackage { + name = "express"; + packageName = "express"; + version = "3.0.5"; + src = fetchurl { + url = "https://registry.npmjs.org/express/-/express-3.0.5.tgz"; + sha1 = "4c6e5850e6b5e8ca2af57f21ed7097de50948b73"; + }; + dependencies = [ + sources."buffer-crc32-0.1.1" + sources."bytes-0.1.0" + sources."commander-0.6.1" + sources."connect-2.7.1" + sources."cookie-0.0.5" + sources."cookie-signature-0.0.1" + sources."crc-0.2.0" + sources."debug-4.3.2" + sources."formidable-1.0.11" + sources."fresh-0.1.0" + sources."methods-0.0.1" + sources."mime-1.2.6" + sources."mkdirp-0.3.3" + sources."ms-2.1.2" + sources."pause-0.0.1" + sources."qs-0.5.1" + sources."range-parser-0.0.4" + sources."send-0.1.0" + ]; + buildInputs = globalBuildInputs; + meta = { + description = "Sinatra inspired web development framework"; + }; + production = true; + bypassCache = true; + reconstructLock = true; + }; + "swig-0.14.0" = nodeEnv.buildNodePackage { + name = "swig"; + packageName = "swig"; + version = "0.14.0"; + src = fetchurl { + url = "https://registry.npmjs.org/swig/-/swig-0.14.0.tgz"; + sha1 = "544bfb3bd837608873eed6a72c672a28cb1f1b3f"; + }; + dependencies = [ + sources."underscore-1.12.0" + ]; + buildInputs = globalBuildInputs; + meta = { + description = "A fast django-like templating engine for node.js and browsers."; + }; + production = true; + bypassCache = true; + reconstructLock = true; + }; + "consolidate-0.10.0" = nodeEnv.buildNodePackage { + name = "consolidate"; + packageName = "consolidate"; + version = "0.10.0"; + src = fetchurl { + url = "https://registry.npmjs.org/consolidate/-/consolidate-0.10.0.tgz"; + sha1 = "81f1a6ceba1247df9cef7a261ce527c2ce538f7a"; + }; + buildInputs = globalBuildInputs; + meta = { + description = "Template engine consolidation library"; + homepage = "https://github.com/visionmedia/consolidate.js"; + }; + production = true; + bypassCache = true; + reconstructLock = true; + }; + redis = nodeEnv.buildNodePackage { + name = "redis"; + packageName = "redis"; + version = "3.0.2"; + src = fetchurl { + url = "https://registry.npmjs.org/redis/-/redis-3.0.2.tgz"; + sha512 = "PNhLCrjU6vKVuMOyFu7oSP296mwBkcE6lrAjruBYG5LgdSqtRBoVQIylrMyVZD/lkF24RSNNatzvYag6HRBHjQ=="; + }; + dependencies = [ + sources."denque-1.5.0" + sources."redis-commands-1.6.0" + sources."redis-errors-1.2.0" + sources."redis-parser-3.0.0" + ]; + buildInputs = globalBuildInputs; + meta = { + description = "A high performance Redis client."; + homepage = "https://github.com/NodeRedis/node-redis"; + license = "MIT"; + }; + production = true; + bypassCache = true; + reconstructLock = true; + }; + connect-redis = nodeEnv.buildNodePackage { + name = "connect-redis"; + packageName = "connect-redis"; + version = "5.0.0"; + src = fetchurl { + url = "https://registry.npmjs.org/connect-redis/-/connect-redis-5.0.0.tgz"; + sha512 = "R4nTW5uXeG5s6zr/q4abmtcdloglZrL/A3cpa0JU0RLFJU4mTR553HUY8OZ0ngeySkGDclwQ5xmCcjjKkxdOSg=="; + }; + buildInputs = globalBuildInputs; + meta = { + description = "Redis session store for Connect"; + homepage = "https://github.com/visionmedia/connect-redis#readme"; + license = "MIT"; + }; + production = true; + bypassCache = true; + reconstructLock = true; + }; + async = nodeEnv.buildNodePackage { + name = "async"; + packageName = "async"; + version = "3.2.0"; + src = fetchurl { + url = "https://registry.npmjs.org/async/-/async-3.2.0.tgz"; + sha512 = "TR2mEZFVOj2pLStYxLht7TyfuRzaydfpxr3k9RpHIzMgw7A64dzsdqCxH1WJyQdoe8T10nDXd9wnEigmiuHIZw=="; + }; + buildInputs = globalBuildInputs; + meta = { + description = "Higher-order functions and common patterns for asynchronous code"; + homepage = "https://caolan.github.io/async/"; + license = "MIT"; + }; + production = true; + bypassCache = true; + reconstructLock = true; + }; + request = nodeEnv.buildNodePackage { + name = "request"; + packageName = "request"; + version = "2.88.2"; + src = fetchurl { + url = "https://registry.npmjs.org/request/-/request-2.88.2.tgz"; + sha512 = "MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw=="; + }; + dependencies = [ + sources."ajv-6.12.6" + sources."asn1-0.2.4" + sources."assert-plus-1.0.0" + sources."asynckit-0.4.0" + sources."aws-sign2-0.7.0" + sources."aws4-1.11.0" + sources."bcrypt-pbkdf-1.0.2" + sources."caseless-0.12.0" + sources."combined-stream-1.0.8" + sources."core-util-is-1.0.2" + sources."dashdash-1.14.1" + sources."delayed-stream-1.0.0" + sources."ecc-jsbn-0.1.2" + sources."extend-3.0.2" + sources."extsprintf-1.3.0" + sources."fast-deep-equal-3.1.3" + sources."fast-json-stable-stringify-2.1.0" + sources."forever-agent-0.6.1" + sources."form-data-2.3.3" + sources."getpass-0.1.7" + sources."har-schema-2.0.0" + sources."har-validator-5.1.5" + sources."http-signature-1.2.0" + sources."is-typedarray-1.0.0" + sources."isstream-0.1.2" + sources."jsbn-0.1.1" + sources."json-schema-0.2.3" + sources."json-schema-traverse-0.4.1" + sources."json-stringify-safe-5.0.1" + sources."jsprim-1.4.1" + sources."mime-db-1.45.0" + sources."mime-types-2.1.28" + sources."oauth-sign-0.9.0" + sources."performance-now-2.1.0" + sources."psl-1.8.0" + sources."punycode-2.1.1" + sources."qs-6.5.2" + sources."safe-buffer-5.2.1" + sources."safer-buffer-2.1.2" + sources."sshpk-1.16.1" + sources."tough-cookie-2.5.0" + sources."tunnel-agent-0.6.0" + sources."tweetnacl-0.14.5" + sources."uri-js-4.4.1" + sources."uuid-3.4.0" + sources."verror-1.10.0" + ]; + buildInputs = globalBuildInputs; + meta = { + description = "Simplified HTTP request client."; + homepage = "https://github.com/request/request#readme"; + license = "Apache-2.0"; + }; + production = true; + bypassCache = true; + reconstructLock = true; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/airfield/node.nix b/nixpkgs/pkgs/tools/networking/airfield/node.nix new file mode 100644 index 000000000000..0bcd0eb4b851 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/airfield/node.nix @@ -0,0 +1,17 @@ +# This file has been generated by node2nix 1.9.0. Do not edit! + +{pkgs ? import <nixpkgs> { + inherit system; + }, system ? builtins.currentSystem, nodejs ? pkgs."nodejs-10_x"}: + +let + nodeEnv = import ../../../development/node-packages/node-env.nix { + inherit (pkgs) stdenv lib python2 runCommand writeTextFile; + inherit pkgs nodejs; + libtool = if pkgs.stdenv.isDarwin then pkgs.darwin.cctools else null; + }; +in +import ./node-packages.nix { + inherit (pkgs) fetchurl nix-gitignore stdenv lib fetchgit; + inherit nodeEnv; +} diff --git a/nixpkgs/pkgs/tools/networking/altermime/default.nix b/nixpkgs/pkgs/tools/networking/altermime/default.nix new file mode 100644 index 000000000000..703af40864ae --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/altermime/default.nix @@ -0,0 +1,32 @@ +{ lib, gccStdenv, fetchurl }: + +gccStdenv.mkDerivation rec { + pname = "altermime"; + version = "0.3.11"; + + src = fetchurl { + url = "https://pldaniels.com/${pname}/${pname}-${version}.tar.gz"; + sha256 = "15zxg6spcmd35r6xbidq2fgcg2nzyv1sbbqds08lzll70mqx4pj7"; + }; + + NIX_CFLAGS_COMPILE = toString [ + "-Wno-error=format" + "-Wno-error=format-truncation" + "-Wno-error=pointer-compare" + "-Wno-error=memset-elt-size" + "-Wno-error=restrict" + ]; + + postPatch = '' + mkdir -p $out/bin + substituteInPlace Makefile --replace "/usr/local" "$out" + ''; + + meta = with lib; { + description = "MIME alteration tool"; + maintainers = [ maintainers.raskin ]; + platforms = platforms.all; + license.fullName = "alterMIME LICENSE"; + downloadPage = "https://pldaniels.com/altermime/"; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/amass/default.nix b/nixpkgs/pkgs/tools/networking/amass/default.nix new file mode 100644 index 000000000000..67dce4c2e8b7 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/amass/default.nix @@ -0,0 +1,44 @@ +{ buildGoModule +, fetchFromGitHub +, lib +}: + +buildGoModule rec { + pname = "amass"; + version = "3.11.2"; + + src = fetchFromGitHub { + owner = "OWASP"; + repo = "Amass"; + rev = "v${version}"; + sha256 = "sha256-3J4yT7GTuVzkxMb+fCD3S9u0XBHa4Y0W+BnkDJ4PhWI="; + }; + + vendorSha256 = "sha256-8GzzihKhrf71lLKgb2i3NnmSctvKb95V5pOGoWAgclk="; + + outputs = [ "out" "wordlists" ]; + + postInstall = '' + mkdir -p $wordlists + cp -R examples/wordlists/*.txt $wordlists + gzip $wordlists/*.txt + ''; + + meta = with lib; { + description = "In-Depth DNS Enumeration and Network Mapping"; + longDescription = '' + The OWASP Amass tool suite obtains subdomain names by scraping data + sources, recursive brute forcing, crawling web archives, + permuting/altering names and reverse DNS sweeping. Additionally, Amass + uses the IP addresses obtained during resolution to discover associated + netblocks and ASNs. All the information is then used to build maps of the + target networks. + + Amass ships with a set of wordlist (to be used with the amass -w flag) + that are found under the wordlists output. + ''; + homepage = "https://www.owasp.org/index.php/OWASP_Amass_Project"; + license = licenses.asl20; + maintainers = with maintainers; [ kalbasit ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/anevicon/default.nix b/nixpkgs/pkgs/tools/networking/anevicon/default.nix new file mode 100644 index 000000000000..cff22fa71e6e --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/anevicon/default.nix @@ -0,0 +1,43 @@ +{ lib +, stdenv +, fetchFromGitHub +, fetchpatch +, rustPlatform +, libiconv +, Security +}: + +rustPlatform.buildRustPackage rec { + pname = "anevicon"; + version = "0.1.0"; + + src = fetchFromGitHub { + owner = "rozgo"; + repo = pname; + rev = "v${version}"; + sha256 = "1m3ci7g7nn28p6x5m85av3ljgszwlg55f1hmgjnarc6bas5bapl7"; + }; + + cargoSha256 = "1g15v13ysx09fy0b8qddw5fwql2pvwzc2g2h1ndhzpxvfy7fzpr1"; + + buildInputs = lib.optionals stdenv.isDarwin [ libiconv Security ]; + + cargoPatches = [ + # Add Cargo.lock file, https://github.com/rozgo/anevicon/pull/1 + (fetchpatch { + name = "cargo-lock-file.patch"; + url = "https://github.com/rozgo/anevicon/commit/205440a0863aaea34394f30f4255fa0bb1704aed.patch"; + sha256 = "02syzm7irn4slr3s5dwwhvg1qx8fdplwlhza8gfkc6ajl7vdc7ri"; + }) + ]; + + # Tries to send large UDP packets that Darwin rejects. + doCheck = !stdenv.isDarwin; + + meta = with lib; { + description = "UDP-based load generator"; + homepage = "https://github.com/rozgo/anevicon"; + license = licenses.gpl3Only; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/argus-clients/default.nix b/nixpkgs/pkgs/tools/networking/argus-clients/default.nix new file mode 100644 index 000000000000..cd935a5f5d7d --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/argus-clients/default.nix @@ -0,0 +1,43 @@ +{ lib, stdenv, fetchurl, libpcap, bison, flex, cyrus_sasl, tcp_wrappers, pkg-config, perl, libtirpc, libnsl }: + +stdenv.mkDerivation rec { + pname = "argus-clients"; + version = "3.0.8.2"; + + src = fetchurl { + url = "http://qosient.com/argus/src/${pname}-${version}.tar.gz"; + sha256 = "1c9vj6ma00gqq9h92fg71sxcsjzz912166sdg90ahvnmvmh3l1rj"; + }; + + NIX_CFLAGS_COMPILE = [ "-I${libtirpc.dev}/include/tirpc" ]; + + postPatch = '' + for file in ./examples/*/*.pl; do + substituteInPlace $file \ + --subst-var-by PERLBIN ${perl}/bin/perl + done + ''; + + configureFlags = [ "--with-perl=${perl}/bin/perl" ]; + + nativeBuildInputs = [ pkg-config ]; + buildInputs = [ libpcap bison cyrus_sasl tcp_wrappers flex libnsl ]; + + meta = with lib; { + description = "Clients for ARGUS"; + longDescription = ''Clients for Audit Record Generation and + Utilization System (ARGUS). The Argus Project is focused on developing all + aspects of large scale network situtational awareness derived from + network activity audit. Argus, itself, is next-generation network + flow technology, processing packets, either on the wire or in + captures, into advanced network flow data. The data, its models, + formats, and attributes are designed to support Network + Operations, Performance and Security Management. If you need to + know what is going on in your network, right now or historically, + you will find Argus a useful tool. ''; + homepage = "http://qosient.com/argus"; + license = licenses.gpl2Plus; + maintainers = with maintainers; [ leenaars ]; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/argus/default.nix b/nixpkgs/pkgs/tools/networking/argus/default.nix new file mode 100644 index 000000000000..bbb9d2201447 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/argus/default.nix @@ -0,0 +1,46 @@ +{ lib, stdenv, fetchurl, libpcap, bison, flex, cyrus_sasl, tcp_wrappers, + pkg-config, procps, which, wget, lsof, net-snmp, perl }: + +stdenv.mkDerivation rec { + pname = "argus"; + version = "3.0.8.2"; + + src = fetchurl { + url = "http://qosient.com/argus/src/${pname}-${version}.tar.gz"; + sha256 = "1zzf688dbbcb5z2r9v1p28rddns6znzx35nc05ygza6lp7aknkna"; + }; + + nativeBuildInputs = [ pkg-config bison flex ]; + buildInputs = [ libpcap cyrus_sasl tcp_wrappers ]; + propagatedBuildInputs = [ procps which wget lsof net-snmp ]; + + patchPhase = '' + substituteInPlace events/argus-extip.pl \ + --subst-var-by PERLBIN ${perl}/bin/perl + substituteInPlace events/argus-lsof.pl \ + --replace "\`which lsof\`" "\"${lsof}/bin/lsof\"" \ + --subst-var-by PERLBIN ${perl}/bin/perl + substituteInPlace events/argus-vmstat.sh \ + --replace vm_stat ${procps}/bin/vmstat + substituteInPlace events/argus-snmp.sh \ + --replace /usr/bin/snmpget ${lib.getBin net-snmp}/bin/snmpget \ + --replace /usr/bin/snmpwalk ${lib.getBin net-snmp}/bin/snmpwalk + ''; + + meta = with lib; { + description = "Audit Record Generation and Utilization System for networks"; + longDescription = ''The Argus Project is focused on developing all + aspects of large scale network situtational awareness derived from + network activity audit. Argus, itself, is next-generation network + flow technology, processing packets, either on the wire or in + captures, into advanced network flow data. The data, its models, + formats, and attributes are designed to support Network + Operations, Performance and Security Management. If you need to + know what is going on in your network, right now or historically, + you will find Argus a useful tool. ''; + homepage = "http://qosient.com/argus"; + license = licenses.gpl2Plus; + maintainers = with maintainers; [ leenaars ]; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/aria2/default.nix b/nixpkgs/pkgs/tools/networking/aria2/default.nix new file mode 100644 index 000000000000..7e4f06302f2e --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/aria2/default.nix @@ -0,0 +1,46 @@ +{ lib, stdenv, fetchpatch, fetchFromGitHub, pkg-config, autoreconfHook +, openssl, c-ares, libxml2, sqlite, zlib, libssh2 +, cppunit, sphinx +, Security +}: + +stdenv.mkDerivation rec { + pname = "aria2"; + version = "1.35.0"; + + src = fetchFromGitHub { + owner = "aria2"; + repo = "aria2"; + rev = "release-${version}"; + sha256 = "195r3711ly3drf9jkygwdc2m7q99hiqlfrig3ip1127b837gzsf9"; + }; + + nativeBuildInputs = [ pkg-config autoreconfHook sphinx ]; + + buildInputs = [ openssl c-ares libxml2 sqlite zlib libssh2 ] ++ + lib.optional stdenv.isDarwin Security; + + outputs = [ "bin" "dev" "out" "doc" "man" ]; + + configureFlags = [ + "--with-ca-bundle=/etc/ssl/certs/ca-certificates.crt" + "--enable-libaria2" + ]; + + prePatch = '' + patchShebangs doc/manual-src/en/mkapiref.py + ''; + + checkInputs = [ cppunit ]; + doCheck = false; # needs the net + + enableParallelBuilding = true; + + meta = with lib; { + homepage = "https://aria2.github.io"; + description = "A lightweight, multi-protocol, multi-source, command-line download utility"; + license = licenses.gpl2Plus; + platforms = platforms.unix; + maintainers = with maintainers; [ Br1ght0ne koral ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/arping/default.nix b/nixpkgs/pkgs/tools/networking/arping/default.nix new file mode 100644 index 000000000000..4a5cae9bd3c4 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/arping/default.nix @@ -0,0 +1,25 @@ +{ lib, stdenv, fetchFromGitHub, autoreconfHook, libnet, libpcap }: + +stdenv.mkDerivation rec { + version = "2.21"; + pname = "arping"; + + buildInputs = [ libnet libpcap ]; + + src = fetchFromGitHub { + owner = "ThomasHabets"; + repo = pname; + rev = "${pname}-${version}"; + sha256 = "1i7rjn863bnq51ahbvypm1bkzhyshlm5b32yzdd9iaqyz7sa7pa7"; + }; + + nativeBuildInputs = [ autoreconfHook ]; + + meta = with lib; { + description = "Broadcasts a who-has ARP packet on the network and prints answers"; + homepage = "https://github.com/ThomasHabets/arping"; + license = with licenses; [ gpl2 ]; + maintainers = [ maintainers.michalrus ]; + platforms = platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/arpoison/default.nix b/nixpkgs/pkgs/tools/networking/arpoison/default.nix new file mode 100644 index 000000000000..6268d958204f --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/arpoison/default.nix @@ -0,0 +1,29 @@ +{ lib, stdenv, fetchzip, libnet }: + +stdenv.mkDerivation rec { + name = "arpoison-0.7"; + + buildInputs = [ libnet ]; + + src = fetchzip { + url = "http://www.arpoison.net/${name}.tar.gz"; + sha256 = "0krhszx3s0qwfg4rma5a51ak71nnd9xfs2ibggc3hwiz506s2x37"; + }; + + postPatch = "substituteInPlace Makefile --replace gcc cc"; + + installPhase = '' + mkdir -p $out/bin $out/share/man/man8 + gzip arpoison.8 + cp arpoison $out/bin + cp arpoison.8.gz $out/share/man/man8 + ''; + + meta = with lib; { + description = "UNIX arp cache update utility"; + homepage = "http://www.arpoison.net/"; + license = with licenses; [ gpl2 ]; + maintainers = [ maintainers.michalrus ]; + platforms = platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/assh/default.nix b/nixpkgs/pkgs/tools/networking/assh/default.nix new file mode 100644 index 000000000000..7d3c662b368f --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/assh/default.nix @@ -0,0 +1,47 @@ +{ lib +, buildGoModule +, fetchFromGitHub +, openssh +, makeWrapper +}: + +buildGoModule rec { + pname = "assh"; + version = "2.11.3"; + + src = fetchFromGitHub { + repo = "advanced-ssh-config"; + owner = "moul"; + rev = "v${version}"; + sha256 = "sha256-NH7Dmqsu7uRhKWGFHBnh5GGqsNFOijDxsc+ATt28jtY="; + }; + + vendorSha256 = "sha256-6OAsO7zWAgPfQWD9k+nYH7hnDDUlKIjTB61ivvoubn0="; + + doCheck = false; + + preBuild = '' + buildFlagsArray+=("-ldflags" "-s -w -X moul.io/assh/v2/pkg/version.Version=${version}") + ''; + + nativeBuildInputs = [ makeWrapper ]; + + postInstall = '' + wrapProgram "$out/bin/assh" \ + --prefix PATH : ${openssh}/bin + ''; + + doInstallCheck = true; + installCheckPhase = '' + $out/bin/assh --help > /dev/null + ''; + + meta = with lib; { + description = "Advanced SSH config - Regex, aliases, gateways, includes and dynamic hosts"; + homepage = "https://github.com/moul/assh"; + changelog = "https://github.com/moul/assh/releases/tag/v${version}"; + license = licenses.mit; + maintainers = with maintainers; [ zzamboni ]; + platforms = with platforms; linux ++ darwin; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/atftp/default.nix b/nixpkgs/pkgs/tools/networking/atftp/default.nix new file mode 100644 index 000000000000..0e76cb94346b --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/atftp/default.nix @@ -0,0 +1,26 @@ +{ lib, stdenv, fetchurl, readline, tcp_wrappers, pcre, makeWrapper, gcc }: + +stdenv.mkDerivation rec { + pname = "atftp"; + version = "0.7.4"; + + src = fetchurl { + url = "mirror://sourceforge/atftp/${pname}-${version}.tar.gz"; + sha256 = "sha256-08nNDZcd/Hhtel9AVcNdTmaq/IECrANHPvIlvfftsmo="; + }; + + nativeBuildInputs = [ makeWrapper ]; + buildInputs = [ readline tcp_wrappers pcre gcc ]; + + # Expects pre-GCC5 inline semantics + NIX_CFLAGS_COMPILE = "-std=gnu89"; + + doCheck = false; # fails + + meta = { + description = "Advanced tftp tools"; + maintainers = [ lib.maintainers.raskin ]; + platforms = lib.platforms.linux; + license = lib.licenses.gpl2Plus; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/atinout/default.nix b/nixpkgs/pkgs/tools/networking/atinout/default.nix new file mode 100644 index 000000000000..93535531d91b --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/atinout/default.nix @@ -0,0 +1,30 @@ +{ lib, stdenv, fetchgit, ronn, mount }: + +stdenv.mkDerivation rec { + name = "atinout-${version}"; + version = "0.9.2-alpha"; + + NIX_CFLAGS_COMPILE = lib.optionalString (!stdenv.cc.isClang) "-Werror=implicit-fallthrough=0"; + LANG = if stdenv.isDarwin then "en_US.UTF-8" else "C.UTF-8"; + nativeBuildInputs = [ ronn mount ]; + + src = fetchgit { + url = "git://git.code.sf.net/p/atinout/code"; + rev = "4976a6cb5237373b7e23cd02d7cd5517f306e3f6"; + sha256 = "0bninv2bklz7ly140cxx8iyaqjlq809jjx6xqpimn34ghwsaxbpv"; + }; + + makeFlags = [ "CC=${stdenv.cc.targetPrefix}cc" ]; + + installPhase = '' + make PREFIX=$out install + ''; + + meta = with lib; { + homepage = "http://atinout.sourceforge.net"; + description = "Tool for talking to modems"; + platforms = platforms.unix; + license = licenses.gpl3; + maintainers = with maintainers; [ bendlas ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/autossh/default.nix b/nixpkgs/pkgs/tools/networking/autossh/default.nix new file mode 100644 index 000000000000..9b8e7f712fd0 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/autossh/default.nix @@ -0,0 +1,35 @@ +{lib, stdenv, fetchurl, openssh}: + +stdenv.mkDerivation rec { + pname = "autossh"; + version = "1.4g"; + + src = fetchurl { + url = "http://www.harding.motd.ca/autossh/${pname}-${version}.tgz"; + sha256 = "0xqjw8df68f4kzkns5gcah61s5wk0m44qdk2z1d6388w6viwxhsz"; + }; + + preConfigure = '' + export ac_cv_func_malloc_0_nonnull=yes + export ac_cv_func_realloc_0_nonnull=yes + ''; + + nativeBuildInputs = [ openssh ]; + + installPhase = '' + install -D -m755 autossh $out/bin/autossh || return 1 + install -D -m644 CHANGES $out/share/doc/autossh/CHANGES || return 1 + install -D -m644 README $out/share/doc/autossh/README || return 1 + install -D -m644 autossh.host $out/share/autossh/examples/autossh.host || return 1 + install -D -m644 rscreen $out/share/autossh/examples/rscreen || return 1 + install -D -m644 autossh.1 $out/man/man1/autossh.1 || return 1 + ''; + + meta = with lib; { + homepage = "https://www.harding.motd.ca/autossh/"; + description = "Automatically restart SSH sessions and tunnels"; + license = licenses.bsd1; + platforms = platforms.unix; + maintainers = with maintainers; [ pSub ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/axel/default.nix b/nixpkgs/pkgs/tools/networking/axel/default.nix new file mode 100644 index 000000000000..f7e761ac0fd0 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/axel/default.nix @@ -0,0 +1,28 @@ +{ lib, stdenv, fetchFromGitHub, autoreconfHook, autoconf-archive +, pkg-config, gettext, libssl, txt2man }: + +stdenv.mkDerivation rec { + pname = "axel"; + version = "2.17.10"; + + src = fetchFromGitHub { + owner = "axel-download-accelerator"; + repo = pname; + rev = "v${version}"; + sha256 = "01mpfkz98r2fx4n0gyi3b4zvlyfd5bxydp2wh431lnj0ahrsiikp"; + }; + + nativeBuildInputs = [ autoreconfHook pkg-config autoconf-archive txt2man ]; + + buildInputs = [ gettext libssl ]; + + installFlags = [ "ETCDIR=${placeholder "out"}/etc" ]; + + meta = with lib; { + description = "Console downloading program with some features for parallel connections for faster downloading"; + homepage = "https://github.com/axel-download-accelerator/axel"; + maintainers = with maintainers; [ pSub ]; + platforms = with platforms; unix; + license = licenses.gpl2; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/babeld/default.nix b/nixpkgs/pkgs/tools/networking/babeld/default.nix new file mode 100644 index 000000000000..47894c1a5329 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/babeld/default.nix @@ -0,0 +1,25 @@ +{ lib, stdenv, fetchurl, nixosTests }: + +stdenv.mkDerivation rec { + pname = "babeld"; + version = "1.10"; + + src = fetchurl { + url = "https://www.irif.fr/~jch/software/files/${pname}-${version}.tar.gz"; + sha256 = "1sld5bbig2pkcr4zrdpvfzifc6a3lc8i8kdzk5ryjh166844mxd5"; + }; + + preBuild = '' + makeFlags="PREFIX=$out ETCDIR=$out/etc" + ''; + + passthru.tests.babeld = nixosTests.babeld; + + meta = with lib; { + homepage = "http://www.irif.fr/~jch/software/babel/"; + description = "Loop-avoiding distance-vector routing protocol"; + license = licenses.mit; + maintainers = with maintainers; [ fpletz hexa ]; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/bacnet-stack/default.nix b/nixpkgs/pkgs/tools/networking/bacnet-stack/default.nix new file mode 100644 index 000000000000..a4f2ef36360e --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/bacnet-stack/default.nix @@ -0,0 +1,31 @@ +{ lib, stdenv, fetchFromGitHub }: + +stdenv.mkDerivation rec { + name = "bacnet-stack"; + version = "1.0.0"; + + src = fetchFromGitHub { + owner = "bacnet-stack"; + repo = "bacnet-stack"; + rev = "bacnet-stack-${version}"; + sha256 = "078p7qsy9v6fl7pzwgcr72pgjqxfxmfxyqajih2zqlb5g5sf88vh"; + }; + + hardeningDisable = [ "all" ]; + + buildPhase = '' + make BUILD=debug BACNET_PORT=linux BACDL_DEFINE=-DBACDL_BIP=1 BACNET_DEFINES=" -DPRINT_ENABLED=1 -DBACFILE -DBACAPP_ALL -DBACNET_PROPERTY_LISTS" + ''; + + installPhase = '' + mkdir $out + cp -r bin $out/bin + ''; + + meta = with lib; { + description = "BACnet open source protocol stack for embedded systems, Linux, and Windows"; + platforms = platforms.linux; + license = licenses.gpl2; + maintainers = with maintainers; [ WhittlesJr ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/badvpn/default.nix b/nixpkgs/pkgs/tools/networking/badvpn/default.nix new file mode 100644 index 000000000000..fd7c3b23adfe --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/badvpn/default.nix @@ -0,0 +1,39 @@ +{lib, stdenv, fetchurl, cmake, openssl, nss, pkg-config, nspr, bash, debug ? false}: +let + s = # Generated upstream information + rec { + baseName="badvpn"; + version="1.999.130"; + name="${baseName}-${version}"; + hash="02b1fra43l75mljkhrq45vcrrqv0znicjn15g7nbqx3jppzbpm5z"; + url="https://github.com/ambrop72/badvpn/archive/1.999.130.tar.gz"; + sha256="02b1fra43l75mljkhrq45vcrrqv0znicjn15g7nbqx3jppzbpm5z"; + }; + + + compileFlags = "-O3 ${lib.optionalString (!debug) "-DNDEBUG"}"; +in +stdenv.mkDerivation { + inherit (s) name version; + nativeBuildInputs = [ cmake pkg-config ]; + buildInputs = [ + openssl nss nspr + ]; + src = fetchurl { + inherit (s) url sha256; + }; + + preConfigure = '' + find . -name '*.sh' -exec sed -e 's@#!/bin/sh@${stdenv.shell}@' -i '{}' ';' + find . -name '*.sh' -exec sed -e 's@#!/bin/bash@${bash}/bin/bash@' -i '{}' ';' + cmakeFlagsArray=("-DCMAKE_BUILD_TYPE=" "-DCMAKE_C_FLAGS=${compileFlags}"); + ''; + + meta = { + inherit (s) version; + description = "A set of network-related (mostly VPN-related) tools"; + license = lib.licenses.bsd3 ; + maintainers = [lib.maintainers.raskin]; + platforms = lib.platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/badvpn/default.upstream b/nixpkgs/pkgs/tools/networking/badvpn/default.upstream new file mode 100644 index 000000000000..2a85ba7cb519 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/badvpn/default.upstream @@ -0,0 +1,3 @@ +url https://github.com/ambrop72/badvpn/releases +version_link '[0-9][.]tar[.][a-z0-9]+$' +version '.*/([0-9.]+)[.]tar[.].*' '\1' diff --git a/nixpkgs/pkgs/tools/networking/bandwhich/default.nix b/nixpkgs/pkgs/tools/networking/bandwhich/default.nix new file mode 100644 index 000000000000..233c57bc635d --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/bandwhich/default.nix @@ -0,0 +1,32 @@ +{ lib, stdenv, fetchFromGitHub, rustPlatform, Security, fetchpatch }: + +rustPlatform.buildRustPackage rec { + pname = "bandwhich"; + version = "0.20.0"; + + src = fetchFromGitHub { + owner = "imsnif"; + repo = pname; + rev = version; + sha256 = "014blvrv0kk4gzga86mbk7gd5dl1szajfi972da3lrfznck1w24n"; + }; + + cargoSha256 = "119szaighki565w28la6qg25s3cv8wviqin9f7f9w8x2rif3ipb3"; + + buildInputs = lib.optional stdenv.isDarwin Security; + + meta = with lib; { + description = "A CLI utility for displaying current network utilization"; + longDescription = '' + bandwhich sniffs a given network interface and records IP packet size, cross + referencing it with the /proc filesystem on linux or lsof on MacOS. It is + responsive to the terminal window size, displaying less info if there is + no room for it. It will also attempt to resolve ips to their host name in + the background using reverse DNS on a best effort basis. + ''; + homepage = "https://github.com/imsnif/bandwhich"; + license = licenses.mit; + maintainers = with maintainers; [ Br1ght0ne ma27 ]; + platforms = platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/bgpdump/default.nix b/nixpkgs/pkgs/tools/networking/bgpdump/default.nix new file mode 100644 index 000000000000..18d72daa009f --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/bgpdump/default.nix @@ -0,0 +1,22 @@ +{ lib, stdenv, fetchurl, autoreconfHook, zlib, bzip2 }: + +stdenv.mkDerivation rec { + pname = "bgpdump"; + version = "1.6.0"; + + src = fetchurl { + url = "https://ris.ripe.net/source/bgpdump/libbgpdump-1.6.0.tgz"; + sha256 = "144369gj35mf63nz4idqwsvgsirw7fybm8kkk07yymrjp8jr3aqk"; + }; + + nativeBuildInputs = [ autoreconfHook ]; + buildInputs = [ zlib bzip2 ]; + + meta = { + homepage = "https://bitbucket.org/ripencc/bgpdump/"; + description = "Analyze dump files produced by Zebra/Quagga or MRT"; + license = lib.licenses.hpnd; + maintainers = with lib.maintainers; [ lewo ]; + platforms = with lib.platforms; linux; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/bgpq3/default.nix b/nixpkgs/pkgs/tools/networking/bgpq3/default.nix new file mode 100644 index 000000000000..bd0a623a916d --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/bgpq3/default.nix @@ -0,0 +1,24 @@ +{ lib, stdenv, fetchFromGitHub }: + +stdenv.mkDerivation rec { + pname = "bgpq3"; + version = "0.1.35"; + + src = fetchFromGitHub { + owner = "snar"; + repo = pname; + rev = "v${version}"; + sha256 = "0fd5a3krq0i906m0iivgphiqq88cw6c0w1q4n7lmzyq9201mb8wj"; + }; + + # Fix binary install location. Remove with next upstream release. + preInstall = "mkdir -p $out/bin"; + + meta = with lib; { + description = "bgp filtering automation tool"; + homepage = "https://github.com/snar/bgpq3"; + license = licenses.bsd2; + maintainers = with maintainers; [ b4dm4n ]; + platforms = with platforms; unix; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/bgpq4/default.nix b/nixpkgs/pkgs/tools/networking/bgpq4/default.nix new file mode 100644 index 000000000000..40c65b35a035 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/bgpq4/default.nix @@ -0,0 +1,25 @@ +{ lib, stdenv, fetchFromGitHub, autoreconfHook }: + +stdenv.mkDerivation rec { + pname = "bgpq4"; + version = "0.0.7"; + + src = fetchFromGitHub { + owner = "bgp"; + repo = pname; + rev = version; + sha256 = "sha256-iEm4BYlJi56Y4OBCdEDgRQ162F65PLZyvHSEQzULFww="; + }; + + nativeBuildInputs = [ + autoreconfHook + ]; + + meta = with lib; { + description = "BGP filtering automation tool"; + homepage = "https://github.com/bgp/bgpq4"; + license = licenses.bsd2; + maintainers = with maintainers; [ vincentbernat ]; + platforms = with platforms; unix; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/biosdevname/default.nix b/nixpkgs/pkgs/tools/networking/biosdevname/default.nix new file mode 100644 index 000000000000..f44574fb0364 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/biosdevname/default.nix @@ -0,0 +1,28 @@ +{ lib, stdenv, fetchFromGitHub, autoreconfHook, zlib, pciutils }: + +stdenv.mkDerivation rec { + pname = "biosdevname"; + version = "0.7.3"; + + src = fetchFromGitHub { + owner = "dell"; + repo = "biosdevname"; + rev = "v${version}"; + sha256 = "19wbb79x9h79k55sgd4dylvdbhhrvfaiaknbw9s1wvfmirkxa1dz"; + }; + + nativeBuildInputs = [ autoreconfHook ]; + buildInputs = [ zlib pciutils ]; + + # Don't install /lib/udev/rules.d/*-biosdevname.rules + patches = [ ./makefile.patch ]; + + configureFlags = [ "--sbindir=\${out}/bin" ]; + + meta = with lib; { + description = "Udev helper for naming devices per BIOS names"; + license = licenses.gpl2; + platforms = ["x86_64-linux" "i686-linux"]; + maintainers = with maintainers; [ cstrahan ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/biosdevname/makefile.patch b/nixpkgs/pkgs/tools/networking/biosdevname/makefile.patch new file mode 100644 index 000000000000..0fc083f9096f --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/biosdevname/makefile.patch @@ -0,0 +1,13 @@ +diff --git a/Makefile.am b/Makefile.am +index 14d9a92..9e324d2 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -8,8 +8,6 @@ dist_noinst_DATA = biosdevname.rules.in biosdevname.spec.fedora biosdevname.spec + + CLEANFILES = version src/bios_dev_name.h + install-data-local: +- mkdir -p $(DESTDIR)@RULEDIR@ +- $(INSTALL_DATA) $(top_srcdir)/biosdevname.rules.in $(DESTDIR)@RULEDEST@ + + uninstall-local: + rm -f $(DESTDIR)@RULEDEST@ diff --git a/nixpkgs/pkgs/tools/networking/boringtun/default.nix b/nixpkgs/pkgs/tools/networking/boringtun/default.nix new file mode 100644 index 000000000000..a071b5b4a3a9 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/boringtun/default.nix @@ -0,0 +1,28 @@ +{ lib, stdenv, fetchFromGitHub, rustPlatform, darwin }: + +rustPlatform.buildRustPackage rec { + pname = "boringtun"; + version = "0.3.0"; + + src = fetchFromGitHub { + owner = "cloudflare"; + repo = pname; + rev = "v${version}"; + sha256 = "0b57c7z87xwrirmq9aa9jswqyj5bavkifmq7a9hgfphcmwcskmdb"; + }; + + cargoSha256 = "1xn6scc8nrb9xk89hsp9v67jvyww23rjaq5fcagpbqdwf5dvg4ja"; + + buildInputs = lib.optional stdenv.isDarwin darwin.apple_sdk.frameworks.Security; + + # Testing this project requires sudo, Docker and network access, etc. + doCheck = false; + + meta = with lib; { + description = "Userspace WireGuard® implementation in Rust"; + homepage = "https://github.com/cloudflare/boringtun"; + license = licenses.bsd3; + maintainers = with maintainers; [ xrelkd marsam ]; + platforms = platforms.linux ++ platforms.darwin; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/boundary/default.nix b/nixpkgs/pkgs/tools/networking/boundary/default.nix new file mode 100644 index 000000000000..32dcea9682a1 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/boundary/default.nix @@ -0,0 +1,66 @@ +{ stdenv, lib, fetchzip }: + +stdenv.mkDerivation rec { + pname = "boundary"; + version = "0.2.3"; + + src = + let + inherit (stdenv.hostPlatform) system; + selectSystem = attrs: attrs.${system} or (throw "Unsupported system: ${system}"); + suffix = selectSystem { + x86_64-linux = "linux_amd64"; + aarch64-linux = "linux_arm64"; + x86_64-darwin = "darwin_amd64"; + }; + sha256 = selectSystem { + x86_64-linux = "sha256-tfTyhuQaVh0F1HvFS+ToDk/lJEHEYMQVNFpdEjABer4="; + aarch64-linux = "sha256-0g6nYoNgu3C/r4fgKuZBrzTjpt14lQf2rpbVMS9CEZE="; + x86_64-darwin = "sha256-er1bDqi+PDucwUSsWDi8z1fUZTz7epq6HE6cOLTN3SE="; + }; + in + fetchzip { + url = "https://releases.hashicorp.com/boundary/${version}/boundary_${version}_${suffix}.zip"; + inherit sha256; + }; + + dontConfigure = true; + dontBuild = true; + + installPhase = '' + runHook preInstall + install -D boundary $out/bin/boundary + runHook postInstall + ''; + + doInstallCheck = true; + installCheckPhase = '' + runHook preInstallCheck + $out/bin/boundary --help + $out/bin/boundary version + runHook postInstallCheck + ''; + + dontPatchELF = true; + dontPatchShebangs = true; + + passthru.updateScript = ./update.sh; + + meta = with lib; { + homepage = "https://boundaryproject.io/"; + changelog = "https://github.com/hashicorp/boundary/blob/v${version}/CHANGELOG.md"; + description = "Enables identity-based access management for dynamic infrastructure"; + longDescription = '' + Boundary provides a secure way to access hosts and critical systems + without having to manage credentials or expose your network, and is + entirely open source. + + Boundary is designed to be straightforward to understand, highly scalable, + and resilient. It can run in clouds, on-prem, secure enclaves and more, + and does not require an agent to be installed on every end host. + ''; + license = licenses.mpl20; + maintainers = with maintainers; [ jk ]; + platforms = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/boundary/update.sh b/nixpkgs/pkgs/tools/networking/boundary/update.sh new file mode 100755 index 000000000000..437339307104 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/boundary/update.sh @@ -0,0 +1,39 @@ +#!/usr/bin/env nix-shell +#!nix-shell -i bash -p curl gnused gawk nix-prefetch + +set -euo pipefail + +ROOT="$(dirname "$(readlink -f "$0")")" +NIX_DRV="$ROOT/default.nix" +if [ ! -f "$NIX_DRV" ]; then + echo "ERROR: cannot find default.nix in $ROOT" + exit 1 +fi + +fetch_arch() { + VER="$1"; ARCH="$2" + URL="https://releases.hashicorp.com/boundary/${VER}/boundary_${VER}_${ARCH}.zip" + nix-prefetch "{ stdenv, fetchzip }: +stdenv.mkDerivation rec { + pname = \"boundary\"; version = \"${VER}\"; + src = fetchzip { url = \"$URL\"; }; +} +" +} + +replace_sha() { + sed -i "s#$1 = \"sha256-.\{44\}\"#$1 = \"$2\"#" "$NIX_DRV" +} + +# https://releases.hashicorp.com/boundary/0.1.4/boundary_0.1.4_linux_amd64.zip +BOUNDARY_VER=$(curl -Ls -w "%{url_effective}" -o /dev/null https://github.com/hashicorp/boundary/releases/latest | awk -F'/' '{print $NF}' | sed 's/v//') + +BOUNDARY_LINUX_X64_SHA256=$(fetch_arch "$BOUNDARY_VER" "linux_amd64") +BOUNDARY_DARWIN_X64_SHA256=$(fetch_arch "$BOUNDARY_VER" "darwin_amd64") +BOUNDARY_LINUX_AARCH64_SHA256=$(fetch_arch "$BOUNDARY_VER" "linux_arm64") + +sed -i "s/version = \".*\"/version = \"$BOUNDARY_VER\"/" "$NIX_DRV" + +replace_sha "x86_64-linux" "$BOUNDARY_LINUX_X64_SHA256" +replace_sha "x86_64-darwin" "$BOUNDARY_DARWIN_X64_SHA256" +replace_sha "aarch64-linux" "$BOUNDARY_LINUX_AARCH64_SHA256" diff --git a/nixpkgs/pkgs/tools/networking/brook/default.nix b/nixpkgs/pkgs/tools/networking/brook/default.nix new file mode 100644 index 000000000000..b6f7cb1869ad --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/brook/default.nix @@ -0,0 +1,26 @@ +{ lib, buildGoPackage, fetchFromGitHub }: + +buildGoPackage rec { + pname = "brook"; + version = "20200201"; + + goPackagePath = "github.com/txthinking/brook"; + + src = fetchFromGitHub { + owner = "txthinking"; + repo = pname; + rev = "v${version}"; + sha256 = "0fyw2q99gapnrg836x299sgagx94a5jpw4x3gnsf69fih7cqp9lm"; + }; + + goDeps = ./deps.nix; + + meta = with lib; { + homepage = "https://github.com/txthinking/brook"; + description = "A cross-platform Proxy/VPN software"; + license = with licenses; [ gpl3 ]; + platforms = platforms.linux; + maintainers = with maintainers; [ xrelkd ]; + }; +} + diff --git a/nixpkgs/pkgs/tools/networking/brook/deps.nix b/nixpkgs/pkgs/tools/networking/brook/deps.nix new file mode 100644 index 000000000000..9ccb446b5e52 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/brook/deps.nix @@ -0,0 +1,165 @@ +# This file was generated by https://github.com/kamilchm/go2nix v1.3.0 +[ + { + goPackagePath = "github.com/urfave/cli"; + fetch = { + type = "git"; + url = "https://github.com/urfave/cli"; + rev = "3f8c3bca5729c9b679beffd0d88a67d468f832fd"; + sha256 = "07m5dfp5190wczdw2vqzz4srcpjz5lci1z12rzww9pg9pdjs63gy"; + }; + } + { + goPackagePath = "github.com/cpuguy83/go-md2man"; + fetch = { + type = "git"; + url = "https://github.com/cpuguy83/go-md2man"; + rev = "217d7bd9dd5494abdf2877afbeb24ba0e11b43d6"; + sha256 = "0vsmdrh5c5ngrnq91yg40l8388vh7l1p4wlv4lh7p977dp75ivg6"; + }; + } + { + goPackagePath = "github.com/gorilla/mux"; + fetch = { + type = "git"; + url = "https://github.com/gorilla/mux"; + rev = "75dcda0896e109a2a22c9315bca3bb21b87b2ba5"; + sha256 = "1d0sy1paa055ic84sp3766s9pa24q008hf77dc842vrgvn8p3wmh"; + }; + } + { + goPackagePath = "github.com/gorilla/websocket"; + fetch = { + type = "git"; + url = "https://github.com/gorilla/websocket"; + rev = "c3e18be99d19e6b3e8f1559eea2c161a665c4b6b"; + sha256 = "03n1n0nwz3k9qshmriycqznnnvd3dkzsfwpnfjzzvafjxk9kyapv"; + }; + } + { + goPackagePath = "github.com/mdp/qrterminal"; + fetch = { + type = "git"; + url = "https://github.com/mdp/qrterminal"; + rev = "b74f0e01e9f532111951caf89df78e5619193db5"; + sha256 = "1xz5f3dfkdwd6svnbh98rlr5pfr4s4hrqs4vffn9wy5vb336pp8p"; + }; + } + { + goPackagePath = "github.com/miekg/dns"; + fetch = { + type = "git"; + url = "https://github.com/miekg/dns"; + rev = "6c0c4e6581f8e173cc562c8b3363ab984e4ae071"; + sha256 = "0fpd9alvhzrkb1c31n4lrxlpv1nlhy51w1yg39xxb3mjmrb7lby1"; + }; + } + { + goPackagePath = "github.com/patrickmn/go-cache"; + fetch = { + type = "git"; + url = "https://github.com/patrickmn/go-cache"; + rev = "46f407853014144407b6c2ec7ccc76bf67958d93"; + sha256 = "08155wdk2883qw37p7wgrpv8wb9lbx4cpfgrraivdavs3qbjlq5j"; + }; + } + { + goPackagePath = "github.com/shurcooL/sanitized_anchor_name"; + fetch = { + type = "git"; + url = "https://github.com/shurcooL/sanitized_anchor_name"; + rev = "7bfe4c7ecddb3666a94b053b422cdd8f5aaa3615"; + sha256 = "1gv9p2nr46z80dnfjsklc6zxbgk96349sdsxjz05f3z6wb6m5l8f"; + }; + } + { + goPackagePath = "github.com/txthinking/gotun2socks"; + fetch = { + type = "git"; + url = "https://github.com/txthinking/gotun2socks"; + rev = "35016fdae05e78db993d43f55eb96ddbe3958252"; + sha256 = "11rl8pqyd6jzi5alpymzi0i5q7pk2492di44v85g7r24y6livrjg"; + }; + } + { + goPackagePath = "github.com/txthinking/socks5"; + fetch = { + type = "git"; + url = "https://github.com/txthinking/socks5"; + rev = "254e122c4eaf8657900905ed5bed5777870b9df8"; + sha256 = "1q43sxzacj216mdzl44khhx51w1z78jpraw955dnjv9va0zqbhmi"; + }; + } + { + goPackagePath = "github.com/txthinking/x"; + fetch = { + type = "git"; + url = "https://github.com/txthinking/x"; + rev = "99b19c1440b66f803ee98b30b6829651cc3f90cc"; + sha256 = "0vzw9wxlgj21y35qv580806vy6k6w1z5yqd5n6ccnq8cd3lvmx70"; + }; + } + { + goPackagePath = "github.com/urfave/negroni"; + fetch = { + type = "git"; + url = "https://github.com/urfave/negroni"; + rev = "f4316798d5d3acd39eb6784301b19f27f471415f"; + sha256 = "0w4iva6s8v8sk95l8mb1a67v0bn4h7njyylv9dnwma0d3l7k24y3"; + }; + } + { + goPackagePath = "golang.org/x/crypto"; + fetch = { + type = "git"; + url = "https://go.googlesource.com/crypto"; + rev = "69ecbb4d6d5dab05e49161c6e77ea40a030884e1"; + sha256 = "1ylm1lp1miihaq93p8rh2yh823qljqkyqwk3gjzk2bdvzz427pr5"; + }; + } + { + goPackagePath = "golang.org/x/net"; + fetch = { + type = "git"; + url = "https://go.googlesource.com/net"; + rev = "6afb5195e5aab057fda82e27171243402346b0ad"; + sha256 = "1aiz41q2yxgg3dxfkn33ff54vhaxbiwcps9j3ia1xx4cqxim38zw"; + }; + } + { + goPackagePath = "golang.org/x/sys"; + fetch = { + type = "git"; + url = "https://go.googlesource.com/sys"; + rev = "9fbb57f87de9ccfe3a99d4e3270ce8a926ebba4f"; + sha256 = "0qaz2jjkrxzgkapmjqingdwamrgq2aiblxvzzgrcsv2qhkj0wdps"; + }; + } + { + goPackagePath = "golang.org/x/text"; + fetch = { + type = "git"; + url = "https://go.googlesource.com/text"; + rev = "929e72ca90deac4784bbe451caf10faa5b256ebe"; + sha256 = "0kwyw87bx0rsc5bbqrrg36yv2b7rs4ijs4p4444s8zwzq6sw24y8"; + }; + } + { + goPackagePath = "gopkg.in/russross/blackfriday.v2"; + fetch = { + type = "git"; + url = "https://gopkg.in/russross/blackfriday.v2"; + rev = "d3b5b032dc8e8927d31a5071b56e14c89f045135"; + sha256 = "0nlz7isdd4rgnwzs68499hlwicxz34j2k2a0b8jy0y7ycd2bcr5j"; + }; + } + { + goPackagePath = "rsc.io/qr"; + fetch = { + type = "git"; + url = "https://github.com/rsc/qr"; + rev = "ca9a01fc2f9505024045632c50e5e8cd6142fafe"; + sha256 = "04yx493g0fqp8i59zjxnl4k3s0cl0kr5m8xh0ph8m10r1hkw0xr3"; + }; + } +] diff --git a/nixpkgs/pkgs/tools/networking/bsd-finger/default.nix b/nixpkgs/pkgs/tools/networking/bsd-finger/default.nix new file mode 100644 index 000000000000..189f636cd1fb --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/bsd-finger/default.nix @@ -0,0 +1,25 @@ +{ lib, stdenv, fetchurl }: + +# !!! Duplication: this package is almost exactly the same as `bsd-finger'. + +stdenv.mkDerivation rec { + name = "bsd-finger-0.17"; + + src = fetchurl { + url = "ftp://ftp.metalab.unc.edu/pub/linux/system/network/finger/${name}.tar.gz"; + sha256 = "1yhkiv0in588il7f84k2xiy78g9lv12ll0y7047gazhiimk5v244"; + }; + + NIX_CFLAGS_COMPILE = "-D_GNU_SOURCE"; + + patches = [ ./ubuntu-0.17-9.patch ]; + + preBuild = "cd finger"; + + preInstall = "mkdir -p $out/man/man1 $out/bin "; + + meta = with lib; { + platforms = platforms.linux; + license = licenses.bsdOriginal; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/bsd-finger/ubuntu-0.17-9.patch b/nixpkgs/pkgs/tools/networking/bsd-finger/ubuntu-0.17-9.patch new file mode 100644 index 000000000000..24decb60281f --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/bsd-finger/ubuntu-0.17-9.patch @@ -0,0 +1,261 @@ +--- bsd-finger-0.17.orig/finger/finger.1 ++++ bsd-finger-0.17/finger/finger.1 +@@ -169,16 +169,14 @@ + must be able to see the + .Pa .nofinger + file. This generally means that the home directory containing the file +-must have the other-users-execute bit set (o+w). See ++must have the other-users-execute bit set (o+x). See + .Xr chmod 1 . + If you use this feature for privacy, please test it with ``finger + @localhost'' before relying on it, just in case. + .It ~/.plan + .It ~/.project +-.It ~/.pgp ++.It ~/.pgpkey + These files are printed as part of a long-format request. The +-.Pa .project +-file is limited to one line; the + .Pa .plan + file may be arbitrarily long. + .El +--- bsd-finger-0.17.orig/finger/finger.c ++++ bsd-finger-0.17/finger/finger.c +@@ -77,7 +77,7 @@ + #include "../version.h" + + static void loginlist(void); +-static void userlist(int argc, char *argv[]); ++static int userlist(int argc, char *argv[]); + + int lflag, pplan; + static int sflag, mflag; +@@ -92,6 +92,7 @@ + + int main(int argc, char *argv[]) { + int ch; ++ int err = 0; + struct sockaddr_in sin; + socklen_t slen = sizeof(sin); + +@@ -159,7 +160,7 @@ + } + } + else { +- userlist(argc, argv); ++ err = userlist(argc, argv); + /* + * Assign explicit "large" format if names given and -s not + * explicitly stated. Force the -l AFTER we get names so any +@@ -172,7 +173,7 @@ + if (lflag) lflag_print(); + else sflag_print(); + } +- return 0; ++ return err; + } + + /* Returns 1 if .nofinger is found and enable_nofinger is set. */ +@@ -181,10 +182,16 @@ + check_nofinger(struct passwd *pw) + { + if (enable_nofinger) { +- char path[PATH_MAX]; + struct stat tripe; +- snprintf(path, sizeof(path), "%s/.nofinger", pw->pw_dir); +- if (stat(path, &tripe)==0) { ++ int ret; ++ char *path; ++ if (asprintf(&path, "%s/.nofinger", pw->pw_dir) < 0) { ++ eprintf("finger: Out of space.\n"); ++ exit(1); ++ } ++ ret = stat(path, &tripe); ++ free(path); ++ if (!ret) { + return 1; + } + } +@@ -264,10 +271,11 @@ + + } + +-static void ++static int + userlist(int argc, char *argv[]) + { + int i; ++ int err = 0; + PERSON *pn; + PERSON *nethead, **nettail; + struct utmp *uptr; +@@ -297,13 +305,13 @@ + + /* handle network requests */ + for (pn = nethead; pn; pn = pn->next) { +- netfinger(pn->name); ++ err |= netfinger(pn->name); + if (pn->next || entries) + xputc('\n'); + } + + if (entries == 0) +- return; ++ return err; + + /* + * Scan thru the list of users currently logged in, saving +@@ -331,4 +339,6 @@ + enter_lastlog(pn); + } + endutent(); ++ ++ return err; + } +--- bsd-finger-0.17.orig/finger/finger.h ++++ bsd-finger-0.17/finger/finger.h +@@ -92,7 +92,7 @@ + void enter_where(struct utmp *ut, PERSON *pn); + void enter_lastlog(PERSON *pn); + int match(struct passwd *pw, const char *user); +-void netfinger(const char *name); ++int netfinger(const char *name); + const char *prphone(const char *num); + + #ifndef DAYSPERNYEAR +--- bsd-finger-0.17.orig/finger/lprint.c ++++ bsd-finger-0.17/finger/lprint.c +@@ -48,7 +48,7 @@ + #include <sys/types.h> + #include <sys/file.h> + #include <sys/stat.h> +-#include <sys/time.h> ++#include <time.h> + #include "finger.h" + + static void lprint(PERSON *pn); +@@ -100,7 +100,7 @@ + * office, office phone, home phone if available + */ + xprintf("Login: %-15s\t\t\tName: %s\nDirectory: %-25s", +- pn->name, pn->realname, pn->dir); ++ pn->name, pn->realname ? pn->realname : "", pn->dir); + xprintf("\tShell: %-s\n", *pn->shell ? pn->shell : _PATH_BSHELL); + + /* +--- bsd-finger-0.17.orig/finger/net.c ++++ bsd-finger-0.17/finger/net.c +@@ -51,7 +51,7 @@ + #include <ctype.h> + #include "finger.h" + +-void netfinger(const char *name) { ++int netfinger(const char *name) { + register FILE *fp; + struct in_addr defaddr; + register int c, sawret, ateol; +@@ -62,7 +62,7 @@ + char *alist[1], *host; + + host = strrchr(name, '@'); +- if (!host) return; ++ if (!host) return 1; + *host++ = '\0'; + + memset(&sn, 0, sizeof(sn)); +@@ -70,7 +70,7 @@ + sp = getservbyname("finger", "tcp"); + if (!sp) { + eprintf("finger: tcp/finger: unknown service\n"); +- return; ++ return 1; + } + sn.sin_port = sp->s_port; + +@@ -78,7 +78,7 @@ + if (!hp) { + if (!inet_aton(host, &defaddr)) { + eprintf("finger: unknown host: %s\n", host); +- return; ++ return 1; + } + def.h_name = host; + def.h_addr_list = alist; +@@ -96,7 +96,7 @@ + + if ((s = socket(hp->h_addrtype, SOCK_STREAM, 0)) < 0) { + eprintf("finger: socket: %s\n", strerror(errno)); +- return; ++ return 1; + } + + /* print hostname before connecting, in case it takes a while */ +@@ -104,7 +104,7 @@ + if (connect(s, (struct sockaddr *)&sn, sizeof(sn)) < 0) { + eprintf("finger: connect: %s\n", strerror(errno)); + close(s); +- return; ++ return 1; + } + + /* -l flag for remote fingerd */ +@@ -128,7 +128,7 @@ + if (!fp) { + eprintf("finger: fdopen: %s\n", strerror(errno)); + close(s); +- return; ++ return 1; + } + + sawret = 0; +@@ -152,4 +152,6 @@ + } + if (!ateol) xputc('\n'); + fclose(fp); ++ ++ return 0; + } +--- bsd-finger-0.17.orig/finger/sprint.c ++++ bsd-finger-0.17/finger/sprint.c +@@ -40,7 +40,7 @@ + #endif /* not lint */ + + #include <sys/types.h> +-#include <sys/time.h> ++#include <time.h> + #include <stdio.h> + #include <stdlib.h> + #include <string.h> +--- bsd-finger-0.17.orig/finger/util.c ++++ bsd-finger-0.17/finger/util.c +@@ -64,7 +64,7 @@ + struct stat sb; + + /* No device for X console. Utmp entry by XDM login (":0"). */ +- if (w->tty[0] == ':') { ++ if (strchr(w->tty, ':')) { + w->idletime = 0; /* would be nice to have it emit ??? */ + w->writable = 0; + return; +@@ -109,9 +109,8 @@ + * fields[3] -> homephone + */ + nfields = 0; +- for (p = strtok(bp, ","); p; p = strtok(NULL, ",")) { +- if (*p==0) p = NULL; // skip empties +- if (nfields < 4) fields[nfields++] = p; ++ while ((p = strsep(&bp, ","))) { ++ if (nfields < 4) fields[nfields++] = *p ? p : NULL; + } + while (nfields<4) fields[nfields++] = NULL; + +@@ -150,6 +149,9 @@ + + pn->realname = rname; + } ++ else { ++ pn->realname = NULL; ++ } + + pn->office = fields[1] ? strdup(fields[1]) : NULL; + pn->officephone = fields[2] ? strdup(fields[2]) : NULL; diff --git a/nixpkgs/pkgs/tools/networking/bud/default.nix b/nixpkgs/pkgs/tools/networking/bud/default.nix new file mode 100644 index 000000000000..7a4bd5adcba0 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/bud/default.nix @@ -0,0 +1,38 @@ +{ stdenv, lib, fetchgit, python2, util-linux }: + +stdenv.mkDerivation { + pname = "bud"; + + version = "0.34.1"; + + src = fetchgit { + url = "https://github.com/indutny/bud.git"; + rev = "b112852c9667632f692d2ce3dcd9a8312b61155a"; + sha256 = "08yr6l4lc2m6rng06253fcaznf6sq0v053wfr8bbym42c32z0xdh"; + }; + + nativeBuildInputs = [ + python2 python2.pkgs.gyp + ] ++ lib.optional stdenv.isLinux util-linux; + + strictDeps = true; + + buildPhase = '' + python ./gyp_bud -f make + make -C out + ''; + + installPhase = '' + mkdir -p $out/bin + cp out/Release/bud $out/bin + ''; + + meta = with lib; { + description = "A TLS terminating proxy"; + license = licenses.mit; + platforms = platforms.linux; + # Does not build on aarch64-linux. + badPlatforms = [ "aarch64-linux" ]; + maintainers = with maintainers; [ cstrahan ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/bukubrow/default.nix b/nixpkgs/pkgs/tools/networking/bukubrow/default.nix new file mode 100644 index 000000000000..f9747d4e0a07 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/bukubrow/default.nix @@ -0,0 +1,48 @@ +{ lib, rustPlatform, fetchFromGitHub, sqlite }: let + +manifest = { + description = "Bukubrow extension host application"; + name = "com.samhh.bukubrow"; + path = "@out@/bin/bukubrow"; + type = "stdio"; +}; + +in rustPlatform.buildRustPackage rec { + pname = "bukubrow-host"; + version = "5.0.0"; + + src = fetchFromGitHub { + owner = "SamHH"; + repo = pname; + rev = "v${version}"; + sha256 = "1a3gqxj6d1shv3w0v9m8x2xr0bvcynchy778yqalxkc3x4vr0nbn"; + }; + + cargoSha256 = "0z6i9wzz5gy9rs8cxfmwg4mpfajv0xvj4nn6jfl7f1rw6k457jc9"; + + buildInputs = [ sqlite ]; + + passAsFile = [ "firefoxManifest" "chromeManifest" ]; + firefoxManifest = builtins.toJSON (manifest // { + allowed_extensions = [ "bukubrow@samhh.com" ]; + }); + chromeManifest = builtins.toJSON (manifest // { + allowed_origins = [ "chrome-extension://ghniladkapjacfajiooekgkfopkjblpn/" ]; + }); + postBuild = '' + substituteAll $firefoxManifestPath firefox.json + substituteAll $chromeManifestPath chrome.json + ''; + postInstall = '' + install -Dm0644 firefox.json $out/lib/mozilla/native-messaging-hosts/com.samhh.bukubrow.json + install -Dm0644 chrome.json $out/etc/chromium/native-messaging-hosts/com.samhh.bukubrow.json + ''; + + meta = with lib; { + description = "A WebExtension for Buku, a command-line bookmark manager"; + homepage = "https://github.com/SamHH/bukubrow-host"; + license = licenses.gpl3; + maintainers = with maintainers; [ infinisil ]; + }; +} + diff --git a/nixpkgs/pkgs/tools/networking/bully/default.nix b/nixpkgs/pkgs/tools/networking/bully/default.nix new file mode 100644 index 000000000000..b49af33cd9e9 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/bully/default.nix @@ -0,0 +1,32 @@ +{ lib, stdenv, fetchFromGitHub, libpcap }: + +stdenv.mkDerivation rec { + pname = "bully"; + version = "1.4-00"; + + src = fetchFromGitHub { + owner = "kimocoder"; + repo = "bully"; + rev = version; + sha256 = "1n2754a5z44g414a0hj3cmi9q5lwnzyvmvzskrj2nci8c8m2kgnf"; + }; + + buildInputs = [ libpcap ]; + + enableParallelBuilding = true; + + sourceRoot = "./source/src"; + + installPhase = '' + install -Dm555 -t $out/bin bully + install -Dm444 -t $out/share/doc/${pname} ../*.md + ''; + + meta = with lib; { + description = "Retrieve WPA/WPA2 passphrase from a WPS enabled access point"; + homepage = "https://github.com/kimocoder/bully"; + license = licenses.gpl3; + maintainers = with maintainers; [ edwtjo ]; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/burpsuite/default.nix b/nixpkgs/pkgs/tools/networking/burpsuite/default.nix new file mode 100644 index 000000000000..a42746c6fa28 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/burpsuite/default.nix @@ -0,0 +1,49 @@ +{ lib, stdenv, fetchurl, jdk11, runtimeShell, unzip, chromium }: + +stdenv.mkDerivation rec { + pname = "burpsuite"; + version = "2021.5.1"; + + src = fetchurl { + name = "burpsuite.jar"; + urls = [ + "https://portswigger.net/Burp/Releases/Download?productId=100&version=${version}&type=Jar" + "https://web.archive.org/web/https://portswigger.net/Burp/Releases/Download?productId=100&version=${version}&type=Jar" + ]; + sha256 = "sha256-nPz6IZpXCyg6cg2nuyqK2f5BI4dNb5tA2NriH3ZC198="; + }; + + dontUnpack = true; + dontBuild = true; + installPhase = '' + runHook preInstall + + mkdir -p $out/bin + echo '#!${runtimeShell} + eval "$(${unzip}/bin/unzip -p ${src} chromium.properties)" + mkdir -p "$HOME/.BurpSuite/burpbrowser/$linux64" + ln -sf "${chromium}/bin/chromium" "$HOME/.BurpSuite/burpbrowser/$linux64/chrome" + exec ${jdk11}/bin/java -jar ${src} "$@"' > $out/bin/burpsuite + chmod +x $out/bin/burpsuite + + runHook postInstall + ''; + + preferLocalBuild = true; + + meta = with lib; { + description = "An integrated platform for performing security testing of web applications"; + longDescription = '' + Burp Suite is an integrated platform for performing security testing of web applications. + Its various tools work seamlessly together to support the entire testing process, from + initial mapping and analysis of an application's attack surface, through to finding and + exploiting security vulnerabilities. + ''; + homepage = "https://portswigger.net/burp/"; + downloadPage = "https://portswigger.net/burp/freedownload"; + license = licenses.unfree; + platforms = jdk11.meta.platforms; + hydraPlatforms = []; + maintainers = with maintainers; [ bennofs ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/bwm-ng/default.nix b/nixpkgs/pkgs/tools/networking/bwm-ng/default.nix new file mode 100644 index 000000000000..26cdfe7c0dbf --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/bwm-ng/default.nix @@ -0,0 +1,79 @@ +{ writeText, lib, stdenv, fetchurl, ncurses }: + +let + version = "0.6.1"; +in +stdenv.mkDerivation rec { + pname = "bwm-ng"; + inherit version; + + src = fetchurl { + url = "https://www.gropp.org/bwm-ng/${pname}-${version}.tar.gz"; + sha256 = "1w0dwpjjm9pqi613i8glxrgca3rdyqyp3xydzagzr5ndc34z6z02"; + }; + + buildInputs = [ ncurses ]; + + # gcc7 has some issues with inline functions + patches = [ + (writeText "gcc7.patch" + '' + --- a/src/bwm-ng.c + +++ b/src/bwm-ng.c + @@ -27,5 +27,5 @@ + /* handle interrupt signal */ + void sigint(int sig) FUNCATTR_NORETURN; + -inline void init(void); + +static inline void init(void); + + /* clear stuff and exit */ + --- a/src/options.c + +++ b/src/options.c + @@ -35,5 +35,5 @@ + inline int str2output_type(char *optarg); + #endif + -inline int str2out_method(char *optarg); + +static inline int str2out_method(char *optarg); + inline int str2in_method(char *optarg); + + '') + ]; + + + # This code uses inline in the gnu89 sense: see http://clang.llvm.org/compatibility.html#inline + NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-std=gnu89"; + + meta = with lib; { + description = "A small and simple console-based live network and disk io bandwidth monitor"; + homepage = "http://www.gropp.org/?id=projects&sub=bwm-ng"; + license = licenses.gpl2; + platforms = platforms.unix; + + longDescription = '' + Features + + supports /proc/net/dev, netstat, getifaddr, sysctl, kstat, /proc/diskstats /proc/partitions, IOKit, devstat and libstatgrab + unlimited number of interfaces/devices supported + interfaces/devices are added or removed dynamically from list + white-/blacklist of interfaces/devices + output of KB/s, Kb/s, packets, errors, average, max and total sum + output in curses, plain console, CSV or HTML + configfile + + Short list of changes since 0.5 (for full list read changelog): + + curses2 output, a nice bar chart + disk input for bsd/macosx/linux/solaris + win32 network bandwidth support + moved to autotools + alot fixes + + Info + This was influenced by the old bwm util written by Barney (barney@freewill.tzo.com) which had some issues with faster interfaces and was very simple. Since i had almost all code done anyway for other projects, i decided to create my own version. + + I actually don't know if netstat input is useful at all. I saw this elsewhere, so i added it. Its target is "netstat 1.42 (2001-04-15)" linux or Free/Open/netBSD. If there are other formats i would be happy to add them. + + (from homepage) + ''; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/cadaver/configure.patch b/nixpkgs/pkgs/tools/networking/cadaver/configure.patch new file mode 100644 index 000000000000..b618099b371a --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/cadaver/configure.patch @@ -0,0 +1,20 @@ +--- a/configure.orig ++++ b/configure +@@ -9595,7 +9595,7 @@ fi + $as_echo "$ne_cv_lib_neon" >&6; } + if test "$ne_cv_lib_neon" = "yes"; then + ne_cv_lib_neonver=no +- for v in 27 28 29; do ++ for v in 27 28 29 30 31; do + case $ne_libver in + 0.$v.*) ne_cv_lib_neonver=yes ;; + esac +@@ -10328,7 +10328,7 @@ fi + $as_echo "$ne_cv_lib_neon" >&6; } + if test "$ne_cv_lib_neon" = "yes"; then + ne_cv_lib_neonver=no +- for v in 27 28 29; do ++ for v in 27 28 29 30 31; do + case $ne_libver in + 0.$v.*) ne_cv_lib_neonver=yes ;; + esac diff --git a/nixpkgs/pkgs/tools/networking/cadaver/default.nix b/nixpkgs/pkgs/tools/networking/cadaver/default.nix new file mode 100644 index 000000000000..70c7972bd65f --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/cadaver/default.nix @@ -0,0 +1,34 @@ +{ lib, stdenv, fetchurl, fetchpatch, neon, pkg-config, readline, zlib}: + +stdenv.mkDerivation rec { + name = "cadaver-0.23.3"; + + src = fetchurl { + url = "http://www.webdav.org/cadaver/${name}.tar.gz"; + sha256 = "1jizq69ifrjbjvz5y79wh1ny94gsdby4gdxwjad4bfih6a5fck7x"; + }; + + patches = [ + (fetchpatch { + url = "https://projects.archlinux.org/svntogit/community.git/plain/trunk/disable-sslv2.patch?h=packages/cadaver"; + name = "disable-sslv2.patch"; + sha256 = "1qx65hv584wdarks51yhd3y38g54affkphm5wz27xiz4nhmbssrr"; + }) + # Cadaver also works with newer versions of neon than stated + # in the configure script + ./configure.patch + ]; + + configureFlags = [ "--with-ssl" "--with-readline" ]; + + nativeBuildInputs = [ pkg-config ]; + buildInputs = [ neon readline zlib ]; + + meta = with lib; { + description = "A command-line WebDAV client"; + homepage = "http://www.webdav.org/cadaver"; + maintainers = with maintainers; [ ianwookim ]; + license = licenses.gpl2; + platforms = with platforms; linux ++ freebsd ++ openbsd; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/calendar-cli/default.nix b/nixpkgs/pkgs/tools/networking/calendar-cli/default.nix new file mode 100644 index 000000000000..497b77b57ac0 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/calendar-cli/default.nix @@ -0,0 +1,34 @@ +{ lib +, python3 +, fetchFromGitHub +}: + +python3.pkgs.buildPythonApplication rec { + pname = "calendar-cli"; + version = "0.12.0"; + + src = fetchFromGitHub { + owner = "tobixen"; + repo = "calendar-cli"; + rev = "v${version}"; + sha256 = "0qjld2m7hl3dx90491pqbjcja82c1f5gwx274kss4lkb8aw0kmlv"; + }; + + propagatedBuildInputs = with python3.pkgs; [ + icalendar + caldav + pytz + tzlocal + six + ]; + + # tests require networking + doCheck = false; + + meta = with lib; { + description = "Simple command-line CalDav client"; + homepage = "https://github.com/tobixen/calendar-cli"; + license = licenses.gpl3Plus; + maintainers = with maintainers; [ dotlambda ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/cantoolz/default.nix b/nixpkgs/pkgs/tools/networking/cantoolz/default.nix new file mode 100644 index 000000000000..11a0315184c9 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/cantoolz/default.nix @@ -0,0 +1,62 @@ +{ lib +, bitstring +, buildPythonApplication +, fetchFromGitHub +, fetchpatch +, flask +, mido +, numpy +, pyserial +, pytestCheckHook +, pythonOlder +}: + +buildPythonApplication rec { + pname = "cantoolz"; + version = "3.7.0"; + disabled = pythonOlder "3.8"; + + src = fetchFromGitHub { + owner = "CANToolz"; + repo = "CANToolz"; + rev = "v${version}"; + sha256 = "0xkj7zyx6pz866q61c84mdagpgdyd633v85hk7qxhamca33rc4yi"; + }; + + patches = [ + (fetchpatch { + # Replace time.clock() which was removed, https://github.com/CANToolz/CANToolz/pull/30 + url = "https://github.com/CANToolz/CANToolz/pull/30/commits/d75574523d3b273c40fb714532c4de27f9e6dd3e.patch"; + sha256 = "0g91hywg5q6f2qk1awgklywigclrbhh6a6mwd0kpbkk1wawiiwbc"; + }) + ]; + + propagatedBuildInputs = [ + flask + pyserial + mido + numpy + bitstring + ]; + + checkInputs = [ pytestCheckHook ]; + disabledTests = [ "test_process" ]; + pythonImportsCheck = [ "cantoolz" ]; + + meta = with lib; { + description = "Black-box CAN network analysis framework"; + longDescription = '' + CANToolz is a framework for analysing CAN networks and devices. It + provides multiple modules that can be chained using CANToolz's pipe + system and used by security researchers, automotive/OEM security + testers in black-box analysis. + + CANToolz can be used for ECU discovery, MitM testing, fuzzing, brute + forcing, scanning or R&D, testing and validation. More can easily be + implemented with a new module. + ''; + homepage = "https://github.com/CANToolz/CANToolz"; + license = with licenses; [ asl20 ]; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/carddav-util/default.nix b/nixpkgs/pkgs/tools/networking/carddav-util/default.nix new file mode 100644 index 000000000000..300e03761a65 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/carddav-util/default.nix @@ -0,0 +1,42 @@ +{ lib, stdenv, fetchgit, python3Packages, makeWrapper }: + +stdenv.mkDerivation { + + name = "carddav-0.1-2014-02-26"; + + src = fetchgit { + url = "git://github.com/ljanyst/carddav-util"; + rev = "53b181faff5f154bcd180467dd04c0ce69405564"; + sha256 = "0f0raffdy032wlnxfck6ky60r163nhqfbr311y4ry55l60s4497n"; + }; + + nativeBuildInputs = [ makeWrapper ]; + + propagatedBuildInputs = with python3Packages; [ requests vobject lxml ]; + + strictDeps = true; + + doCheck = false; # no test + + installPhase = '' + mkdir -p $out/bin + cp $src/carddav-util.py $out/bin + + pythondir="$out/lib/${python3Packages.python.sitePackages}" + mkdir -p "$pythondir" + cp $src/carddav.py "$pythondir" + ''; + + preFixup = '' + wrapProgram "$out/bin/carddav-util.py" \ + --prefix PYTHONPATH : "$PYTHONPATH:$(toPythonPath $out)" \ + --prefix PATH : "$prefix/bin:$PATH" + ''; + + meta = with lib; { + homepage = "https://github.com/ljanyst/carddav-util"; + description = "A CardDAV import/export utility"; + platforms = platforms.unix; + license = licenses.isc; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/cassowary/default.nix b/nixpkgs/pkgs/tools/networking/cassowary/default.nix new file mode 100644 index 000000000000..527ecfbf98d3 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/cassowary/default.nix @@ -0,0 +1,27 @@ +{ lib, buildGoModule, fetchFromGitHub }: + +buildGoModule rec { + pname = "cassowary"; + version = "0.14.0"; + + src = fetchFromGitHub { + owner = "rogerwelin"; + repo = pname; + rev = "v${version}"; + sha256 = "sha256-rQNrxAKf2huY9I6iqdf1iYxgXaQI0LG1Lkrnv1OuJsg="; + }; + + vendorSha256 = "sha256-hGpiL88x2roFEjJJM4CKyt3k66VK1pEnpOwvhDPDp6M="; + + doCheck = false; + + buildFlagsArray = [ "-ldflags=-s -w -X main.version=${version}" ]; + + meta = with lib; { + homepage = "https://github.com/rogerwelin/cassowary"; + description = "Modern cross-platform HTTP load-testing tool written in Go"; + license = licenses.mit; + maintainers = with maintainers; [ hugoreeves ]; + platforms = platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/chaos/default.nix b/nixpkgs/pkgs/tools/networking/chaos/default.nix new file mode 100644 index 000000000000..dc46032dcde6 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/chaos/default.nix @@ -0,0 +1,29 @@ +{ lib +, buildGoModule +, fetchFromGitHub +}: + +buildGoModule rec { + pname = "chaos"; + version = "0.1.9"; + + src = fetchFromGitHub { + owner = "projectdiscovery"; + repo = "chaos-client"; + rev = "v${version}"; + sha256 = "13lblrckf65y7kd3lw4s12bi05rv4iv25sr5xbp63l9ly5sbzaz6"; + }; + + vendorSha256 = "1mc60jkf7xmf3zsb2fihsgg3jkb2mfvsw84aby2kqcf14hdsk2gl"; + + subPackages = [ + "cmd/chaos/" + ]; + + meta = with lib; { + description = "Tool to communicate with Chaos DNS API"; + homepage = "https://github.com/projectdiscovery/chaos-client"; + license = licenses.mit; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/chisel/default.nix b/nixpkgs/pkgs/tools/networking/chisel/default.nix new file mode 100644 index 000000000000..5d82a549e889 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/chisel/default.nix @@ -0,0 +1,36 @@ +{ buildGoModule +, fetchFromGitHub +, lib +}: + +buildGoModule rec { + pname = "chisel"; + version = "1.7.6"; + + src = fetchFromGitHub { + owner = "jpillora"; + repo = pname; + rev = "v${version}"; + sha256 = "sha256-hUurgwbSUcNZiSi+eVTG/Ija/yxPeWuvEE5pUiG7Dls="; + }; + + vendorSha256 = "sha256-GzsQ6LXxe9UQc13XbsYFOWPe0EzlyHechchKc6xDkAc="; + + buildFlagsArray = [ "-ldflags=-s -w -X github.com/jpillora/chisel/share.BuildVersion=${version}" ]; + + # tests require access to the network + doCheck = false; + + meta = with lib; { + description = "TCP/UDP tunnel over HTTP"; + longDescription = '' + Chisel is a fast TCP/UDP tunnel, transported over HTTP, secured via + SSH. Single executable including both client and server. Chisel is + mainly useful for passing through firewalls, though it can also be + used to provide a secure endpoint into your network. + ''; + homepage = "https://github.com/jpillora/chisel"; + license = with licenses; [ mit ]; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/chrony/default.nix b/nixpkgs/pkgs/tools/networking/chrony/default.nix new file mode 100644 index 000000000000..24968c64a093 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/chrony/default.nix @@ -0,0 +1,51 @@ +{ lib, stdenv, fetchurl, pkg-config, libcap, readline, texinfo, nss, nspr +, libseccomp, pps-tools, gnutls }: + +assert stdenv.isLinux -> libcap != null; + +stdenv.mkDerivation rec { + pname = "chrony"; + version = "4.1"; + + src = fetchurl { + url = "https://download.tuxfamily.org/chrony/${pname}-${version}.tar.gz"; + sha256 = "sha256-7Xby0/k0esYiGpGtS9VT3QVlrBiM10kNCAHQj3FxFkw="; + }; + + postPatch = '' + patchShebangs test + ''; + + buildInputs = [ readline texinfo nss nspr gnutls ] + ++ lib.optionals stdenv.isLinux [ libcap libseccomp pps-tools ]; + nativeBuildInputs = [ pkg-config ]; + + hardeningEnable = [ "pie" ]; + + configureFlags = [ "--chronyvardir=$(out)/var/lib/chrony" ] + ++ lib.optional stdenv.isLinux "--enable-scfilter"; + + meta = with lib; { + description = "Sets your computer's clock from time servers on the Net"; + homepage = "https://chrony.tuxfamily.org/"; + repositories.git = "git://git.tuxfamily.org/gitroot/chrony/chrony.git"; + license = licenses.gpl2; + platforms = with platforms; linux ++ freebsd ++ openbsd; + maintainers = with maintainers; [ fpletz thoughtpolice ]; + + longDescription = '' + Chronyd is a daemon which runs in background on the system. It obtains + measurements via the network of the system clock’s offset relative to + time servers on other systems and adjusts the system time accordingly. + For isolated systems, the user can periodically enter the correct time by + hand (using Chronyc). In either case, Chronyd determines the rate at + which the computer gains or loses time, and compensates for this. Chronyd + implements the NTP protocol and can act as either a client or a server. + + Chronyc provides a user interface to Chronyd for monitoring its + performance and configuring various settings. It can do so while running + on the same computer as the Chronyd instance it is controlling or a + different computer. + ''; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/circus/default.nix b/nixpkgs/pkgs/tools/networking/circus/default.nix new file mode 100644 index 000000000000..f24c0e629cb0 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/circus/default.nix @@ -0,0 +1,40 @@ +{ lib, python3 }: + +let + python = python3.override { + self = python; + packageOverrides = self: super: { + tornado = super.tornado_4; + }; + }; + + inherit (python.pkgs) buildPythonApplication fetchPypi iowait psutil pyzmq tornado mock six; +in + +buildPythonApplication rec { + pname = "circus"; + version = "0.16.1"; + + src = fetchPypi { + inherit pname version; + sha256 = "0paccmqwgard2l0z7swcc3nwc418l9b4mfaddb4s31bpnqg02z6x"; + }; + + postPatch = '' + # relax version restrictions to fix build + substituteInPlace setup.py \ + --replace "pyzmq>=13.1.0,<17.0" "pyzmq>13.1.0" + ''; + + checkInputs = [ mock ]; + + doCheck = false; # weird error + + propagatedBuildInputs = [ iowait psutil pyzmq tornado six ]; + + meta = with lib; { + description = "A process and socket manager"; + homepage = "https://github.circus.com/circus-tent/circus"; + license = licenses.asl20; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/cjdns/default.nix b/nixpkgs/pkgs/tools/networking/cjdns/default.nix new file mode 100644 index 000000000000..474c9d59c9e5 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/cjdns/default.nix @@ -0,0 +1,41 @@ +{ lib, stdenv, fetchFromGitHub, nodejs, which, python27, util-linux, nixosTests }: + +stdenv.mkDerivation rec { + pname = "cjdns"; + version = "21.1"; + + src = fetchFromGitHub { + owner = "cjdelisle"; + repo = "cjdns"; + rev = "cjdns-v${version}"; + sha256 = "NOmk+vMZ8i0E2MjrUzksk+tkJ9XVVNEXlE5OOTNa+Y0="; + }; + + buildInputs = [ which python27 nodejs ] ++ + # for flock + lib.optional stdenv.isLinux util-linux; + + CFLAGS = "-O2 -Wno-error=stringop-truncation"; + buildPhase = + lib.optionalString stdenv.isAarch32 "Seccomp_NO=1 " + + "bash do"; + installPhase = '' + install -Dt "$out/bin/" cjdroute makekeys privatetopublic publictoip6 + sed -i 's,/usr/bin/env node,'$(type -P node), \ + $(find contrib -name "*.js") + sed -i 's,/usr/bin/env python,'$(type -P python), \ + $(find contrib -type f) + mkdir -p $out/share/cjdns + cp -R contrib tools node_build node_modules $out/share/cjdns/ + ''; + + 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; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/cksfv/default.nix b/nixpkgs/pkgs/tools/networking/cksfv/default.nix new file mode 100644 index 000000000000..581d39636fa7 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/cksfv/default.nix @@ -0,0 +1,17 @@ +{lib, stdenv, fetchurl}: + +stdenv.mkDerivation rec { + name = "cksfv-1.3.15"; + + src = fetchurl { + url = "http://zakalwe.fi/~shd/foss/cksfv/files/${name}.tar.bz2"; + sha256 = "0k06aq94cn5xp4knjw0p7gz06hzh622ql2xvnrlr3q8rcmdvwwx1"; + }; + + meta = with lib; { + homepage = "http://zakalwe.fi/~shd/foss/cksfv/"; + description = "A tool for verifying files against a SFV checksum file"; + platforms = platforms.all; + license = licenses.gpl2; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/clash/default.nix b/nixpkgs/pkgs/tools/networking/clash/default.nix new file mode 100644 index 000000000000..61e529dc8729 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/clash/default.nix @@ -0,0 +1,29 @@ +{ lib, fetchFromGitHub, buildGoModule }: + +buildGoModule rec { + pname = "clash"; + version = "1.6.0"; + + src = fetchFromGitHub { + owner = "Dreamacro"; + repo = pname; + rev = "v${version}"; + sha256 = "sha256-XG/nci8Sj0vfa/SFPpJwl1Zmt/23LfKxocejplZtS0E="; + }; + + vendorSha256 = "sha256-WR1CpjEMHRkpd0/iqrOm0oVXvyQO+r6GyeP0L0zx8aA="; + + doCheck = false; + + buildFlagsArray = [ + "-ldflags=" + "-X github.com/Dreamacro/clash/constant.Version=${version}" + ]; + + meta = with lib; { + description = "A rule-based tunnel in Go"; + homepage = "https://github.com/Dreamacro/clash"; + license = licenses.gpl3Only; + maintainers = with maintainers; [ contrun Br1ght0ne ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/cloud-custodian/default.nix b/nixpkgs/pkgs/tools/networking/cloud-custodian/default.nix new file mode 100644 index 000000000000..a57d9f13d785 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/cloud-custodian/default.nix @@ -0,0 +1,48 @@ +{ lib, buildPythonApplication, fetchPypi +, argcomplete +, boto3 +, botocore +, certifi +, dateutil +, jsonpatch +, jsonschema +, pyyaml +, tabulate +, urllib3 +}: + +buildPythonApplication rec { + pname = "cloud-custodian"; + version = "0.8.45.1"; + + src = fetchPypi { + pname = "c7n"; + inherit version; + sha256 = "0c199gdmpm83xfghrbzp02xliyxiygsnx2fvb35j9qpf37wzzp3z"; + }; + + propagatedBuildInputs = [ + argcomplete + boto3 + botocore + certifi + dateutil + jsonpatch + jsonschema + pyyaml + tabulate + urllib3 + ]; + + # Requires tox, many packages, and network access + checkPhase = '' + $out/bin/custodian --help + ''; + + meta = with lib; { + description = "Rules engine for cloud security, cost optimization, and governance"; + homepage = "https://cloudcustodian.io"; + license = licenses.asl20; + maintainers = with maintainers; [ bhipple ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/cmst/default.nix b/nixpkgs/pkgs/tools/networking/cmst/default.nix new file mode 100644 index 000000000000..aa61d42d3d00 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/cmst/default.nix @@ -0,0 +1,33 @@ +{ mkDerivation, lib, fetchFromGitHub, qmake, qtbase }: + +mkDerivation rec { + pname = "cmst"; + version = "2019.01.13"; + + src = fetchFromGitHub { + repo = "cmst"; + owner = "andrew-bibb"; + rev = "${pname}-${version}"; + sha256 = "13739f0ddld34dcqlfhylzn1zqz5a7jbp4a4id7gj7pcxjx1lafh"; + }; + + nativeBuildInputs = [ qmake ]; + + buildInputs = [ qtbase ]; + + enableParallelBuilding = true; + + postPatch = '' + for f in $(find . -name \*.cpp -o -name \*.pri -o -name \*.pro); do + substituteInPlace $f --replace /etc $out/etc --replace /usr $out + done + ''; + + meta = { + description = "QT GUI for Connman with system tray icon"; + homepage = "https://github.com/andrew-bibb/cmst"; + maintainers = [ lib.maintainers.matejc ]; + platforms = lib.platforms.linux; + license = lib.licenses.mit; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/cntlm/default.nix b/nixpkgs/pkgs/tools/networking/cntlm/default.nix new file mode 100644 index 000000000000..fdfac8fdcbc2 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/cntlm/default.nix @@ -0,0 +1,37 @@ +{ lib, stdenv, fetchurl, which}: + +stdenv.mkDerivation rec { + pname = "cntlm"; + version = "0.92.3"; + + src = fetchurl { + url = "mirror://sourceforge/cntlm/${pname}-${version}.tar.gz"; + sha256 = "1632szz849wasvh5sm6rm1zbvbrkq35k7kcyvx474gyl4h4x2flw"; + }; + + buildInputs = [ which ]; + + preConfigure = lib.optionalString stdenv.isDarwin '' + substituteInPlace configure --replace "xlc_r gcc" "xlc_r gcc $CC" + substitute Makefile Makefile.$CC --replace "CC=gcc" "CC=$CC" + ''; + + installPhase = '' + mkdir -p $out/bin; cp cntlm $out/bin/; + mkdir -p $out/share/; cp COPYRIGHT README VERSION doc/cntlm.conf $out/share/; + mkdir -p $out/man/; cp doc/cntlm.1 $out/man/; + ''; + + meta = with lib; { + description = "NTLM/NTLMv2 authenticating HTTP proxy"; + homepage = "http://cntlm.sourceforge.net/"; + license = licenses.gpl2; + maintainers = + [ + maintainers.qknight + maintainers.markWot + maintainers.carlosdagos + ]; + platforms = platforms.linux ++ platforms.darwin; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/connect/default.nix b/nixpkgs/pkgs/tools/networking/connect/default.nix new file mode 100644 index 000000000000..8b8c0018c66f --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/connect/default.nix @@ -0,0 +1,29 @@ +{ lib, stdenv, fetchurl }: + +stdenv.mkDerivation rec { + pname = "connect"; + version ="1.105"; + + src = fetchurl { + url = "https://bitbucket.org/gotoh/connect/get/${version}.tar.bz2"; + sha256 = "00yld6yinc8s4xv3b8kbvzn2f4rja5dmp6ysv3n4847qn4k60dh7"; + }; + + makeFlags = [ "CC=${stdenv.cc.targetPrefix}cc" ]; # gcc and/or clang compat + + installPhase = '' + install -D -m ugo=rx connect $out/bin/connect + ''; + + meta = { + description = "Make network connection via SOCKS and https proxy"; + longDescription = '' + This proxy traversal tool is intended to assist OpenSSH (via ProxyCommand + in ~/.ssh/config) and GIT (via $GIT_PROXY_COMMAND) utilize SOCKS and https proxies. + ''; + homepage = "https://bitbucket.org/gotoh/connect/wiki/Home"; + license = lib.licenses.gpl2Plus; + platforms = lib.platforms.gnu ++ lib.platforms.linux ++ lib.platforms.darwin; + maintainers = with lib.maintainers; [ jcumming ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/connman/connman-gtk/default.nix b/nixpkgs/pkgs/tools/networking/connman/connman-gtk/default.nix new file mode 100644 index 000000000000..c75254a27b15 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/connman/connman-gtk/default.nix @@ -0,0 +1,43 @@ +{ lib, stdenv, fetchFromGitHub, autoconf, automake, intltool, pkg-config, +gtk3, connman, openconnect, wrapGAppsHook }: + +stdenv.mkDerivation rec { + pname = "connman-gtk"; + version = "1.1.1"; + + src = fetchFromGitHub { + owner = "jgke"; + repo = "connman-gtk"; + rev = "v${version}"; + sha256 = "09k0hx5hxpbykvslv12l2fq9pxdwpd311mxj038hbqzjghcyidyr"; + }; + + nativeBuildInputs = [ + autoconf + automake + intltool + pkg-config + wrapGAppsHook + ]; + + buildInputs = [ + gtk3 + openconnect + connman + ]; + + preConfigure = '' + # m4/intltool.m4 is an invalid symbolic link + rm m4/intltool.m4 + ln -s ${intltool}/share/aclocal/intltool.m4 m4/ + ./autogen.sh + ''; + + meta = with lib; { + description = "GTK GUI for Connman"; + homepage = "https://github.com/jgke/connman-gtk"; + license = licenses.gpl2Plus; + platforms = platforms.linux; + maintainers = [ maintainers.romildo ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/connman/connman-ncurses/default.nix b/nixpkgs/pkgs/tools/networking/connman/connman-ncurses/default.nix new file mode 100644 index 000000000000..976708c038cd --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/connman/connman-ncurses/default.nix @@ -0,0 +1,41 @@ +{ lib, stdenv, fetchpatch, fetchFromGitHub, autoreconfHook, pkg-config, dbus, json_c, ncurses, connman }: + +stdenv.mkDerivation { + pname = "connman-ncurses"; + version = "2015-07-21"; + + src = fetchFromGitHub { + owner = "eurogiciel-oss"; + repo = "connman-json-client"; + rev = "3c34b2ee62d2e188090d20e7ed2fd94bab9c47f2"; + sha256 = "1831r0776fv481g8kgy1dkl750pzv47835dw11sslq2k6mm6i9p1"; + }; + + patches = [ + # Fix build with json-c 0.14 + (fetchpatch { + url = "https://github.com/void-linux/void-packages/raw/5830ce60e922b7dced8157ededda8c995adb3bb9/srcpkgs/connman-ncurses/patches/lowercase-boolean.patch"; + extraPrefix = ""; + sha256 = "uK83DeRyXS2Y0ZZpTYvYNh/1ZM2QQ7QpajiBztaEuSM="; + }) + ]; + + nativeBuildInputs = [ autoreconfHook pkg-config ]; + + buildInputs = [ dbus ncurses json_c connman ]; + + NIX_CFLAGS_COMPILE = "-Wno-error"; + + installPhase = '' + mkdir -p "$out/bin" + cp -va connman_ncurses "$out/bin/" + ''; + + meta = with lib; { + description = "Simple ncurses UI for connman"; + homepage = "https://github.com/eurogiciel-oss/connman-json-client"; + license = licenses.gpl2; + platforms = platforms.linux; + maintainers = [ maintainers.romildo ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/connman/connman-notify/default.nix b/nixpkgs/pkgs/tools/networking/connman/connman-notify/default.nix new file mode 100644 index 000000000000..cbf500913038 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/connman/connman-notify/default.nix @@ -0,0 +1,36 @@ +{ lib, fetchFromGitLab, python3Packages, glib, gobject-introspection, wrapGAppsHook }: + +python3Packages.buildPythonApplication { + pname = "connman-notify"; + version = "2019-10-05"; + + src = fetchFromGitLab { + owner = "wavexx"; + repo = "connman-notify"; + rev = "24b10a51721b54d932f4cd61ef2756423768c015"; + sha256 = "1k5b5y6114yna2cm0cq82xilicran63hrhlklgv7k3p89057xh8j"; + }; + + format = "other"; + + nativeBuildInputs = [ gobject-introspection wrapGAppsHook ]; + + buildInputs = [ glib ]; + + pythonPath = with python3Packages; [ dbus-python pygobject3 ]; + + strictDeps = false; + + installPhase = '' + install -D -t $out/bin connman-notify + install -D -t $out/share/doc README.rst + ''; + + meta = with lib; { + description = "Desktop notification integration for connman"; + homepage = "https://gitlab.com/wavexx/connman-notify"; + license = licenses.gpl2; + platforms = platforms.linux; + maintainers = [ maintainers.romildo ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/connman/connman.nix b/nixpkgs/pkgs/tools/networking/connman/connman.nix new file mode 100644 index 000000000000..c6792ecfd3b6 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/connman/connman.nix @@ -0,0 +1,171 @@ +{ lib, stdenv +, fetchurl +, pkg-config +, file +, glib +# always required runtime dependencies +, dbus +, libmnl +, gnutls +, readline +# configureable options +, firewallType ? "iptables" # or "nftables" +, iptables ? null +, libnftnl ? null # for nftables +, dnsType ? "internal" # or "systemd-resolved" +# optional features which are turned *on* by default +, enableOpenconnect ? true +, openconnect ? null +, enableOpenvpn ? true +, openvpn ? null +, enableVpnc ? true +, vpnc ? true +, enablePolkit ? true +, polkit ? null +, enablePptp ? true +, pptp ? null +, ppp ? null +, enableLoopback ? true +, enableEthernet ? true +, enableWireguard ? true +, enableGadget ? true +, enableWifi ? true +, enableBluetooth ? true +, enableOfono ? true +, enableDundee ? true +, enablePacrunner ? true +, enableNeard ? true +, enableWispr ? true +, enableTools ? true +, enableStats ? true +, enableClient ? true +, enableDatafiles ? true +# optional features which are turned *off* by default +, enableNetworkManager ? false +, enableHh2serialGps ? false +, enableL2tp ? false +, enableIospm ? false +, enableTist ? false +}: + +assert lib.asserts.assertOneOf "firewallType" firewallType [ "iptables" "nftables" ]; +assert lib.asserts.assertOneOf "dnsType" dnsType [ "internal" "systemd-resolved" ]; + +let inherit (lib) optionals; in + +stdenv.mkDerivation rec { + pname = "connman"; + version = "1.39"; + src = fetchurl { + url = "mirror://kernel/linux/network/connman/${pname}-${version}.tar.xz"; + sha256 = "sha256-n2KnFpt0kcZwof8uM1sNlmMI+y9i4oXHgRBeuQ8YGvM="; + }; + + buildInputs = [ + glib + dbus + libmnl + gnutls + readline + ]; + + nativeBuildInputs = [ + pkg-config + file + ] + ++ optionals (enablePolkit) [ polkit ] + ++ optionals (enablePptp) [ pptp ppp ] + ++ optionals (firewallType == "iptables") [ iptables ] + ++ optionals (firewallType == "nftables") [ libnftnl ] + ; + + # fix invalid path to 'file' + postPatch = '' + sed -i "s/\/usr\/bin\/file/file/g" ./configure + ''; + + configureFlags = [ + # directories flags + "--sysconfdir=/etc" + "--localstatedir=/var" + "--with-dbusconfdir=${placeholder "out"}/share" + "--with-dbusdatadir=${placeholder "out"}/share" + "--with-tmpfilesdir=${placeholder "out"}/lib/tmpfiles.d" + "--with-systemdunitdir=${placeholder "out"}/lib/systemd/system" + "--with-dns-backend=${dnsType}" + "--with-firewall=${firewallType}" + # production build flags + "--disable-maintainer-mode" + "--enable-session-policy-local=builtin" + # for building and running tests + # "--enable-tests" # installs the tests, we don't want that + "--enable-tools" + ] + ++ optionals (!enableLoopback) [ "--disable-loopback" ] + ++ optionals (!enableEthernet) [ "--disable-ethernet" ] + ++ optionals (!enableWireguard) [ "--disable-wireguard" ] + ++ optionals (!enableGadget) [ "--disable-gadget" ] + ++ optionals (!enableWifi) [ "--disable-wifi" ] + # enable IWD support for wifi as it doesn't require any new dependencies + # and it's easier for the NixOS module to use only one connman package when + # IWD is requested + ++ optionals (enableWifi) [ "--enable-iwd" ] + ++ optionals (!enableBluetooth) [ "--disable-bluetooth" ] + ++ optionals (!enableOfono) [ "--disable-ofono" ] + ++ optionals (!enableDundee) [ "--disable-dundee" ] + ++ optionals (!enablePacrunner) [ "--disable-pacrunner" ] + ++ optionals (!enableNeard) [ "--disable-neard" ] + ++ optionals (!enableWispr) [ "--disable-wispr" ] + ++ optionals (!enableTools) [ "--disable-tools" ] + ++ optionals (!enableStats) [ "--disable-stats" ] + ++ optionals (!enableClient) [ "--disable-client" ] + ++ optionals (!enableDatafiles) [ "--disable-datafiles" ] + ++ optionals (enableOpenconnect) [ + "--enable-openconnect=builtin" + "--with-openconnect=${openconnect}/sbin/openconnect" + ] + ++ optionals (enableOpenvpn) [ + "--enable-openvpn=builtin" + "--with-openvpn=${openvpn}/sbin/openvpn" + ] + ++ optionals (enableVpnc) [ + "--enable-vpnc=builtin" + "--with-vpnc=${vpnc}/sbin/vpnc" + ] + ++ optionals (enablePolkit) [ + "--enable-polkit" + ] + ++ optionals (enablePptp) [ + "--enable-pptp" + "--with-pptp=${pptp}/sbin/pptp" + ] + ++ optionals (!enableWireguard) [ + "--disable-wireguard" + ] + ++ optionals (enableNetworkManager) [ + "--enable-nmcompat" + ] + ++ optionals (enableHh2serialGps) [ + "--enable-hh2serial-gps" + ] + ++ optionals (enableL2tp) [ + "--enable-l2tp" + ] + ++ optionals (enableIospm) [ + "--enable-iospm" + ] + ++ optionals (enableTist) [ + "--enable-tist" + ] + ; + + doCheck = true; + + meta = with lib; { + description = "A daemon for managing internet connections"; + homepage = "https://01.org/connman"; + maintainers = [ maintainers.matejc ]; + platforms = platforms.linux; + license = licenses.gpl2; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/connman/connman_dmenu/default.nix b/nixpkgs/pkgs/tools/networking/connman/connman_dmenu/default.nix new file mode 100644 index 000000000000..3ac730f471f7 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/connman/connman_dmenu/default.nix @@ -0,0 +1,35 @@ +{ lib, stdenv, fetchFromGitHub, connman, dmenu }: + +stdenv.mkDerivation { + pname = "connman_dmenu"; + version = "git-29-9-2015"; + + src = fetchFromGitHub { + owner = "march-linux"; + repo = "connman_dmenu"; + rev = "cc89fec40b574b0d234afeb70ea3c94626ca3f5c"; + sha256 = "061fi83pai4n19l9d7wq6wwj2d7cixwkhkh742c5ibmw1wb274yk"; + }; + + buildInputs = [ connman dmenu ]; + + dontBuild = true; + + # remove root requirement, see: https://github.com/march-linux/connman_dmenu/issues/3 + postPatch = '' + sed -i '89,92d' connman_dmenu + ''; + + installPhase = '' + mkdir -p $out/bin + cp connman_dmenu $out/bin/ + ''; + + meta = { + description = "A dmenu wrapper for connmann"; + homepage = "https://github.com/march-linux/connman_dmenu"; + license = lib.licenses.free; + maintainers = [ lib.maintainers.magnetophon ]; + platforms = lib.platforms.all; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/connman/default.nix b/nixpkgs/pkgs/tools/networking/connman/default.nix new file mode 100644 index 000000000000..ccceaa30b043 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/connman/default.nix @@ -0,0 +1,40 @@ +{ callPackage }: + +{ + # All the defaults + connman = callPackage ./connman.nix { }; + + connmanFull = callPackage ./connman.nix { + # TODO: Why is this in `connmanFull` and not the default build? See TODO in + # nixos/modules/services/networking/connman.nix (near the assertions) + enableNetworkManager = true; + enableHh2serialGps = true; + enableL2tp = true; + enableIospm = true; + enableTist = true; + }; + + connmanMinimal = callPackage ./connman.nix { + enableOpenconnect = false; + enableOpenvpn = false; + enableVpnc = false; + vpnc = false; + enablePolkit = false; + enablePptp = false; + enableLoopback = false; + # enableEthernet = false; # If disabled no ethernet connection can be performed + enableWireguard = false; + enableGadget = false; + # enableWifi = false; # If disabled no WiFi connection can be performed + enableBluetooth = false; + enableOfono = false; + enableDundee = false; + enablePacrunner = false; + enableNeard = false; + enableWispr = false; + enableTools = false; + enableStats = false; + enableClient = false; + # enableDatafiles = false; # If disabled, configuration and data files are not installed + }; +} diff --git a/nixpkgs/pkgs/tools/networking/corerad/default.nix b/nixpkgs/pkgs/tools/networking/corerad/default.nix new file mode 100644 index 000000000000..f5b0875e6ffb --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/corerad/default.nix @@ -0,0 +1,40 @@ +{ lib, buildGoModule, fetchFromGitHub, nixosTests }: + +buildGoModule rec { + pname = "corerad"; + version = "0.3.1"; + + src = fetchFromGitHub { + owner = "mdlayher"; + repo = "corerad"; + rev = "v${version}"; + sha256 = "0ky4zfmxzgxidsizfj2lwm5z3zl666khw9cgsxfgbzn3cjgr33c3"; + }; + + vendorSha256 = "0ddni8hl8fv0m9kinwfnhcj3k51fk8h61yksv7ws6agdx0bl1rwh"; + + doCheck = false; + + # Since the tarball pulled from GitHub doesn't contain git tag information, + # we fetch the expected tag's timestamp from a file in the root of the + # repository. + preBuild = '' + buildFlagsArray=( + -ldflags=" + -X github.com/mdlayher/corerad/internal/build.linkTimestamp=$(<.gittagtime) + -X github.com/mdlayher/corerad/internal/build.linkVersion=v${version} + " + ) + ''; + + passthru.tests = { + inherit (nixosTests) corerad; + }; + + meta = with lib; { + homepage = "https://github.com/mdlayher/corerad"; + description = "Extensible and observable IPv6 NDP RA daemon"; + license = licenses.asl20; + maintainers = with maintainers; [ mdlayher ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/corkscrew/default.nix b/nixpkgs/pkgs/tools/networking/corkscrew/default.nix new file mode 100644 index 000000000000..58a43c30a935 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/corkscrew/default.nix @@ -0,0 +1,22 @@ +{ lib, stdenv, fetchurl, automake }: + +stdenv.mkDerivation rec { + name = "corkscrew-2.0"; + + src = fetchurl { + url = "http://agroman.net/corkscrew/${name}.tar.gz"; + sha256 = "0d0fcbb41cba4a81c4ab494459472086f377f9edb78a2e2238ed19b58956b0be"; + }; + + preConfigure = '' + ln -sf ${automake}/share/automake-*/config.sub config.sub + ln -sf ${automake}/share/automake-*/config.guess config.guess + ''; + + meta = with lib; { + homepage = "http://agroman.net/corkscrew/"; + description = "A tool for tunneling SSH through HTTP proxies"; + license = lib.licenses.gpl2; + platforms = platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/crackle/default.nix b/nixpkgs/pkgs/tools/networking/crackle/default.nix new file mode 100644 index 000000000000..00d0acd2aa94 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/crackle/default.nix @@ -0,0 +1,24 @@ +{ lib, stdenv, fetchFromGitHub, libpcap, coreutils }: + +stdenv.mkDerivation { + pname = "crackle"; + version = "unstable-2020-12-13"; + + src = fetchFromGitHub { + owner = "mikeryan"; + repo = "crackle"; + rev = "d83b4b6f4145ca53c46c36bbd7ccad751af76b75"; + sha256 = "sha256-Dy4s/hr9ySrogltyk2GVsuAvwNF5+b6CDjaD+2FaPHA="; + }; + + buildInputs = [ libpcap ]; + + installFlags = [ "DESTDIR=$(out)" "PREFIX=" "INSTALL=${coreutils}/bin/install" ]; + + meta = with lib; { + description = "Crack and decrypt BLE encryption"; + homepage = "https://github.com/mikeryan/crackle"; + maintainers = with maintainers; [ fortuneteller2k ]; + license = licenses.bsd2; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/croc/default.nix b/nixpkgs/pkgs/tools/networking/croc/default.nix new file mode 100644 index 000000000000..66c5598d0209 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/croc/default.nix @@ -0,0 +1,45 @@ +{ lib, buildGoModule, fetchFromGitHub, callPackage}: + +buildGoModule rec { + pname = "croc"; + version = "9.1.4"; + + src = fetchFromGitHub { + owner = "schollz"; + repo = pname; + rev = "v${version}"; + sha256 = "16HmRluhqCr6Gt+x8PSCU4W9pUJp89l4GO29uI+ZzkI="; + }; + + vendorSha256 = "sha256-f0KiXHspGX96k5ViCwI62Qs+rHowpqm+gLy7/iqdnE4="; + + doCheck = false; + + subPackages = [ "." ]; + + passthru = { + tests = { + local-relay = callPackage ./test-local-relay.nix {}; + }; + }; + meta = with lib; { + description = + "Easily and securely send things from one computer to another"; + homepage = "https://github.com/schollz/croc"; + license = licenses.mit; + maintainers = with maintainers; [ hugoreeves equirosa ]; + + longDescription = '' + Croc is a command line tool written in Go that allows any two computers to + simply and securely transfer files and folders. + + Croc does all of the following: + - Allows any two computers to transfer data (using a relay) + - Provides end-to-end encryption (using PAKE) + - Enables easy cross-platform transfers (Windows, Linux, Mac) + - Allows multiple file transfers + - Allows resuming transfers that are interrupted + - Does not require a server or port-forwarding + ''; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/croc/test-local-relay.nix b/nixpkgs/pkgs/tools/networking/croc/test-local-relay.nix new file mode 100644 index 000000000000..4ddad86bd009 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/croc/test-local-relay.nix @@ -0,0 +1,20 @@ +{ stdenv, croc }: + +stdenv.mkDerivation { + name = "croc-test-local-relay"; + meta.timeout = 300; + buildCommand = '' + HOME=$(mktemp -d) + # start a local relay + ${croc}/bin/croc relay --ports 11111,11112 & + # start sender in background + MSG="See you later, alligator!" + ${croc}/bin/croc --relay localhost:11111 send --code correct-horse-battery-staple --text "$MSG" & + # wait for things to settle + sleep 1 + # receive, as of croc 9 --overwrite is required for noninteractive use + MSG2=$(${croc}/bin/croc --overwrite --relay localhost:11111 --yes correct-horse-battery-staple) + # compare + [ "$MSG" = "$MSG2" ] && touch $out + ''; +} diff --git a/nixpkgs/pkgs/tools/networking/curl-unix-socket/default.nix b/nixpkgs/pkgs/tools/networking/curl-unix-socket/default.nix new file mode 100644 index 000000000000..ab4c3292ea51 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/curl-unix-socket/default.nix @@ -0,0 +1,31 @@ +{ buildGoPackage, lib, fetchFromGitHub }: + +buildGoPackage rec { + name = "curl-unix-socket-2015-04-10"; + + src = fetchFromGitHub { + owner = "Soulou"; + repo = "curl-unix-socket"; + rev = "a7da90b01ed43e8c0d606f760c9da82f8e3ed307"; + sha256 = "1ynrrav90y3dhk8jq2fxm3jswj5nvrffwslgykj429hk6n0czb3d"; + }; + + goPackagePath = "github.com/Soulou/curl-unix-socket"; + + buildPhase = '' + runHook preBuild + ( + cd go/src/${goPackagePath} + go build -o $NIX_BUILD_TOP/go/bin/curl-unix-socket + ) + runHook postBuild + ''; + + meta = with lib; { + description = "Run HTTP requests over UNIX socket"; + license = licenses.mit; + homepage = "https://github.com/Soulou/curl-unix-socket"; + maintainers = with maintainers; [offline]; + platforms = platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/curl/default.nix b/nixpkgs/pkgs/tools/networking/curl/default.nix new file mode 100644 index 000000000000..05b91bfba055 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/curl/default.nix @@ -0,0 +1,140 @@ +{ stdenv, lib, fetchurl, pkg-config, perl +, http2Support ? true, nghttp2 +, idnSupport ? false, libidn ? null +, ldapSupport ? false, openldap ? null +, zlibSupport ? true, zlib ? null +, sslSupport ? zlibSupport, openssl ? null +, gnutlsSupport ? false, gnutls ? null +, wolfsslSupport ? false, wolfssl ? null +, scpSupport ? zlibSupport && !stdenv.isSunOS && !stdenv.isCygwin, libssh2 ? null +, gssSupport ? with stdenv.hostPlatform; !( + !isWindows && + # a very sad story re static: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=439039 + !isStatic && + # the "mig" tool does not configure its compiler correctly. This could be + # fixed in mig, but losing gss support on cross compilation to darwin is + # not worth the effort. + !(isDarwin && (stdenv.buildPlatform != stdenv.hostPlatform)) + ), libkrb5 ? null +, c-aresSupport ? false, c-ares ? null +, brotliSupport ? false, brotli ? null +}: + +# Note: this package is used for bootstrapping fetchurl, and thus +# cannot use fetchpatch! All mutable patches (generated by GitHub or +# cgit) that are needed here should be included directly in Nixpkgs as +# files. + +assert http2Support -> nghttp2 != null; +assert idnSupport -> libidn != null; +assert ldapSupport -> openldap != null; +assert zlibSupport -> zlib != null; +assert sslSupport -> openssl != null; +assert !(gnutlsSupport && sslSupport); +assert !(gnutlsSupport && wolfsslSupport); +assert !(sslSupport && wolfsslSupport); +assert gnutlsSupport -> gnutls != null; +assert wolfsslSupport -> wolfssl != null; +assert scpSupport -> libssh2 != null; +assert c-aresSupport -> c-ares != null; +assert brotliSupport -> brotli != null; +assert gssSupport -> libkrb5 != null; + +stdenv.mkDerivation rec { + pname = "curl"; + version = "7.76.1"; + + src = fetchurl { + urls = [ + "https://curl.haxx.se/download/${pname}-${version}.tar.bz2" + "https://github.com/curl/curl/releases/download/${lib.replaceStrings ["."] ["_"] pname}-${version}/${pname}-${version}.tar.bz2" + ]; + sha256 = "1scmfrp0c27pkd7yva9k50miprjpsyfbb33apx72qc9igm6ii3ks"; + }; + + outputs = [ "bin" "dev" "out" "man" "devdoc" ]; + separateDebugInfo = stdenv.isLinux; + + enableParallelBuilding = true; + + nativeBuildInputs = [ pkg-config perl ]; + + # Zlib and OpenSSL must be propagated because `libcurl.la' contains + # "-lz -lssl", which aren't necessary direct build inputs of + # applications that use Curl. + propagatedBuildInputs = with lib; + optional http2Support nghttp2 ++ + optional idnSupport libidn ++ + optional ldapSupport openldap ++ + optional zlibSupport zlib ++ + optional gssSupport libkrb5 ++ + optional c-aresSupport c-ares ++ + optional sslSupport openssl ++ + optional gnutlsSupport gnutls ++ + optional wolfsslSupport wolfssl ++ + optional scpSupport libssh2 ++ + optional brotliSupport brotli; + + # for the second line see https://curl.haxx.se/mail/tracker-2014-03/0087.html + preConfigure = '' + sed -e 's|/usr/bin|/no-such-path|g' -i.bak configure + rm src/tool_hugehelp.c + ''; + + configureFlags = [ + # Disable default CA bundle, use NIX_SSL_CERT_FILE or fallback + # to nss-cacert from the default profile. + "--without-ca-bundle" + "--without-ca-path" + # The build fails when using wolfssl with --with-ca-fallback + ( if wolfsslSupport then "--without-ca-fallback" else "--with-ca-fallback") + "--disable-manual" + ( if sslSupport then "--with-ssl=${openssl.dev}" else "--without-ssl" ) + ( if gnutlsSupport then "--with-gnutls=${gnutls.dev}" else "--without-gnutls" ) + ( if scpSupport then "--with-libssh2=${libssh2.dev}" else "--without-libssh2" ) + ( if ldapSupport then "--enable-ldap" else "--disable-ldap" ) + ( if ldapSupport then "--enable-ldaps" else "--disable-ldaps" ) + ( if idnSupport then "--with-libidn=${libidn.dev}" else "--without-libidn" ) + ( if brotliSupport then "--with-brotli" else "--without-brotli" ) + ] + ++ lib.optional wolfsslSupport "--with-wolfssl=${wolfssl.dev}" + ++ lib.optional c-aresSupport "--enable-ares=${c-ares}" + ++ lib.optional gssSupport "--with-gssapi=${libkrb5.dev}" + # For the 'urandom', maybe it should be a cross-system option + ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) + "--with-random=/dev/urandom" + ++ lib.optionals stdenv.hostPlatform.isWindows [ + "--disable-shared" + "--enable-static" + ]; + + CXX = "${stdenv.cc.targetPrefix}c++"; + CXXCPP = "${stdenv.cc.targetPrefix}c++ -E"; + + doCheck = false; # expensive, fails + + postInstall = '' + moveToOutput bin/curl-config "$dev" + + # Install completions + make -C scripts install + '' + lib.optionalString scpSupport '' + sed '/^dependency_libs/s|${libssh2.dev}|${libssh2.out}|' -i "$out"/lib/*.la + '' + lib.optionalString gnutlsSupport '' + ln $out/lib/libcurl.so $out/lib/libcurl-gnutls.so + ln $out/lib/libcurl.so $out/lib/libcurl-gnutls.so.4 + ln $out/lib/libcurl.so $out/lib/libcurl-gnutls.so.4.4.0 + ''; + + passthru = { + inherit sslSupport openssl; + }; + + meta = with lib; { + description = "A command line tool for transferring files with URL syntax"; + homepage = "https://curl.haxx.se/"; + license = licenses.curl; + maintainers = with maintainers; [ lovek323 ]; + platforms = platforms.all; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/curlie/default.nix b/nixpkgs/pkgs/tools/networking/curlie/default.nix new file mode 100644 index 000000000000..9ae9644eb940 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/curlie/default.nix @@ -0,0 +1,24 @@ +{ buildGoModule, fetchFromGitHub, lib }: + +buildGoModule rec { + pname = "curlie"; + version = "1.6.0"; + + src= fetchFromGitHub { + owner = "rs"; + repo = pname; + rev = "v${version}"; + sha256 = "sha256-rrwdqaKrC37BaI9RuTTv6EiOZ3ztgd7nGuplmeW02h8="; + }; + + vendorSha256 = "sha256-tYZtnD7RUurhl8yccXlTIvOxybBJITM+it1ollYJ1OI="; + + doCheck = false; + + meta = with lib; { + description = "Frontend to curl that adds the ease of use of httpie, without compromising on features and performance"; + homepage = "https://curlie.io/"; + maintainers = with maintainers; [ ma27 ]; + license = licenses.mit; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/darkstat/default.nix b/nixpkgs/pkgs/tools/networking/darkstat/default.nix new file mode 100644 index 000000000000..04cab3655787 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/darkstat/default.nix @@ -0,0 +1,31 @@ +{ lib, stdenv, fetchurl, libpcap, zlib }: + +stdenv.mkDerivation rec { + version = "3.0.719"; + pname = "darkstat"; + + src = fetchurl { + url = "${meta.homepage}/${pname}-${version}.tar.bz2"; + sha256 = "1mzddlim6dhd7jhr4smh0n2fa511nvyjhlx76b03vx7phnar1bxf"; + }; + + buildInputs = [ libpcap zlib ]; + + enableParallelBuilding = true; + + meta = with lib; { + description = "Network statistics web interface"; + longDescription = '' + Captures network traffic, calculates statistics about usage, and serves + reports over HTTP. Features: + - Traffic graphs, reports per host, shows ports for each host. + - Embedded web-server with deflate compression. + - Asynchronous reverse DNS resolution using a child process. + - Small. Portable. Single-threaded. Efficient. + - Supports IPv6. + ''; + homepage = "http://unix4lyfe.org/darkstat"; + license = licenses.gpl2; + platforms = with platforms; unix; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/davix/default.nix b/nixpkgs/pkgs/tools/networking/davix/default.nix new file mode 100644 index 000000000000..d9f368455594 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/davix/default.nix @@ -0,0 +1,31 @@ +{ lib, stdenv, fetchurl, cmake, pkg-config, openssl, libxml2, boost, python3, libuuid }: + +stdenv.mkDerivation rec { + version = "0.7.6"; + pname = "davix"; + nativeBuildInputs = [ cmake pkg-config python3 ]; + buildInputs = [ openssl libxml2 boost libuuid ]; + + # using the url below since the github release page states + # "please ignore the GitHub-generated tarballs, as they are incomplete" + # https://github.com/cern-fts/davix/releases/tag/R_0_7_6 + src = fetchurl { + url = "https://github.com/cern-fts/${pname}/releases/download/R_${lib.replaceStrings ["."] ["_"] version}/${pname}-${version}.tar.gz"; + sha256 = "0wq66spnr616cns72f9dvr2xfvkdvfqqmc6d7dx29fpp57zzvrx2"; + }; + + + meta = with lib; { + description = "Toolkit for Http-based file management"; + + longDescription = "Davix is a toolkit designed for file + operations with Http based protocols (WebDav, Amazon S3, ...). + Davix provides an API and a set of command line tools"; + + license = licenses.lgpl2Plus; + homepage = "http://dmc.web.cern.ch/projects/davix/home"; + maintainers = [ maintainers.adev ]; + platforms = platforms.all; + }; +} + diff --git a/nixpkgs/pkgs/tools/networking/dd-agent/40103-iostat-fix.patch b/nixpkgs/pkgs/tools/networking/dd-agent/40103-iostat-fix.patch new file mode 100644 index 000000000000..9897a76c957d --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/dd-agent/40103-iostat-fix.patch @@ -0,0 +1,30 @@ +diff --git a/checks/system/unix.py b/checks/system/unix.py +index c37af3c3..58c72626 100644 +--- a/checks/system/unix.py ++++ b/checks/system/unix.py +@@ -39,7 +39,7 @@ class IO(Check): + self.value_re = re.compile(r'\d+\.\d+') + + def _parse_linux2(self, output): +- recentStats = output.split('Device:')[2].split('\n') ++ recentStats = output.split('Device')[2].split('\n') + header = recentStats[0] + headerNames = re.findall(self.header_re, header) + device = None +@@ -123,14 +123,14 @@ class IO(Check): + + # Linux 2.6.32-343-ec2 (ip-10-35-95-10) 12/11/2012 _x86_64_ (2 CPU) + # +- # Device: rrqm/s wrqm/s r/s w/s rkB/s wkB/s avgrq-sz avgqu-sz await svctm %util ++ # Device rrqm/s wrqm/s r/s w/s rkB/s wkB/s avgrq-sz avgqu-sz await svctm %util + # sda1 0.00 17.61 0.26 32.63 4.23 201.04 12.48 0.16 4.81 0.53 1.73 + # sdb 0.00 2.68 0.19 3.84 5.79 26.07 15.82 0.02 4.93 0.22 0.09 + # sdg 0.00 0.13 2.29 3.84 100.53 30.61 42.78 0.05 8.41 0.88 0.54 + # sdf 0.00 0.13 2.30 3.84 100.54 30.61 42.78 0.06 9.12 0.90 0.55 + # md0 0.00 0.00 0.05 3.37 1.41 30.01 18.35 0.00 0.00 0.00 0.00 + # +- # Device: rrqm/s wrqm/s r/s w/s rkB/s wkB/s avgrq-sz avgqu-sz await svctm %util ++ # Device rrqm/s wrqm/s r/s w/s rkB/s wkB/s avgrq-sz avgqu-sz await svctm %util + # sda1 0.00 0.00 0.00 10.89 0.00 43.56 8.00 0.03 2.73 2.73 2.97 + # sdb 0.00 0.00 0.00 2.97 0.00 11.88 8.00 0.00 0.00 0.00 0.00 + # sdg 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 diff --git a/nixpkgs/pkgs/tools/networking/dd-agent/5.nix b/nixpkgs/pkgs/tools/networking/dd-agent/5.nix new file mode 100644 index 000000000000..f40ef295d138 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/dd-agent/5.nix @@ -0,0 +1,111 @@ +{ lib, stdenv, fetchFromGitHub, python2 +, unzip, makeWrapper }: +let + python' = python2.override { + packageOverrides = self: super: { + docker = self.buildPythonPackage rec { + name = "docker-${version}"; + version = "1.10.6"; + + src = fetchFromGitHub { + owner = "docker"; + repo = "docker-py"; + rev = version; + sha256 = "1awzpbrkh4fympqzddz5i3ml81b7f0i0nwkvbpmyxjjfqx6l0m4m"; + }; + + propagatedBuildInputs = with self; [ + six + requests + websocket_client + ipaddress + docker_pycreds + uptime + ] ++ lib.optionals (self.pythonOlder "3.7") [ backports_ssl_match_hostname ]; + + # due to flake8 + doCheck = false; + }; + + pymongo = super.pymongo.overridePythonAttrs (oldAttrs: rec { + version = "2.9.5"; + src = oldAttrs.src.override { + inherit version; + sha256 = "912516ac6a355d7624374a38337b8587afe3eb535c0a5456b3bd12df637a6e70"; + }; + }); + }; + }; + +in stdenv.mkDerivation rec { + version = "5.11.2"; + pname = "dd-agent"; + + src = fetchFromGitHub { + owner = "datadog"; + repo = "dd-agent"; + rev = version; + sha256 = "1iqxvgpsqibqw3vk79158l2pnb6y4pjhjp2d6724lm5rpz4825lx"; + }; + + patches = [ ./40103-iostat-fix.patch ]; + + nativeBuildInputs = [ unzip ]; + buildInputs = [ + makeWrapper + ] ++ (with python'.pkgs; [ + requests + psycopg2 + psutil + ntplib + simplejson + pyyaml + pymongo + python-etcd + consul + docker + ]); + propagatedBuildInputs = with python'.pkgs; [ python tornado ]; + + buildCommand = '' + mkdir -p $out/bin + cp -R $src $out/agent + chmod u+w -R $out + (cd $out/agent; patchPhase) + PYTHONPATH=$out/agent:$PYTHONPATH + ln -s $out/agent/agent.py $out/bin/dd-agent + ln -s $out/agent/dogstatsd.py $out/bin/dogstatsd + ln -s $out/agent/ddagent.py $out/bin/dd-forwarder + + # Move out default conf.d so that /etc/dd-agent/conf.d is used + mv $out/agent/conf.d $out/agent/conf.d-system + + cat > $out/bin/dd-jmxfetch <<EOF + #!/usr/bin/env bash + exec ${python'.interpreter} $out/agent/jmxfetch.py $@ + EOF + chmod a+x $out/bin/dd-jmxfetch + + wrapProgram $out/bin/dd-forwarder \ + --prefix PYTHONPATH : $PYTHONPATH + wrapProgram $out/bin/dd-agent \ + --prefix PYTHONPATH : $PYTHONPATH + wrapProgram $out/bin/dogstatsd \ + --prefix PYTHONPATH : $PYTHONPATH + wrapProgram $out/bin/dd-jmxfetch \ + --prefix PYTHONPATH : $PYTHONPATH + + patchShebangs $out + ''; + + meta = { + description = '' + Event collector for the DataDog analysis service + -- v5 Python implementation + ''; + homepage = "https://www.datadoghq.com"; + license = lib.licenses.bsd3; + platforms = lib.platforms.all; + maintainers = with lib.maintainers; [ thoughtpolice domenkozar ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/dd-agent/README.md b/nixpkgs/pkgs/tools/networking/dd-agent/README.md new file mode 100644 index 000000000000..8cff23b9574c --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/dd-agent/README.md @@ -0,0 +1,17 @@ +To update datadog-agent v6 (v5 is deprecated and should be removed): + +1. Bump `version`, `rev`, `sha256` and `payloadVersion` in `datadog-agent.nix` +2. `git clone https://github.com/DataDog/datadog-agent.git && cd datadog-agent` +3. `git checkout <tag>` +4. `nix-env -i -f https://github.com/nixcloud/dep2nix/archive/master.tar.gz` +5. `dep2nix` +6. `cp deps.nix $NIXPKGS/pkgs/tools/networking/dd-agent/datadog-agent-deps.nix` + +To update datadog-process-agent: + +1. Bump `version`, `rev` and `sha256` in `datadog-process-agent.nix` +2. `git clone https://github.com/DataDog/datadog-process-agent.git && cd datadog-process-agent` +3. `git checkout <tag>` +4. `nix-env -i -f https://github.com/nixcloud/dep2nix/archive/master.tar.gz` +5. `dep2nix` +6. `cp deps.nix $NIXPKGS/pkgs/tools/networking/dd-agent/datadog-process-agent-deps.nix` diff --git a/nixpkgs/pkgs/tools/networking/dd-agent/datadog-agent-deps.nix b/nixpkgs/pkgs/tools/networking/dd-agent/datadog-agent-deps.nix new file mode 100644 index 000000000000..fb6f66b5a4e4 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/dd-agent/datadog-agent-deps.nix @@ -0,0 +1,1353 @@ +# file generated from Gopkg.lock using dep2nix (https://github.com/nixcloud/dep2nix) +[ + { + goPackagePath = "bitbucket.org/ww/goautoneg"; + fetch = { + type = "git"; + url = "https://github.com/adjust/goautoneg"; + rev = "d788f35a0315672bc90f50a6145d1252a230ee0d"; + sha256 = "19khhn5xhqv1yp7d6k987gh5w5rhrjnp4p0c6fyrd8z6lzz5h9qi"; + }; + } + { + goPackagePath = "github.com/DataDog/agent-payload"; + fetch = { + type = "git"; + url = "https://github.com/DataDog/agent-payload"; + rev = "c76e9d5be7457cafb7b3e056c6e8ae127b1f0431"; + sha256 = "0wva55yz5gs5gw23icz1z23hwhjw5vmijx4aa3fp3bq6pi63s873"; + }; + } + { + goPackagePath = "github.com/DataDog/datadog-go"; + fetch = { + type = "git"; + url = "https://github.com/DataDog/datadog-go"; + rev = "e67964b4021ad3a334e748e8811eb3cd6becbc6e"; + sha256 = "1b2dzyk9c9icdwcyfiwh3djzh8gb5z4hmhp796ns7hh72cdnnys1"; + }; + } + { + goPackagePath = "github.com/DataDog/gohai"; + fetch = { + type = "git"; + url = "https://github.com/DataDog/gohai"; + rev = "43b075bb9705588cd89c71363d6d72937e3020c7"; + sha256 = "195z5g8gdxcx4cq51p2xqha3j8m7mk5d5lr6i3hbaxp948hgc8dh"; + }; + } + { + goPackagePath = "github.com/DataDog/mmh3"; + fetch = { + type = "git"; + url = "https://github.com/DataDog/mmh3"; + rev = "2cfb68475274527a10701355c739f31dd404718c"; + sha256 = "09jgzxi08pkxllxk3f5qwipz96jxrw5v035fj2bkid1d4akn8y0b"; + }; + } + { + goPackagePath = "github.com/DataDog/viper"; + fetch = { + type = "git"; + url = "https://github.com/DataDog/viper"; + rev = "v1.5.0"; + sha256 = "1sv0xvmfaif7zpfwk0j6qf11hxnfdsb2zfj63b9zx7l0zzhjzh06"; + }; + } + { + goPackagePath = "github.com/DataDog/zstd"; + fetch = { + type = "git"; + url = "https://github.com/DataDog/zstd"; + rev = "aebefd9fcb99f22cd691ef778a12ed68f0e6a1ab"; + sha256 = "06wphl43ji23c0cmmm6fd3wszbwq36mdp1jarak2a6hmxl6yf0b8"; + }; + } + { + goPackagePath = "github.com/Microsoft/go-winio"; + fetch = { + type = "git"; + url = "https://github.com/Microsoft/go-winio"; + rev = "67921128fb397dd80339870d2193d6b1e6856fd4"; + sha256 = "1m3ajjwpdmbzhn5iclhzgyknfncw06fnd5n91yxlf75qsq235rz3"; + }; + } + { + goPackagePath = "github.com/Microsoft/hcsshim"; + fetch = { + type = "git"; + url = "https://github.com/Microsoft/hcsshim"; + rev = "0acf63599bff447edf6bbfb8bbb38cb5fb33aa1e"; + sha256 = "009jx133302pj0jf1bxsj4r5zy7j0lxmr7l53czi7930516b0rh3"; + }; + } + { + goPackagePath = "github.com/NYTimes/gziphandler"; + fetch = { + type = "git"; + url = "https://github.com/NYTimes/gziphandler"; + rev = "2600fb119af974220d3916a5916d6e31176aac1b"; + sha256 = "0bh6qqz2iyrnxhhj02s8mqayqwqxy182ldxh97q1vg7phlbm52xx"; + }; + } + { + goPackagePath = "github.com/PuerkitoBio/purell"; + fetch = { + type = "git"; + url = "https://github.com/PuerkitoBio/purell"; + rev = "0bcb03f4b4d0a9428594752bd2a3b9aa0a9d4bd4"; + sha256 = "0vsxyn1fbm7g873b8kf3hcsgqgncb5nmfq3zfsc35a9yhzarka91"; + }; + } + { + goPackagePath = "github.com/PuerkitoBio/urlesc"; + fetch = { + type = "git"; + url = "https://github.com/PuerkitoBio/urlesc"; + rev = "de5bf2ad457846296e2031421a34e2568e304e35"; + sha256 = "0n0srpqwbaan1wrhh2b7ysz543pjs1xw2rghvqyffg9l0g8kzgcw"; + }; + } + { + goPackagePath = "github.com/StackExchange/wmi"; + fetch = { + type = "git"; + url = "https://github.com/StackExchange/wmi"; + rev = "5d049714c4a64225c3c79a7cf7d02f7fb5b96338"; + sha256 = "1slw6v1fl8i0hz4db9lph55pbhnrxhqyndq6vm27dgvpj22k29fk"; + }; + } + { + goPackagePath = "github.com/aws/aws-sdk-go"; + fetch = { + type = "git"; + url = "https://github.com/aws/aws-sdk-go"; + rev = "bff41fb23b7550368282029f6478819d6a99ae0f"; + sha256 = "1hcd8f3m2cq02mj9i8c1ynbh3j0iyw14l1wszm0qgs18nsj1rzgn"; + }; + } + { + goPackagePath = "github.com/beevik/ntp"; + fetch = { + type = "git"; + url = "https://github.com/beevik/ntp"; + rev = "cb3dae3a7588ae35829eb5724df611cd75152fba"; + sha256 = "0nc6f7d0xw23y18z9qxrmm8kvnywihassyk706mn9v4makmhalnz"; + }; + } + { + goPackagePath = "github.com/beorn7/perks"; + fetch = { + type = "git"; + url = "https://github.com/beorn7/perks"; + rev = "3a771d992973f24aa725d07868b467d1ddfceafb"; + sha256 = "1l2lns4f5jabp61201sh88zf3b0q793w4zdgp9nll7mmfcxxjif3"; + }; + } + { + goPackagePath = "github.com/cenkalti/backoff"; + fetch = { + type = "git"; + url = "https://github.com/cenkalti/backoff"; + rev = "2ea60e5f094469f9e65adb9cd103795b73ae743e"; + sha256 = "0k4899ifpir6kmfxli8a2xfj5zdh0xb2jd0fq2r38wzd4pk25ipr"; + }; + } + { + goPackagePath = "github.com/cihub/seelog"; + fetch = { + type = "git"; + url = "https://github.com/cihub/seelog"; + rev = "d2c6e5aa9fbfdd1c624e140287063c7730654115"; + sha256 = "0ab9kyrh51x1x71z37pwjsla0qv11a1qv697xafyc4r5nq5hds6p"; + }; + } + { + goPackagePath = "github.com/clbanning/mxj"; + fetch = { + type = "git"; + url = "https://github.com/clbanning/mxj"; + rev = "1f00e0bf9bacd7ea9c93d27594d1d1f5a41bac36"; + sha256 = "1cb7kib79xrzr8n91p6kskmn30ayqrhbqql2ppyf879967wbm8qy"; + }; + } + { + goPackagePath = "github.com/containerd/cgroups"; + fetch = { + type = "git"; + url = "https://github.com/containerd/cgroups"; + rev = "3024bc7cc0c88af4b32d38a14444f38e65ab169f"; + sha256 = "09jmzwl0zjzwhyd77pp8x3xwihcjxlxa9wamkx22rvd1pqlgszw7"; + }; + } + { + goPackagePath = "github.com/containerd/containerd"; + fetch = { + type = "git"; + url = "https://github.com/containerd/containerd"; + rev = "9754871865f7fe2f4e74d43e2fc7ccd237edcbce"; + sha256 = "065snv0s3v3z0ghadlii4w78qnhchcbx2kfdrvm8fk8gb4pkx1ya"; + }; + } + { + goPackagePath = "github.com/containerd/continuity"; + fetch = { + type = "git"; + url = "https://github.com/containerd/continuity"; + rev = "c7c5070e6f6e090ab93b0a61eb921f2196fc3383"; + sha256 = "0xyf9w4xn501jspl4r6ml84am90bfgljnjlbd4i1pxkm372qzvzf"; + }; + } + { + goPackagePath = "github.com/containerd/cri"; + fetch = { + type = "git"; + url = "https://github.com/containerd/cri"; + rev = "f3687c59470b76ee57c90d4b3dd92888dec58c2b"; + sha256 = "00lasx5yylmgsj1f9znl3xyxm2bngj4xfj69vcwb4qzdy0vclc7w"; + }; + } + { + goPackagePath = "github.com/containerd/fifo"; + fetch = { + type = "git"; + url = "https://github.com/containerd/fifo"; + rev = "3d5202aec260678c48179c56f40e6f38a095738c"; + sha256 = "11jp12vgfj0xg9m2w5cfay72fwrxb6w8za7rkcqw8yy8hypiqqxq"; + }; + } + { + goPackagePath = "github.com/containerd/typeurl"; + fetch = { + type = "git"; + url = "https://github.com/containerd/typeurl"; + rev = "a93fcdb778cd272c6e9b3028b2f42d813e785d40"; + sha256 = "0aqnf5rzc5pldln0czhxlr0fqaf5553ab7wzsq85p90lg1ryqnd6"; + }; + } + { + goPackagePath = "github.com/coreos/etcd"; + fetch = { + type = "git"; + url = "https://github.com/coreos/etcd"; + rev = "c9504f61fc7f29b0ad30bf8bab02d9e1b600e962"; + sha256 = "1ap8zhfz6pcn2ipn27s84ihpyrvpjrb48mpy4n5pr6khrni83p1a"; + }; + } + { + goPackagePath = "github.com/coreos/go-semver"; + fetch = { + type = "git"; + url = "https://github.com/coreos/go-semver"; + rev = "8ab6407b697782a06568d4b7f1db25550ec2e4c6"; + sha256 = "1gghi5bnqj50hfxhqc1cxmynqmh2yk9ii7ab9gsm75y5cp94ymk0"; + }; + } + { + goPackagePath = "github.com/coreos/go-systemd"; + fetch = { + type = "git"; + url = "https://github.com/coreos/go-systemd"; + rev = "40e2722dffead74698ca12a750f64ef313ddce05"; + sha256 = "0kq7aa0pbn8gv9ny2a1gfx3ybsqyryfwz9gv7fck6zfc8xxbl1fa"; + }; + } + { + goPackagePath = "github.com/coreos/pkg"; + fetch = { + type = "git"; + url = "https://github.com/coreos/pkg"; + rev = "97fdf19511ea361ae1c100dd393cc47f8dcfa1e1"; + sha256 = "1srn87wih25l09f75483hnxsr8fc6rq3bk7w1x8125ym39p6mg21"; + }; + } + { + goPackagePath = "github.com/davecgh/go-spew"; + fetch = { + type = "git"; + url = "https://github.com/davecgh/go-spew"; + rev = "346938d642f2ec3594ed81d874461961cd0faa76"; + sha256 = "0d4jfmak5p6lb7n2r6yvf5p1zcw0l8j74kn55ghvr7zr7b7axm6c"; + }; + } + { + goPackagePath = "github.com/docker/distribution"; + fetch = { + type = "git"; + url = "https://github.com/docker/distribution"; + rev = "83389a148052d74ac602f5f1d62f86ff2f3c4aa5"; + sha256 = "0ypps7340k1g1njcdbn83c9233hrki0mxyj66av1i55ji378ayyn"; + }; + } + { + goPackagePath = "github.com/docker/docker"; + fetch = { + type = "git"; + url = "https://github.com/docker/docker"; + rev = "092cba3727bb9b4a2f0e922cd6c0f93ea270e363"; + sha256 = "0l9kjibnpwcgk844sibxk9ppyqniw9r0np1mzp95f8f461jb0iar"; + }; + } + { + goPackagePath = "github.com/docker/go-connections"; + fetch = { + type = "git"; + url = "https://github.com/docker/go-connections"; + rev = "3ede32e2033de7505e6500d6c868c2b9ed9f169d"; + sha256 = "0v1pkr8apwmhyzbjfriwdrs1ihlk6pw7izm57r24mf9jdmg3fyb0"; + }; + } + { + goPackagePath = "github.com/docker/go-events"; + fetch = { + type = "git"; + url = "https://github.com/docker/go-events"; + rev = "9461782956ad83b30282bf90e31fa6a70c255ba9"; + sha256 = "0vn0kd0w253jwdk86gv1h6s8p6bzxiyif74xdzlb39zr6fdrr145"; + }; + } + { + goPackagePath = "github.com/docker/go-units"; + fetch = { + type = "git"; + url = "https://github.com/docker/go-units"; + rev = "47565b4f722fb6ceae66b95f853feed578a4a51c"; + sha256 = "0npxsb3pp89slwf4a73fxm20hykad8xggij6i6hcd5jy19bjrd93"; + }; + } + { + goPackagePath = "github.com/docker/spdystream"; + fetch = { + type = "git"; + url = "https://github.com/docker/spdystream"; + rev = "bc6354cbbc295e925e4c611ffe90c1f287ee54db"; + sha256 = "08746a15snvmax6cnzn2qy7cvsspxbsx97vdbjpdadir3pypjxya"; + }; + } + { + goPackagePath = "github.com/dsnet/compress"; + fetch = { + type = "git"; + url = "https://github.com/dsnet/compress"; + rev = "cc9eb1d7ad760af14e8f918698f745e80377af4f"; + sha256 = "159liclywmyb6zx88ga5gn42hfl4cpk1660zss87fkx31hdq9fgx"; + }; + } + { + goPackagePath = "github.com/dustin/go-humanize"; + fetch = { + type = "git"; + url = "https://github.com/dustin/go-humanize"; + rev = "9f541cc9db5d55bce703bd99987c9d5cb8eea45e"; + sha256 = "1kqf1kavdyvjk7f8kx62pnm7fbypn9z1vbf8v2qdh3y7z7a0cbl3"; + }; + } + { + goPackagePath = "github.com/elazarl/go-bindata-assetfs"; + fetch = { + type = "git"; + url = "https://github.com/elazarl/go-bindata-assetfs"; + rev = "30f82fa23fd844bd5bb1e5f216db87fd77b5eb43"; + sha256 = "1swfb37g6sga3awvcmxf49ngbpvjv7ih5an9f8ixjqcfcwnb7nzp"; + }; + } + { + goPackagePath = "github.com/emicklei/go-restful"; + fetch = { + type = "git"; + url = "https://github.com/emicklei/go-restful"; + rev = "3658237ded108b4134956c1b3050349d93e7b895"; + sha256 = "07sm3b5dlrqld4r8r1w79s37y41fk4zmw4afhi2ragjy1iarqck3"; + }; + } + { + goPackagePath = "github.com/emicklei/go-restful-swagger12"; + fetch = { + type = "git"; + url = "https://github.com/emicklei/go-restful-swagger12"; + rev = "dcef7f55730566d41eae5db10e7d6981829720f6"; + sha256 = "0zz1f6n1qfbyrp592mgyrkyfhki3r0ksic6ja9lxisg8br1ibrvq"; + }; + } + { + goPackagePath = "github.com/evanphx/json-patch"; + fetch = { + type = "git"; + url = "https://github.com/evanphx/json-patch"; + rev = "afac545df32f2287a079e2dfb7ba2745a643747e"; + sha256 = "1d90prf8wfvndqjn6nr0k405ykia5vb70sjw4ywd49s9p3wcdyn8"; + }; + } + { + goPackagePath = "github.com/fatih/color"; + fetch = { + type = "git"; + url = "https://github.com/fatih/color"; + rev = "5b77d2a35fb0ede96d138fc9a99f5c9b6aef11b4"; + sha256 = "0v8msvg38r8d1iiq2i5r4xyfx0invhc941kjrsg5gzwvagv55inv"; + }; + } + { + goPackagePath = "github.com/fsnotify/fsnotify"; + fetch = { + type = "git"; + url = "https://github.com/fsnotify/fsnotify"; + rev = "c2828203cd70a50dcccfb2761f8b1f8ceef9a8e9"; + sha256 = "07va9crci0ijlivbb7q57d2rz9h27zgn2fsm60spjsqpdbvyrx4g"; + }; + } + { + goPackagePath = "github.com/ghodss/yaml"; + fetch = { + type = "git"; + url = "https://github.com/ghodss/yaml"; + rev = "0ca9ea5df5451ffdf184b4428c902747c2c11cd7"; + sha256 = "0skwmimpy7hlh7pva2slpcplnm912rp3igs98xnqmn859kwa5v8g"; + }; + } + { + goPackagePath = "github.com/go-ini/ini"; + fetch = { + type = "git"; + url = "https://github.com/go-ini/ini"; + rev = "06f5f3d67269ccec1fe5fe4134ba6e982984f7f5"; + sha256 = "0fx123601aiqqn0yr9vj6qp1bh8gp240w4qdm76irs73q8dxlk7a"; + }; + } + { + goPackagePath = "github.com/go-ole/go-ole"; + fetch = { + type = "git"; + url = "https://github.com/go-ole/go-ole"; + rev = "a41e3c4b706f6ae8dfbff342b06e40fa4d2d0506"; + sha256 = "114h8x7dh4jp7w7k678fm98lr9icavsf74v6jfipyq7q35bsfr1p"; + }; + } + { + goPackagePath = "github.com/go-openapi/jsonpointer"; + fetch = { + type = "git"; + url = "https://github.com/go-openapi/jsonpointer"; + rev = "3a0015ad55fa9873f41605d3e8f28cd279c32ab2"; + sha256 = "02an755ashhckqwxyq2avgn8mm4qq3hxda2jsj1a3bix2gkb45v7"; + }; + } + { + goPackagePath = "github.com/go-openapi/jsonreference"; + fetch = { + type = "git"; + url = "https://github.com/go-openapi/jsonreference"; + rev = "3fb327e6747da3043567ee86abd02bb6376b6be2"; + sha256 = "0zwsrmqqcihm0lj2pc18cpm7wnn1dzwr4kvrlyrxf0lnn7dsdsbm"; + }; + } + { + goPackagePath = "github.com/go-openapi/spec"; + fetch = { + type = "git"; + url = "https://github.com/go-openapi/spec"; + rev = "bcff419492eeeb01f76e77d2ebc714dc97b607f5"; + sha256 = "00z8sv766kjdrdvpyzm9c5x3d45gssbwsm77qihmkflric6a3d3l"; + }; + } + { + goPackagePath = "github.com/go-openapi/swag"; + fetch = { + type = "git"; + url = "https://github.com/go-openapi/swag"; + rev = "811b1089cde9dad18d4d0c2d09fbdbf28dbd27a5"; + sha256 = "0hkbrq4jq9s4nrz7xpx03z1zljss1zdylm3zb76hhjpp0s7hz418"; + }; + } + { + goPackagePath = "github.com/godbus/dbus"; + fetch = { + type = "git"; + url = "https://github.com/godbus/dbus"; + rev = "a389bdde4dd695d414e47b755e95e72b7826432c"; + sha256 = "1ckvg15zdsgmbn4mi36cazkb407ixc9mmyf7vwj8b8wi3d00rgn9"; + }; + } + { + goPackagePath = "github.com/gogo/googleapis"; + fetch = { + type = "git"; + url = "https://github.com/gogo/googleapis"; + rev = "08a7655d27152912db7aaf4f983275eaf8d128ef"; + sha256 = "0mzjclx31hkdgad0xjdihz23qphrsljkvzx5gnwn96m7agx6vkvr"; + }; + } + { + goPackagePath = "github.com/gogo/protobuf"; + fetch = { + type = "git"; + url = "https://github.com/gogo/protobuf"; + rev = "1adfc126b41513cc696b209667c8656ea7aac67c"; + sha256 = "1j7azzlnihcvnd1apw5zr0bz30h7n0gyimqqkgc76vzb1n5dpi7m"; + }; + } + { + goPackagePath = "github.com/golang/glog"; + fetch = { + type = "git"; + url = "https://github.com/golang/glog"; + rev = "23def4e6c14b4da8ac2ed8007337bc5eb5007998"; + sha256 = "0jb2834rw5sykfr937fxi8hxi2zy80sj2bdn9b3jb4b26ksqng30"; + }; + } + { + goPackagePath = "github.com/golang/groupcache"; + fetch = { + type = "git"; + url = "https://github.com/golang/groupcache"; + rev = "24b0969c4cb722950103eed87108c8d291a8df00"; + sha256 = "0rj588dxg4ncanj8vcsixi00161xq54nz7siv47d5ijmzgxs82zf"; + }; + } + { + goPackagePath = "github.com/golang/protobuf"; + fetch = { + type = "git"; + url = "https://github.com/golang/protobuf"; + rev = "b4deda0973fb4c70b50d226b1af49f3da59f5265"; + sha256 = "0ya4ha7m20bw048m1159ppqzlvda4x0vdprlbk5sdgmy74h3xcdq"; + }; + } + { + goPackagePath = "github.com/golang/snappy"; + fetch = { + type = "git"; + url = "https://github.com/golang/snappy"; + rev = "2e65f85255dbc3072edf28d6b5b8efc472979f5a"; + sha256 = "05w6mpc4qcy0pv8a2bzng8nf4s5rf5phfang4jwy9rgf808q0nxf"; + }; + } + { + goPackagePath = "github.com/google/btree"; + fetch = { + type = "git"; + url = "https://github.com/google/btree"; + rev = "4030bb1f1f0c35b30ca7009e9ebd06849dd45306"; + sha256 = "0ba430m9fbnagacp57krgidsyrgp3ycw5r7dj71brgp5r52g82p6"; + }; + } + { + goPackagePath = "github.com/google/gofuzz"; + fetch = { + type = "git"; + url = "https://github.com/google/gofuzz"; + rev = "24818f796faf91cd76ec7bddd72458fbced7a6c1"; + sha256 = "0cq90m2lgalrdfrwwyycrrmn785rgnxa3l3vp9yxkvnv88bymmlm"; + }; + } + { + goPackagePath = "github.com/googleapis/gnostic"; + fetch = { + type = "git"; + url = "https://github.com/googleapis/gnostic"; + rev = "7c663266750e7d82587642f65e60bc4083f1f84e"; + sha256 = "0yh3ckd7m0r9h50wmxxvba837d0wb1k5yd439zq4p1kpp4390z12"; + }; + } + { + goPackagePath = "github.com/gorilla/context"; + fetch = { + type = "git"; + url = "https://github.com/gorilla/context"; + rev = "08b5f424b9271eedf6f9f0ce86cb9396ed337a42"; + sha256 = "03p4hn87vcmfih0p9w663qbx9lpsf7i7j3lc7yl7n84la3yz63m4"; + }; + } + { + goPackagePath = "github.com/gorilla/mux"; + fetch = { + type = "git"; + url = "https://github.com/gorilla/mux"; + rev = "e3702bed27f0d39777b0b37b664b6280e8ef8fbf"; + sha256 = "0pvzm23hklxysspnz52mih6h1q74vfrdhjfm1l3sa9r8hhqmmld2"; + }; + } + { + goPackagePath = "github.com/gregjones/httpcache"; + fetch = { + type = "git"; + url = "https://github.com/gregjones/httpcache"; + rev = "9cad4c3443a7200dd6400aef47183728de563a38"; + sha256 = "0wjdwcwqqcx2d5y68qvhg6qyj977il5ijmnn9h9cd6wjbdy0ay6s"; + }; + } + { + goPackagePath = "github.com/hashicorp/consul"; + fetch = { + type = "git"; + url = "https://github.com/hashicorp/consul"; + rev = "fb848fc48818f58690db09d14640513aa6bf3c02"; + sha256 = "0ra38xrh6ghcnix8w6gjs33yr2ra1n5jvf8lww4csr4dgw5bh5b1"; + }; + } + { + goPackagePath = "github.com/hashicorp/go-cleanhttp"; + fetch = { + type = "git"; + url = "https://github.com/hashicorp/go-cleanhttp"; + rev = "d5fe4b57a186c716b0e00b8c301cbd9b4182694d"; + sha256 = "1m20y90syky4xr81sm3980jpil81nnpzmi6kv0vjr6p584gl1hn8"; + }; + } + { + goPackagePath = "github.com/hashicorp/go-rootcerts"; + fetch = { + type = "git"; + url = "https://github.com/hashicorp/go-rootcerts"; + rev = "6bb64b370b90e7ef1fa532be9e591a81c3493e00"; + sha256 = "1a81fcm1i0ji2iva0dcimiichgwpbcb7lx0vyaks87zj5wf04qy9"; + }; + } + { + goPackagePath = "github.com/hashicorp/golang-lru"; + fetch = { + type = "git"; + url = "https://github.com/hashicorp/golang-lru"; + rev = "0fb14efe8c47ae851c0034ed7a448854d3d34cf3"; + sha256 = "0vg4yn3088ym4sj1d34kr13lp4v5gya7r2nxshp2bz70n46fsqn2"; + }; + } + { + goPackagePath = "github.com/hashicorp/hcl"; + fetch = { + type = "git"; + url = "https://github.com/hashicorp/hcl"; + rev = "ef8a98b0bbce4a65b5aa4c368430a80ddc533168"; + sha256 = "1qalfsc31fra7hcw2lc3s20aj7al62fq3j5fn5kga3mg99b82nyr"; + }; + } + { + goPackagePath = "github.com/hashicorp/serf"; + fetch = { + type = "git"; + url = "https://github.com/hashicorp/serf"; + rev = "d6574a5bb1226678d7010325fb6c985db20ee458"; + sha256 = "1arakjvhyasrk52vhxas2ghlrby3i3wj59r7sjrkbpln2cdbqnlx"; + }; + } + { + goPackagePath = "github.com/hectane/go-acl"; + fetch = { + type = "git"; + url = "https://github.com/hectane/go-acl"; + rev = "7f56832555fc229dad908c67d65ed3ce6156b70c"; + sha256 = "17crpqmn51fqcz0j1vi4grwwiaqpvc3zhl102hn5sy7s2lmdf630"; + }; + } + { + goPackagePath = "github.com/imdario/mergo"; + fetch = { + type = "git"; + url = "https://github.com/imdario/mergo"; + rev = "9316a62528ac99aaecb4e47eadd6dc8aa6533d58"; + sha256 = "1mvgn89vp39gcpvhiq4n7nw5ipj7fk6h03jgc6fjwgvwvss213pb"; + }; + } + { + goPackagePath = "github.com/inconshreveable/mousetrap"; + fetch = { + type = "git"; + url = "https://github.com/inconshreveable/mousetrap"; + rev = "76626ae9c91c4f2a10f34cad8ce83ea42c93bb75"; + sha256 = "1mn0kg48xkd74brf48qf5hzp0bc6g8cf5a77w895rl3qnlpfw152"; + }; + } + { + goPackagePath = "github.com/jmespath/go-jmespath"; + fetch = { + type = "git"; + url = "https://github.com/jmespath/go-jmespath"; + rev = "0b12d6b5"; + sha256 = "1vv6hph8j6xgv7gwl9vvhlsaaqsm22sxxqmgmldi4v11783pc1ld"; + }; + } + { + goPackagePath = "github.com/json-iterator/go"; + fetch = { + type = "git"; + url = "https://github.com/json-iterator/go"; + rev = "1624edc4454b8682399def8740d46db5e4362ba4"; + sha256 = "11wn4hpmrs8bmpvd93wqk49jfbbgylakhi35f9k5qd7jd479ci4s"; + }; + } + { + goPackagePath = "github.com/kardianos/osext"; + fetch = { + type = "git"; + url = "https://github.com/kardianos/osext"; + rev = "ae77be60afb1dcacde03767a8c37337fad28ac14"; + sha256 = "056dkgxrqjj5r18bnc3knlpgdz5p3yvp12y4y978hnsfhwaqvbjz"; + }; + } + { + goPackagePath = "github.com/kubernetes-incubator/custom-metrics-apiserver"; + fetch = { + type = "git"; + url = "https://github.com/kubernetes-incubator/custom-metrics-apiserver"; + rev = "85ebc283a57287a8fcb3ad4b488d633cd63ef7d8"; + sha256 = "06m3xa9j46035bagv9r2ghsmdx6pr0r3lcj4hz1cx943dllj0n6v"; + }; + } + { + goPackagePath = "github.com/lxn/walk"; + fetch = { + type = "git"; + url = "https://github.com/lxn/walk"; + rev = "02935bac0ab8448d5f9bf72ebeeb7ca0d5553f9b"; + sha256 = "0m0dva6nyv6vxc188c9003g5ylxb6clmlcvqjgaibbcrxkxjw1d5"; + }; + } + { + goPackagePath = "github.com/lxn/win"; + fetch = { + type = "git"; + url = "https://github.com/lxn/win"; + rev = "7e1250ba2e7749fb9eb865da9ee93fb5a2fe73f1"; + sha256 = "1n5ksvy3va3zd0iqpl64advjscm2w9n8kxn45ahahvbrbi7zy1zw"; + }; + } + { + goPackagePath = "github.com/magiconair/properties"; + fetch = { + type = "git"; + url = "https://github.com/magiconair/properties"; + rev = "c2353362d570a7bfa228149c62842019201cfb71"; + sha256 = "1a10362wv8a8qwb818wygn2z48lgzch940hvpv81hv8gc747ajxn"; + }; + } + { + goPackagePath = "github.com/mailru/easyjson"; + fetch = { + type = "git"; + url = "https://github.com/mailru/easyjson"; + rev = "3fdea8d05856a0c8df22ed4bc71b3219245e4485"; + sha256 = "0g3crph77yhv4ipdnwqc32z4cp87ahi4ikad5kyy6q4znnxliz74"; + }; + } + { + goPackagePath = "github.com/mattn/go-colorable"; + fetch = { + type = "git"; + url = "https://github.com/mattn/go-colorable"; + rev = "167de6bfdfba052fa6b2d3664c8f5272e23c9072"; + sha256 = "1nwjmsppsjicr7anq8na6md7b1z84l9ppnlr045hhxjvbkqwalvx"; + }; + } + { + goPackagePath = "github.com/mattn/go-isatty"; + fetch = { + type = "git"; + url = "https://github.com/mattn/go-isatty"; + rev = "0360b2af4f38e8d38c7fce2a9f4e702702d73a39"; + sha256 = "06w45aqz2a6yrk25axbly2k5wmsccv8cspb94bfmz4izvw8h927n"; + }; + } + { + goPackagePath = "github.com/matttproud/golang_protobuf_extensions"; + fetch = { + type = "git"; + url = "https://github.com/matttproud/golang_protobuf_extensions"; + rev = "c12348ce28de40eed0136aa2b644d0ee0650e56c"; + sha256 = "1d0c1isd2lk9pnfq2nk0aih356j30k3h1gi2w0ixsivi5csl7jya"; + }; + } + { + goPackagePath = "github.com/mholt/archiver"; + fetch = { + type = "git"; + url = "https://github.com/mholt/archiver"; + rev = "26cf5bb32d07aa4e8d0de15f56ce516f4641d7df"; + sha256 = "1r2gcxh8gkyn1l0h7sshachg2fxz6542lbqcar9zym6n2dni30mm"; + }; + } + { + goPackagePath = "github.com/mitchellh/go-homedir"; + fetch = { + type = "git"; + url = "https://github.com/mitchellh/go-homedir"; + rev = "3864e76763d94a6df2f9960b16a20a33da9f9a66"; + sha256 = "1n8vya16l60i5jms43yb8fzdgwvqa2q926p5wkg3lbrk8pxy1nv0"; + }; + } + { + goPackagePath = "github.com/mitchellh/mapstructure"; + fetch = { + type = "git"; + url = "https://github.com/mitchellh/mapstructure"; + rev = "bb74f1db0675b241733089d5a1faa5dd8b0ef57b"; + sha256 = "1aqk9qr46bwgdc5j7n7als61xvssvyjf4qzfsvhacl4izpygqnw7"; + }; + } + { + goPackagePath = "github.com/mitchellh/reflectwalk"; + fetch = { + type = "git"; + url = "https://github.com/mitchellh/reflectwalk"; + rev = "63d60e9d0dbc60cf9164e6510889b0db6683d98c"; + sha256 = "1hpq6sjr6l1h25x68mz13q7sd52dv1mjfxbl5p7m3j7cv85khnvc"; + }; + } + { + goPackagePath = "github.com/modern-go/concurrent"; + fetch = { + type = "git"; + url = "https://github.com/modern-go/concurrent"; + rev = "bacd9c7ef1dd9b15be4a9909b8ac7a4e313eec94"; + sha256 = "0s0fxccsyb8icjmiym5k7prcqx36hvgdwl588y0491gi18k5i4zs"; + }; + } + { + goPackagePath = "github.com/modern-go/reflect2"; + fetch = { + type = "git"; + url = "https://github.com/modern-go/reflect2"; + rev = "4b7aa43c6742a2c18fdef89dd197aaae7dac7ccd"; + sha256 = "1721y3yr3dpx5dx5ashf063qczk2awy5zjir1jvp1h5hn7qz4i49"; + }; + } + { + goPackagePath = "github.com/nwaples/rardecode"; + fetch = { + type = "git"; + url = "https://github.com/nwaples/rardecode"; + rev = "e06696f847aeda6f39a8f0b7cdff193b7690aef6"; + sha256 = "1aj7l8ii7hxnn3q4wzxlx3f92b1aspck6ncyqgb4h2g228phcibw"; + }; + } + { + goPackagePath = "github.com/opencontainers/go-digest"; + fetch = { + type = "git"; + url = "https://github.com/opencontainers/go-digest"; + rev = "279bed98673dd5bef374d3b6e4b09e2af76183bf"; + sha256 = "01gc7fpn8ax429024p2fcx3yb18axwz5bjf2hqxlii1jbsgw4bh9"; + }; + } + { + goPackagePath = "github.com/opencontainers/image-spec"; + fetch = { + type = "git"; + url = "https://github.com/opencontainers/image-spec"; + rev = "d60099175f88c47cd379c4738d158884749ed235"; + sha256 = "03dvbj3dln8c55v9gp79mgmz2yi2ws3r08iyz2fk41y3i22iaw1q"; + }; + } + { + goPackagePath = "github.com/opencontainers/runc"; + fetch = { + type = "git"; + url = "https://github.com/opencontainers/runc"; + rev = "baf6536d6259209c3edfa2b22237af82942d3dfa"; + sha256 = "09fm7f1k4lvx8v3crqb0cli1x2brlz8ka7f7qa8d2sb6ln58h7w7"; + }; + } + { + goPackagePath = "github.com/opencontainers/runtime-spec"; + fetch = { + type = "git"; + url = "https://github.com/opencontainers/runtime-spec"; + rev = "d810dbc60d8c5aeeb3d054bd1132fab2121968ce"; + sha256 = "0yqya0wslhv87nlidsmrw2720y3r3jpvqc2sh28y79ciyypxbk38"; + }; + } + { + goPackagePath = "github.com/openshift/api"; + fetch = { + type = "git"; + url = "https://github.com/openshift/api"; + rev = "0d921e363e951d89f583292c60d013c318df64dc"; + sha256 = "171xac4hr665q08mp17fld2zfpp95h9mjws2wikcr0brwq878p3s"; + }; + } + { + goPackagePath = "github.com/patrickmn/go-cache"; + fetch = { + type = "git"; + url = "https://github.com/patrickmn/go-cache"; + rev = "a3647f8e31d79543b2d0f0ae2fe5c379d72cedc0"; + sha256 = "10020inkzrm931r4bixf8wqr9n39wcrb78vfyxmbvjavvw4zybgs"; + }; + } + { + goPackagePath = "github.com/pborman/uuid"; + fetch = { + type = "git"; + url = "https://github.com/pborman/uuid"; + rev = "e790cca94e6cc75c7064b1332e63811d4aae1a53"; + sha256 = "0y1crv4wkly2naki2f68ln9sc8l9skswkc696vr8vc43p4p67wam"; + }; + } + { + goPackagePath = "github.com/pelletier/go-toml"; + fetch = { + type = "git"; + url = "https://github.com/pelletier/go-toml"; + rev = "c01d1270ff3e442a8a57cddc1c92dc1138598194"; + sha256 = "1fjzpcjng60mc3a4b2ql5a00d5gah84wj740dabv9kq67mpg8fxy"; + }; + } + { + goPackagePath = "github.com/petar/GoLLRB"; + fetch = { + type = "git"; + url = "https://github.com/petar/GoLLRB"; + rev = "53be0d36a84c2a886ca057d34b6aa4468df9ccb4"; + sha256 = "01xp3lcamqkvl91jg6ly202gdsgf64j39rkrcqxi6v4pbrcv7hz0"; + }; + } + { + goPackagePath = "github.com/peterbourgon/diskv"; + fetch = { + type = "git"; + url = "https://github.com/peterbourgon/diskv"; + rev = "5f041e8faa004a95c88a202771f4cc3e991971e6"; + sha256 = "1mxpa5aad08x30qcbffzk80g9540wvbca4blc1r2qyzl65b8929b"; + }; + } + { + goPackagePath = "github.com/philhofer/fwd"; + fetch = { + type = "git"; + url = "https://github.com/philhofer/fwd"; + rev = "bb6d471dc95d4fe11e432687f8b70ff496cf3136"; + sha256 = "1pg84khadh79v42y8sjsdgfb54vw2kzv7hpapxkifgj0yvcp30g2"; + }; + } + { + goPackagePath = "github.com/pierrec/lz4"; + fetch = { + type = "git"; + url = "https://github.com/pierrec/lz4"; + rev = "1958fd8fff7f115e79725b1288e0b878b3e06b00"; + sha256 = "1c4xi40bvcp91a3lw9nw1hylvdmb51hviwrqv5f6zj1sswkv24ps"; + }; + } + { + goPackagePath = "github.com/pkg/errors"; + fetch = { + type = "git"; + url = "https://github.com/pkg/errors"; + rev = "645ef00459ed84a119197bfb8d8205042c6df63d"; + sha256 = "001i6n71ghp2l6kdl3qq1v2vmghcz3kicv9a5wgcihrzigm75pp5"; + }; + } + { + goPackagePath = "github.com/pmezard/go-difflib"; + fetch = { + type = "git"; + url = "https://github.com/pmezard/go-difflib"; + rev = "792786c7400a136282c1664665ae0a8db921c6c2"; + sha256 = "0c1cn55m4rypmscgf0rrb88pn58j3ysvc2d0432dp3c6fqg6cnzw"; + }; + } + { + goPackagePath = "github.com/prometheus/client_golang"; + fetch = { + type = "git"; + url = "https://github.com/prometheus/client_golang"; + rev = "c5b7fccd204277076155f10851dad72b76a49317"; + sha256 = "1xqny3147g12n4j03kxm8s9mvdbs3ln6i56c655mybrn9jjy48kd"; + }; + } + { + goPackagePath = "github.com/prometheus/client_model"; + fetch = { + type = "git"; + url = "https://github.com/prometheus/client_model"; + rev = "99fa1f4be8e564e8a6b613da7fa6f46c9edafc6c"; + sha256 = "19y4ywsivhpxj7ikf2j0gm9k3cmyw37qcbfi78n526jxcc7kw998"; + }; + } + { + goPackagePath = "github.com/prometheus/common"; + fetch = { + type = "git"; + url = "https://github.com/prometheus/common"; + rev = "89d80287644767070914e30199b4d959e491bd3d"; + sha256 = "0nvbjr8nhkyakgjariskl3bvyb18723dzjmmxph6ppf4khi50j0w"; + }; + } + { + goPackagePath = "github.com/prometheus/procfs"; + fetch = { + type = "git"; + url = "https://github.com/prometheus/procfs"; + rev = "7d6f385de8bea29190f15ba9931442a0eaef9af7"; + sha256 = "18cish8yas5r6xhgp8p8n7lg4wh3d4szzirszxra8m7rwy3swxxq"; + }; + } + { + goPackagePath = "github.com/samuel/go-zookeeper"; + fetch = { + type = "git"; + url = "https://github.com/samuel/go-zookeeper"; + rev = "c4fab1ac1bec58281ad0667dc3f0907a9476ac47"; + sha256 = "0i7mxg9hz8ymglq2xcwwswy1pvcr53qd57lzcdlf3d5bjki73a4w"; + }; + } + { + goPackagePath = "github.com/sbinet/go-python"; + fetch = { + type = "git"; + url = "https://github.com/sbinet/go-python"; + rev = "f976f61134dc6f5b4920941eb1b0e7cec7e4ef4c"; + sha256 = "15l7wip7kr1z6v3315m9y0070wmwq447q7gwz6490xwnclrq85kl"; + }; + } + { + goPackagePath = "github.com/shirou/gopsutil"; + fetch = { + type = "git"; + url = "https://github.com/shirou/gopsutil"; + rev = "ccc1c1016bc5d10e803189ee43417c50cdde7f1b"; + sha256 = "0dk7644fc86n0974a00m2w5nbhzcgs1jjnillic90044w7rycg66"; + }; + } + { + goPackagePath = "github.com/shirou/w32"; + fetch = { + type = "git"; + url = "https://github.com/shirou/w32"; + rev = "bb4de0191aa41b5507caa14b0650cdbddcd9280b"; + sha256 = "0xh5vqblhr2c3mlaswawx6nipi4rc2x73rbdvlkakmgi0nnl50m4"; + }; + } + { + goPackagePath = "github.com/sirupsen/logrus"; + fetch = { + type = "git"; + url = "https://github.com/sirupsen/logrus"; + rev = "3e01752db0189b9157070a0e1668a620f9a85da2"; + sha256 = "029irw2lsbqi944gdrbkwdw0m2794sqni4g21gsnmz142hbzds8c"; + }; + } + { + goPackagePath = "github.com/spf13/afero"; + fetch = { + type = "git"; + url = "https://github.com/spf13/afero"; + rev = "787d034dfe70e44075ccc060d346146ef53270ad"; + sha256 = "0138rjiacl71h7kvhzinviwvy6qa2m6rflpv9lgqv15hnjvhwvg1"; + }; + } + { + goPackagePath = "github.com/spf13/cast"; + fetch = { + type = "git"; + url = "https://github.com/DataDog/cast"; + rev = "1ee8c8bd14a3d768a7ff681617ed56bc6c204940"; + sha256 = "0sgqmhicy672250cxgqd8zlni3qlj57r8liyiaq15g9spyhflhl0"; + }; + } + { + goPackagePath = "github.com/spf13/cobra"; + fetch = { + type = "git"; + url = "https://github.com/spf13/cobra"; + rev = "ef82de70bb3f60c65fb8eebacbb2d122ef517385"; + sha256 = "1q1nsx05svyv9fv3fy6xv6gs9ffimkyzsfm49flvl3wnvf1ncrkd"; + }; + } + { + goPackagePath = "github.com/spf13/jwalterweatherman"; + fetch = { + type = "git"; + url = "https://github.com/spf13/jwalterweatherman"; + rev = "7c0cea34c8ece3fbeb2b27ab9b59511d360fb394"; + sha256 = "132p84i20b9s5r6fs597lsa6648vd415ch7c0d018vm8smzqpd0h"; + }; + } + { + goPackagePath = "github.com/spf13/pflag"; + fetch = { + type = "git"; + url = "https://github.com/spf13/pflag"; + rev = "583c0c0531f06d5278b7d917446061adc344b5cd"; + sha256 = "0nr4mdpfhhk94hq4ymn5b2sxc47b29p1akxd8b0hx4dvdybmipb5"; + }; + } + { + goPackagePath = "github.com/stretchr/objx"; + fetch = { + type = "git"; + url = "https://github.com/stretchr/objx"; + rev = "477a77ecc69700c7cdeb1fa9e129548e1c1c393c"; + sha256 = "0iph0qmpyqg4kwv8jsx6a56a7hhqq8swrazv40ycxk9rzr0s8yls"; + }; + } + { + goPackagePath = "github.com/stretchr/testify"; + fetch = { + type = "git"; + url = "https://github.com/stretchr/testify"; + rev = "f35b8ab0b5a2cef36673838d662e249dd9c94686"; + sha256 = "0dlszlshlxbmmfxj5hlwgv3r22x0y1af45gn1vd198nvvs3pnvfs"; + }; + } + { + goPackagePath = "github.com/syndtr/gocapability"; + fetch = { + type = "git"; + url = "https://github.com/syndtr/gocapability"; + rev = "33e07d32887e1e06b7c025f27ce52f62c7990bc0"; + sha256 = "1x88c0b320b13w7samicf19dqx9rr4dnrh3yglk3cba21nwsp57i"; + }; + } + { + goPackagePath = "github.com/tinylib/msgp"; + fetch = { + type = "git"; + url = "https://github.com/tinylib/msgp"; + rev = "af6442a0fcf6e2a1b824f70dd0c734f01e817751"; + sha256 = "08ha23sn14071ywrgxlyj7r523vzdwx1i83dcp1mqa830glgqaff"; + }; + } + { + goPackagePath = "github.com/ugorji/go"; + fetch = { + type = "git"; + url = "https://github.com/ugorji/go"; + rev = "8c0409fcbb70099c748d71f714529204975f6c3f"; + sha256 = "0z61j0cniq3n5af0q57dbpyfmidihzimrwnysfphfzwyd0ic4rcv"; + }; + } + { + goPackagePath = "github.com/ulikunitz/xz"; + fetch = { + type = "git"; + url = "https://github.com/ulikunitz/xz"; + rev = "0c6b41e72360850ca4f98dc341fd999726ea007f"; + sha256 = "0a6l7sp67ipxim093qh6fvw8knbxj24l7bj5lykcddi5gwfi78n3"; + }; + } + { + goPackagePath = "github.com/urfave/negroni"; + fetch = { + type = "git"; + url = "https://github.com/urfave/negroni"; + rev = "5dbbc83f748fc3ad38585842b0aedab546d0ea1e"; + sha256 = "10w4ygc78hgsryxwmjmz8w51d84bjh7jm8j0xfv4vnpz5gscc8dj"; + }; + } + { + goPackagePath = "golang.org/x/crypto"; + fetch = { + type = "git"; + url = "https://go.googlesource.com/crypto"; + rev = "a49355c7e3f8fe157a85be2f77e6e269a0f89602"; + sha256 = "020q1laxjx5kcmnqy4wmdb63zhb0lyq6wpy40axhswzg2nd21s44"; + }; + } + { + goPackagePath = "golang.org/x/mobile"; + fetch = { + type = "git"; + url = "https://go.googlesource.com/mobile"; + rev = "bceb7ef27cc623473a5b664d2a3450576dddff0f"; + sha256 = "0xky2417wm61j2p5ki3k4237fxyz8f5ds19nak0lm741s3xs2rqx"; + }; + } + { + goPackagePath = "golang.org/x/net"; + fetch = { + type = "git"; + url = "https://go.googlesource.com/net"; + rev = "97aa3a539ec716117a9d15a4659a911f50d13c3c"; + sha256 = "1738bi8l50f0iq0il6h4qy1cgy39yh3q4gh1lwp5y5j7jyy33ccd"; + }; + } + { + goPackagePath = "golang.org/x/sync"; + fetch = { + type = "git"; + url = "https://go.googlesource.com/sync"; + rev = "1d60e4601c6fd243af51cc01ddf169918a5407ca"; + sha256 = "046jlanz2lkxq1r57x9bl6s4cvfqaic6p2xybsj8mq1120jv4rs6"; + }; + } + { + goPackagePath = "golang.org/x/sys"; + fetch = { + type = "git"; + url = "https://go.googlesource.com/sys"; + rev = "7138fd3d9dc8335c567ca206f4333fb75eb05d56"; + sha256 = "09xgxk0d9b88m18sriy4f2l6qavicznxkgsbvjyv56x24r4kmiq0"; + }; + } + { + goPackagePath = "golang.org/x/text"; + fetch = { + type = "git"; + url = "https://go.googlesource.com/text"; + rev = "f21a4dfb5e38f5895301dc265a8def02365cc3d0"; + sha256 = "0r6x6zjzhr8ksqlpiwm5gdd7s209kwk5p4lw54xjvz10cs3qlq19"; + }; + } + { + goPackagePath = "golang.org/x/time"; + fetch = { + type = "git"; + url = "https://go.googlesource.com/time"; + rev = "fbb02b2291d28baffd63558aa44b4b56f178d650"; + sha256 = "0jjqcv6rzihlgg4i797q80g1f6ch5diz2kxqh6488gwkb6nds4h4"; + }; + } + { + goPackagePath = "google.golang.org/genproto"; + fetch = { + type = "git"; + url = "https://github.com/google/go-genproto"; + rev = "ff3583edef7de132f219f0efc00e097cabcc0ec0"; + sha256 = "0bpzxk85fgvznmdf9356nzh8riqhwzcil9r2a955rbfn27lh4lmy"; + }; + } + { + goPackagePath = "google.golang.org/grpc"; + fetch = { + type = "git"; + url = "https://github.com/grpc/grpc-go"; + rev = "168a6198bcb0ef175f7dacec0b8691fc141dc9b8"; + sha256 = "0d8vj372ri55mrqfc0rhjl3albp5ykwfjhda1s5cgm5n40v70pr3"; + }; + } + { + goPackagePath = "gopkg.in/Knetic/govaluate.v3"; + fetch = { + type = "git"; + url = "https://github.com/Knetic/govaluate"; + rev = "d216395917cc49052c7c7094cf57f09657ca08a8"; + sha256 = "1b0sy89hy5d1720i43ikqfcxr4v6p9g9c7rnbif8s6256a7c2rsq"; + }; + } + { + goPackagePath = "gopkg.in/inf.v0"; + fetch = { + type = "git"; + url = "https://github.com/go-inf/inf"; + rev = "d2d2541c53f18d2a059457998ce2876cc8e67cbf"; + sha256 = "00k5iqjcp371fllqxncv7jkf80hn1zww92zm78cclbcn4ybigkng"; + }; + } + { + goPackagePath = "gopkg.in/natefinch/lumberjack.v2"; + fetch = { + type = "git"; + url = "https://github.com/natefinch/lumberjack"; + rev = "a96e63847dc3c67d17befa69c303767e2f84e54f"; + sha256 = "1l3vlv72b7rfkpy1164kwd3qzrqmmjnb67akzxqp2mlvc66k6p3d"; + }; + } + { + goPackagePath = "gopkg.in/square/go-jose.v2"; + fetch = { + type = "git"; + url = "https://github.com/square/go-jose"; + rev = "ef984e69dd356202fd4e4910d4d9c24468bdf0b8"; + sha256 = "0pxyrygc9mh6yn169rm6i3shax7zmmzps22px6mq3kl87zkk9b8h"; + }; + } + { + goPackagePath = "gopkg.in/yaml.v2"; + fetch = { + type = "git"; + url = "https://github.com/go-yaml/yaml"; + rev = "d670f9405373e636a5a2765eea47fac0c9bc91a4"; + sha256 = "1w1xid51n8v1mydn2m3vgggw8qgpd5a5sr62snsc77d99fpjsrs0"; + }; + } + { + goPackagePath = "gopkg.in/zorkian/go-datadog-api.v2"; + fetch = { + type = "git"; + url = "https://github.com/zorkian/go-datadog-api"; + rev = "d7b8b10db6a7eb1c1c2424b10a795a1662e80c9a"; + sha256 = "069psfvgal6pkwc1s09gdy4mjn4ki4d1zvqnnzn7y15i5llb97kk"; + }; + } + { + goPackagePath = "k8s.io/api"; + fetch = { + type = "git"; + url = "https://github.com/kubernetes/api"; + rev = "4e7be11eab3ffcfc1876898b8272df53785a9504"; + sha256 = "0klwmkvsnim66y8mvcmkqql12fbr5cja4qgjzp36197i6i335b62"; + }; + } + { + goPackagePath = "k8s.io/apiextensions-apiserver"; + fetch = { + type = "git"; + url = "https://github.com/kubernetes/apiextensions-apiserver"; + rev = "b499623aa7a31f7c85b37017e068b21206a68e25"; + sha256 = "1c0z71f0wqkwkc5x730l9gmzibkqk6af4mg5l6ks9lk69cbpxk0a"; + }; + } + { + goPackagePath = "k8s.io/apimachinery"; + fetch = { + type = "git"; + url = "https://github.com/kubernetes/apimachinery"; + rev = "def12e63c512da17043b4f0293f52d1006603d9f"; + sha256 = "0dghch5avwcy3zx5k005hi71i9bl3603pk927xdjr5jlajzwm9xd"; + }; + } + { + goPackagePath = "k8s.io/apiserver"; + fetch = { + type = "git"; + url = "https://github.com/kubernetes/apiserver"; + rev = "d296c96c12b7d15d7fb5fea7a05fb165f8fd4014"; + sha256 = "0a413zpkm8afhh0jab8zrwvd61kvackll85kcdb6gyinw7f6qv7x"; + }; + } + { + goPackagePath = "k8s.io/client-go"; + fetch = { + type = "git"; + url = "https://github.com/kubernetes/client-go"; + rev = "f2f85107cac6fe04c30435ca0ac0c3318fd1b94c"; + sha256 = "153a3q172kmpbp6cq5005dgasdw0x36pg9xz1mfgv966k8rwws74"; + }; + } + { + goPackagePath = "k8s.io/kube-openapi"; + fetch = { + type = "git"; + url = "https://github.com/kubernetes/kube-openapi"; + rev = "b742be413d0a6f781c123bed504c8fb39264c57d"; + sha256 = "13ik6dri0f9fzs8p6987h6n3y2aqjz5cj957826xwkpv4fj2zgq8"; + }; + } + { + goPackagePath = "k8s.io/kubernetes"; + fetch = { + type = "git"; + url = "https://github.com/kubernetes/kubernetes"; + rev = "bb9ffb1654d4a729bb4cec18ff088eacc153c239"; + sha256 = "0c5xpxg7ns5irrr0ydk8n394yp3922i0m61l26qyc183phr32wxi"; + }; + } + { + goPackagePath = "k8s.io/metrics"; + fetch = { + type = "git"; + url = "https://github.com/kubernetes/metrics"; + rev = "972ef826b8401c180b89cefc7457daa2d116daa9"; + sha256 = "0ba9mfy253d4pcqdvialh2shs4d43l0q84pn3569wiib8cisbc68"; + }; + } + { + goPackagePath = "k8s.io/utils"; + fetch = { + type = "git"; + url = "https://github.com/kubernetes/utils"; + rev = "cd34563cd63c2bd7c6fe88a73c4dcf34ed8a67cb"; + sha256 = "1wpqijsvf8s4iqjrrzgbxi3gay6vaglscyq14vxma4iacg8fx1jk"; + }; + } +] diff --git a/nixpkgs/pkgs/tools/networking/dd-agent/datadog-agent.nix b/nixpkgs/pkgs/tools/networking/dd-agent/datadog-agent.nix new file mode 100644 index 000000000000..ad37245d57ca --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/dd-agent/datadog-agent.nix @@ -0,0 +1,80 @@ +{ lib, fetchFromGitHub, buildGoPackage, makeWrapper, pythonPackages, pkg-config, systemd, hostname, extraTags ? [] }: + +let + # keep this in sync with github.com/DataDog/agent-payload dependency + payloadVersion = "4.7.1"; + python = pythonPackages.python; + +in buildGoPackage rec { + pname = "datadog-agent"; + version = "6.11.2"; + owner = "DataDog"; + repo = "datadog-agent"; + + src = fetchFromGitHub { + inherit owner repo; + rev = version; + sha256 = "1dwdiaf357l9c6b2cps5mdyfma3c1mp96zzxg1826fvz3x8ix68z"; + }; + + subPackages = [ + "cmd/agent" + "cmd/cluster-agent" + "cmd/dogstatsd" + "cmd/py-launcher" + "cmd/trace-agent" + ]; + goDeps = ./datadog-agent-deps.nix; + goPackagePath = "github.com/${owner}/${repo}"; + + + nativeBuildInputs = [ pkg-config makeWrapper ]; + buildInputs = [ systemd ]; + PKG_CONFIG_PATH = "${python}/lib/pkgconfig"; + + + preBuild = let + ldFlags = lib.concatStringsSep " " [ + "-X ${goPackagePath}/pkg/version.Commit=${src.rev}" + "-X ${goPackagePath}/pkg/version.AgentVersion=${version}" + "-X ${goPackagePath}/pkg/serializer.AgentPayloadVersion=${payloadVersion}" + "-X ${goPackagePath}/pkg/collector/py.pythonHome=${python}" + "-r ${python}/lib" + ]; + in '' + buildFlagsArray=( "-tags" "ec2 systemd cpython process log secrets ${lib.concatStringsSep " " extraTags}" "-ldflags" "${ldFlags}") + ''; + + # DataDog use paths relative to the agent binary, so fix these. + postPatch = '' + sed -e "s|PyChecksPath =.*|PyChecksPath = \"$out/${python.sitePackages}\"|" \ + -e "s|distPath =.*|distPath = \"$out/share/datadog-agent\"|" \ + -i cmd/agent/common/common_nix.go + sed -e "s|/bin/hostname|${lib.getBin hostname}/bin/hostname|" \ + -i pkg/util/hostname_nix.go + ''; + + # Install the config files and python modules from the "dist" dir + # into standard paths. + postInstall = '' + mkdir -p $out/${python.sitePackages} $out/share/datadog-agent + cp -R $src/cmd/agent/dist/conf.d $out/share/datadog-agent + cp -R $src/cmd/agent/dist/{checks,utils,config.py} $out/${python.sitePackages} + + cp -R $src/pkg/status/dist/templates $out/share/datadog-agent + + wrapProgram "$out/bin/agent" \ + --set PYTHONPATH "$out/${python.sitePackages}" \ + --prefix LD_LIBRARY_PATH : ${lib.getLib systemd}/lib + ''; + + meta = with lib; { + description = '' + Event collector for the DataDog analysis service + -- v6 new golang implementation. + ''; + homepage = "https://www.datadoghq.com"; + license = licenses.bsd3; + maintainers = with maintainers; [ thoughtpolice domenkozar rvl ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/dd-agent/datadog-process-agent-deps.nix b/nixpkgs/pkgs/tools/networking/dd-agent/datadog-process-agent-deps.nix new file mode 100644 index 000000000000..4533b31dd231 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/dd-agent/datadog-process-agent-deps.nix @@ -0,0 +1,669 @@ +# file generated from Gopkg.lock using dep2nix (https://github.com/nixcloud/dep2nix) +[ + { + goPackagePath = "bitbucket.org/ww/goautoneg"; + fetch = { + type = "git"; + url = "https://github.com/adjust/goautoneg"; + rev = "d788f35a0315672bc90f50a6145d1252a230ee0d"; + sha256 = "19khhn5xhqv1yp7d6k987gh5w5rhrjnp4p0c6fyrd8z6lzz5h9qi"; + }; + } + { + goPackagePath = "github.com/DataDog/agent-payload"; + fetch = { + type = "git"; + url = "https://github.com/DataDog/agent-payload"; + rev = "f0521943f60221829c6bb5de1c7f788cd4411372"; + sha256 = "19m3kiwi0g2a0rysjabrb2nkkz7yx632g7s05mylv1x2ixparhrg"; + }; + } + { + goPackagePath = "github.com/DataDog/datadog-agent"; + fetch = { + type = "git"; + url = "https://github.com/DataDog/datadog-agent"; + rev = "d7712d570b91f4f97af9f155ad1c676921d8325d"; + sha256 = "1gi921z79la4hjhm8xhl4jz167200qljvhhsy4blj4vinkgfpm8w"; + }; + } + { + goPackagePath = "github.com/DataDog/datadog-go"; + fetch = { + type = "git"; + url = "https://github.com/DataDog/datadog-go"; + rev = "a9c7a9896c1847c9cc2b068a2ae68e9d74540a5d"; + sha256 = "1m1vpi2s22dqcq0fqhfp3skzkmsbmhzyiw2kh2dw6ii7qimy8zki"; + }; + } + { + goPackagePath = "github.com/DataDog/gopsutil"; + fetch = { + type = "git"; + url = "https://github.com/DataDog/gopsutil"; + rev = "233cd0cf42c26d835ed6f0e46f2103432a88b526"; + sha256 = "0rvxs1jjzv3j834dns28zr25bznarjmpgdy0z6gpimnq5nyicys5"; + }; + } + { + goPackagePath = "github.com/DataDog/viper"; + fetch = { + type = "git"; + url = "https://github.com/DataDog/viper"; + rev = "v1.5.0"; + sha256 = "1sv0xvmfaif7zpfwk0j6qf11hxnfdsb2zfj63b9zx7l0zzhjzh06"; + }; + } + { + goPackagePath = "github.com/DataDog/zstd"; + fetch = { + type = "git"; + url = "https://github.com/DataDog/zstd"; + rev = "2b373cbe6ac0c8e6960bbd18026ceb269eef89f5"; + sha256 = "157kh7w173igxbypknmr8hc8934ykmnb02pkb76k1jwq4sphn8qj"; + }; + } + { + goPackagePath = "github.com/Microsoft/go-winio"; + fetch = { + type = "git"; + url = "https://github.com/Microsoft/go-winio"; + rev = "97e4973ce50b2ff5f09635a57e2b88a037aae829"; + sha256 = "14y1gryr3pb3zy09v2g8dh89m363rfd9sch0wgbabh531hfx72vn"; + }; + } + { + goPackagePath = "github.com/StackExchange/wmi"; + fetch = { + type = "git"; + url = "https://github.com/StackExchange/wmi"; + rev = "5d049714c4a64225c3c79a7cf7d02f7fb5b96338"; + sha256 = "1slw6v1fl8i0hz4db9lph55pbhnrxhqyndq6vm27dgvpj22k29fk"; + }; + } + { + goPackagePath = "github.com/aws/aws-sdk-go"; + fetch = { + type = "git"; + url = "https://github.com/aws/aws-sdk-go"; + rev = "bff41fb23b7550368282029f6478819d6a99ae0f"; + sha256 = "1hcd8f3m2cq02mj9i8c1ynbh3j0iyw14l1wszm0qgs18nsj1rzgn"; + }; + } + { + goPackagePath = "github.com/beorn7/perks"; + fetch = { + type = "git"; + url = "https://github.com/beorn7/perks"; + rev = "3ac7bf7a47d159a033b107610db8a1b6575507a4"; + sha256 = "1qc3l4r818xpvrhshh1sisc5lvl9479qspcfcdbivdyh0apah83r"; + }; + } + { + goPackagePath = "github.com/cenkalti/backoff"; + fetch = { + type = "git"; + url = "https://github.com/cenkalti/backoff"; + rev = "b7325b0f3f1097c6546ea5e83c4a23267e58ad71"; + sha256 = "0vx4ggryxd9w111mf1bi2g51559r8sh99gdqah72k4dfj3vrv19d"; + }; + } + { + goPackagePath = "github.com/cihub/seelog"; + fetch = { + type = "git"; + url = "https://github.com/cihub/seelog"; + rev = "d2c6e5aa9fbfdd1c624e140287063c7730654115"; + sha256 = "0ab9kyrh51x1x71z37pwjsla0qv11a1qv697xafyc4r5nq5hds6p"; + }; + } + { + goPackagePath = "github.com/davecgh/go-spew"; + fetch = { + type = "git"; + url = "https://github.com/davecgh/go-spew"; + rev = "8991bc29aa16c548c550c7ff78260e27b9ab7c73"; + sha256 = "0hka6hmyvp701adzag2g26cxdj47g21x6jz4sc6jjz1mn59d474y"; + }; + } + { + goPackagePath = "github.com/docker/distribution"; + fetch = { + type = "git"; + url = "https://github.com/docker/distribution"; + rev = "48294d928ced5dd9b378f7fd7c6f5da3ff3f2c89"; + sha256 = "0nj4xd72mik4pj8g065cqb0yjmgpj5ppsqf2k5ibz9f68c39c00b"; + }; + } + { + goPackagePath = "github.com/docker/docker"; + fetch = { + type = "git"; + url = "https://github.com/docker/docker"; + rev = "092cba3727bb9b4a2f0e922cd6c0f93ea270e363"; + sha256 = "0l9kjibnpwcgk844sibxk9ppyqniw9r0np1mzp95f8f461jb0iar"; + }; + } + { + goPackagePath = "github.com/docker/go-connections"; + fetch = { + type = "git"; + url = "https://github.com/docker/go-connections"; + rev = "97c2040d34dfae1d1b1275fa3a78dbdd2f41cf7e"; + sha256 = "11szydahzjz7zia3hr8kplnlxsg9papbvc2mgr1vlwrahxpdx7l7"; + }; + } + { + goPackagePath = "github.com/docker/go-units"; + fetch = { + type = "git"; + url = "https://github.com/docker/go-units"; + rev = "47565b4f722fb6ceae66b95f853feed578a4a51c"; + sha256 = "0npxsb3pp89slwf4a73fxm20hykad8xggij6i6hcd5jy19bjrd93"; + }; + } + { + goPackagePath = "github.com/emicklei/go-restful"; + fetch = { + type = "git"; + url = "https://github.com/emicklei/go-restful"; + rev = "68c9750c36bb8cb433f1b88c807b4b30df4acc40"; + sha256 = "0bc0wd5nipz1x078vpq82acyc7ip0qv1sddl451d7f7bvfms6h67"; + }; + } + { + goPackagePath = "github.com/fsnotify/fsnotify"; + fetch = { + type = "git"; + url = "https://github.com/fsnotify/fsnotify"; + rev = "ccc981bf80385c528a65fbfdd49bf2d8da22aa23"; + sha256 = "0hcrfmiyx27izac3v0ii0qq2kfjvhr9ma1i79hrl6a6y2ayagzz7"; + }; + } + { + goPackagePath = "github.com/ghodss/yaml"; + fetch = { + type = "git"; + url = "https://github.com/ghodss/yaml"; + rev = "73d445a93680fa1a78ae23a5839bad48f32ba1ee"; + sha256 = "0pg53ky4sy3sp9j4n7vgf1p3gw4nbckwqfldcmmi9rf13kjh0mr7"; + }; + } + { + goPackagePath = "github.com/go-ini/ini"; + fetch = { + type = "git"; + url = "https://github.com/go-ini/ini"; + rev = "d3de07a94d22b4a0972deb4b96d790c2c0ce8333"; + sha256 = "1lpwqhcfhaa6aighd2lpjfswbb6aw5d5bsmyr0vqaqg6g5kz0ikg"; + }; + } + { + goPackagePath = "github.com/go-ole/go-ole"; + fetch = { + type = "git"; + url = "https://github.com/go-ole/go-ole"; + rev = "7a0fa49edf48165190530c675167e2f319a05268"; + sha256 = "00v6fixm35pj8jyqbj0z3kyv7bhrqa2dr2fgmlc9xqwbf0nayssy"; + }; + } + { + goPackagePath = "github.com/gogo/protobuf"; + fetch = { + type = "git"; + url = "https://github.com/gogo/protobuf"; + rev = "d76fbc1373015ced59b43ac267f28d546b955683"; + sha256 = "051a3imx2m7gpns8cjm1gckif9z6i4ik0svc1i8j7h86800c5rg0"; + }; + } + { + goPackagePath = "github.com/golang/glog"; + fetch = { + type = "git"; + url = "https://github.com/golang/glog"; + rev = "44145f04b68cf362d9c4df2182967c2275eaefed"; + sha256 = "1k7sf6qmpgm0iw81gx2dwggf9di6lgw0n54mni7862hihwfrb5rq"; + }; + } + { + goPackagePath = "github.com/golang/protobuf"; + fetch = { + type = "git"; + url = "https://github.com/golang/protobuf"; + rev = "b4deda0973fb4c70b50d226b1af49f3da59f5265"; + sha256 = "0ya4ha7m20bw048m1159ppqzlvda4x0vdprlbk5sdgmy74h3xcdq"; + }; + } + { + goPackagePath = "github.com/google/gofuzz"; + fetch = { + type = "git"; + url = "https://github.com/google/gofuzz"; + rev = "44d81051d367757e1c7c6a5a86423ece9afcf63c"; + sha256 = "0ivq2sl2fv8x0xxrcys27c42s8yq7irgl7lp6l0im9i7ky63nk0i"; + }; + } + { + goPackagePath = "github.com/googleapis/gnostic"; + fetch = { + type = "git"; + url = "https://github.com/googleapis/gnostic"; + rev = "0c5108395e2debce0d731cf0287ddf7242066aba"; + sha256 = "0jf3cp5clli88gpjf24r6wxbkvngnc1kf59d4cgjczsn2wasvsfc"; + }; + } + { + goPackagePath = "github.com/hashicorp/golang-lru"; + fetch = { + type = "git"; + url = "https://github.com/hashicorp/golang-lru"; + rev = "a0d98a5f288019575c6d1f4bb1573fef2d1fcdc4"; + sha256 = "1z3h4aca31l3qs0inqr5l49vrlycpjm7vq1l9nh1mp0mb2ij0kmp"; + }; + } + { + goPackagePath = "github.com/hashicorp/hcl"; + fetch = { + type = "git"; + url = "https://github.com/hashicorp/hcl"; + rev = "65a6292f0157eff210d03ed1bf6c59b190b8b906"; + sha256 = "00qgmygfa4vgf9v3lpz4vp1ca1hcfcxnjqjrvp6z4jjklc8x4mqf"; + }; + } + { + goPackagePath = "github.com/hectane/go-acl"; + fetch = { + type = "git"; + url = "https://github.com/hectane/go-acl"; + rev = "7f56832555fc229dad908c67d65ed3ce6156b70c"; + sha256 = "17crpqmn51fqcz0j1vi4grwwiaqpvc3zhl102hn5sy7s2lmdf630"; + }; + } + { + goPackagePath = "github.com/howeyc/gopass"; + fetch = { + type = "git"; + url = "https://github.com/howeyc/gopass"; + rev = "bf9dde6d0d2c004a008c27aaee91170c786f6db8"; + sha256 = "1jxzyfnqi0h1fzlsvlkn10bncic803bfhslyijcxk55mgh297g45"; + }; + } + { + goPackagePath = "github.com/imdario/mergo"; + fetch = { + type = "git"; + url = "https://github.com/imdario/mergo"; + rev = "6633656539c1639d9d78127b7d47c622b5d7b6dc"; + sha256 = "1fffbq1l17i0gynmvcxypl7d9h4v81g5vlimiph5bfgf4sp4db7g"; + }; + } + { + goPackagePath = "github.com/iovisor/gobpf"; + fetch = { + type = "git"; + url = "https://github.com/iovisor/gobpf"; + rev = "98ebf56442afb10e1b43145127de3c1777ed7e95"; + sha256 = "0m2aah77b1k2yf31za975mcix5n0jijqkqmhgakip00klihx383k"; + }; + } + { + goPackagePath = "github.com/jmespath/go-jmespath"; + fetch = { + type = "git"; + url = "https://github.com/jmespath/go-jmespath"; + rev = "0b12d6b5"; + sha256 = "1vv6hph8j6xgv7gwl9vvhlsaaqsm22sxxqmgmldi4v11783pc1ld"; + }; + } + { + goPackagePath = "github.com/json-iterator/go"; + fetch = { + type = "git"; + url = "https://github.com/json-iterator/go"; + rev = "f2b4162afba35581b6d4a50d3b8f34e33c144682"; + sha256 = "0siqfghsm2lkdwinvg8x5gls3p76rq3cdm59c1r4x0b2mdfhnvcd"; + }; + } + { + goPackagePath = "github.com/kardianos/osext"; + fetch = { + type = "git"; + url = "https://github.com/kardianos/osext"; + rev = "ae77be60afb1dcacde03767a8c37337fad28ac14"; + sha256 = "056dkgxrqjj5r18bnc3knlpgdz5p3yvp12y4y978hnsfhwaqvbjz"; + }; + } + { + goPackagePath = "github.com/kubernetes-incubator/custom-metrics-apiserver"; + fetch = { + type = "git"; + url = "https://github.com/kubernetes-incubator/custom-metrics-apiserver"; + rev = "bb8bae16c5550f2aeef3151259a1b36078a0e544"; + sha256 = "1f1n4dh9w2qfs704yw8nhbv50n6f9fxy8ndir96l37lnwd2dvj8p"; + }; + } + { + goPackagePath = "github.com/magiconair/properties"; + fetch = { + type = "git"; + url = "https://github.com/magiconair/properties"; + rev = "c2353362d570a7bfa228149c62842019201cfb71"; + sha256 = "1a10362wv8a8qwb818wygn2z48lgzch940hvpv81hv8gc747ajxn"; + }; + } + { + goPackagePath = "github.com/mailru/easyjson"; + fetch = { + type = "git"; + url = "https://github.com/mailru/easyjson"; + rev = "60711f1a8329503b04e1c88535f419d0bb440bff"; + sha256 = "0234jp6134wkihdpdwq1hvzqblgl5khc1wp6dyi2h0hgh88bhdk1"; + }; + } + { + goPackagePath = "github.com/matttproud/golang_protobuf_extensions"; + fetch = { + type = "git"; + url = "https://github.com/matttproud/golang_protobuf_extensions"; + rev = "fc2b8d3a73c4867e51861bbdd5ae3c1f0869dd6a"; + sha256 = "0ajg41h6402big484drvm72wvid1af2sffw0qkzbmpy04lq68ahj"; + }; + } + { + goPackagePath = "github.com/mitchellh/mapstructure"; + fetch = { + type = "git"; + url = "https://github.com/mitchellh/mapstructure"; + rev = "fa473d140ef3c6adf42d6b391fe76707f1f243c8"; + sha256 = "0f06q4fpzg0c370cvmpsl0iq2apl5nkbz5cd3nba5x5ysmshv1lm"; + }; + } + { + goPackagePath = "github.com/modern-go/concurrent"; + fetch = { + type = "git"; + url = "https://github.com/modern-go/concurrent"; + rev = "bacd9c7ef1dd9b15be4a9909b8ac7a4e313eec94"; + sha256 = "0s0fxccsyb8icjmiym5k7prcqx36hvgdwl588y0491gi18k5i4zs"; + }; + } + { + goPackagePath = "github.com/modern-go/reflect2"; + fetch = { + type = "git"; + url = "https://github.com/modern-go/reflect2"; + rev = "4b7aa43c6742a2c18fdef89dd197aaae7dac7ccd"; + sha256 = "1721y3yr3dpx5dx5ashf063qczk2awy5zjir1jvp1h5hn7qz4i49"; + }; + } + { + goPackagePath = "github.com/patrickmn/go-cache"; + fetch = { + type = "git"; + url = "https://github.com/patrickmn/go-cache"; + rev = "a3647f8e31d79543b2d0f0ae2fe5c379d72cedc0"; + sha256 = "10020inkzrm931r4bixf8wqr9n39wcrb78vfyxmbvjavvw4zybgs"; + }; + } + { + goPackagePath = "github.com/pborman/uuid"; + fetch = { + type = "git"; + url = "https://github.com/pborman/uuid"; + rev = "ca53cad383cad2479bbba7f7a1a05797ec1386e4"; + sha256 = "0rcx669bbjkkwdlw81spnra4ffgzd4rbpywnrj3w41m9vq6mk1gn"; + }; + } + { + goPackagePath = "github.com/pelletier/go-toml"; + fetch = { + type = "git"; + url = "https://github.com/pelletier/go-toml"; + rev = "c2dbbc24a97911339e01bda0b8cabdbd8f13b602"; + sha256 = "0v1dsqnk5zmn6ir8jgxijx14s47jvijlqfz3aq435snfrgybd5rz"; + }; + } + { + goPackagePath = "github.com/pkg/errors"; + fetch = { + type = "git"; + url = "https://github.com/pkg/errors"; + rev = "816c9085562cd7ee03e7f8188a1cfd942858cded"; + sha256 = "1ws5crb7c70wdicavl6qr4g03nn6m92zd6wwp9n2ygz5c8rmxh8k"; + }; + } + { + goPackagePath = "github.com/pmezard/go-difflib"; + fetch = { + type = "git"; + url = "https://github.com/pmezard/go-difflib"; + rev = "792786c7400a136282c1664665ae0a8db921c6c2"; + sha256 = "0c1cn55m4rypmscgf0rrb88pn58j3ysvc2d0432dp3c6fqg6cnzw"; + }; + } + { + goPackagePath = "github.com/prometheus/client_golang"; + fetch = { + type = "git"; + url = "https://github.com/prometheus/client_golang"; + rev = "e7e903064f5e9eb5da98208bae10b475d4db0f8c"; + sha256 = "0mn6x6za7br81vc9s8d58ivylpx5j4xdq72n7kz3aybniif49r3i"; + }; + } + { + goPackagePath = "github.com/prometheus/client_model"; + fetch = { + type = "git"; + url = "https://github.com/prometheus/client_model"; + rev = "fa8ad6fec33561be4280a8f0514318c79d7f6cb6"; + sha256 = "11a7v1fjzhhwsl128znjcf5v7v6129xjgkdpym2lial4lac1dhm9"; + }; + } + { + goPackagePath = "github.com/prometheus/common"; + fetch = { + type = "git"; + url = "https://github.com/prometheus/common"; + rev = "13ba4ddd0caa9c28ca7b7bffe1dfa9ed8d5ef207"; + sha256 = "0i6mpcnsawi7f00rfmjfjq8llaplyzq4xrkrawlcgfd762p5hnp8"; + }; + } + { + goPackagePath = "github.com/prometheus/procfs"; + fetch = { + type = "git"; + url = "https://github.com/prometheus/procfs"; + rev = "65c1f6f8f0fc1e2185eb9863a3bc751496404259"; + sha256 = "0jfzmr8642hr04naim1maa3wklxvcxklykri2z7k4ayizc974lkq"; + }; + } + { + goPackagePath = "github.com/shirou/gopsutil"; + fetch = { + type = "git"; + url = "https://github.com/shirou/gopsutil"; + rev = "071446942108a03a13cf0717275ad3bdbcb691b4"; + sha256 = "0ai246kqsfm3xlnp4pp4d197djh6jrbjja832f355zhg3l9fqwfp"; + }; + } + { + goPackagePath = "github.com/shirou/w32"; + fetch = { + type = "git"; + url = "https://github.com/shirou/w32"; + rev = "bb4de0191aa41b5507caa14b0650cdbddcd9280b"; + sha256 = "0xh5vqblhr2c3mlaswawx6nipi4rc2x73rbdvlkakmgi0nnl50m4"; + }; + } + { + goPackagePath = "github.com/spf13/afero"; + fetch = { + type = "git"; + url = "https://github.com/spf13/afero"; + rev = "d40851caa0d747393da1ffb28f7f9d8b4eeffebd"; + sha256 = "0miv4faf5ihjfifb1zv6aia6f6ik7h1s4954kcb8n6ixzhx9ck6k"; + }; + } + { + goPackagePath = "github.com/spf13/cast"; + fetch = { + type = "git"; + url = "https://github.com/spf13/cast"; + rev = "8965335b8c7107321228e3e3702cab9832751bac"; + sha256 = "177bk7lq40jbgv9p9r80aydpaccfk8ja3a7jjhfwiwk9r1pa4rr2"; + }; + } + { + goPackagePath = "github.com/spf13/jwalterweatherman"; + fetch = { + type = "git"; + url = "https://github.com/spf13/jwalterweatherman"; + rev = "4a4406e478ca629068e7768fc33f3f044173c0a6"; + sha256 = "093fmmvavv84pv4q84hav7ph3fmrq87bvspjj899q0qsx37yvdr8"; + }; + } + { + goPackagePath = "github.com/spf13/pflag"; + fetch = { + type = "git"; + url = "https://github.com/spf13/pflag"; + rev = "583c0c0531f06d5278b7d917446061adc344b5cd"; + sha256 = "0nr4mdpfhhk94hq4ymn5b2sxc47b29p1akxd8b0hx4dvdybmipb5"; + }; + } + { + goPackagePath = "github.com/stretchr/testify"; + fetch = { + type = "git"; + url = "https://github.com/stretchr/testify"; + rev = "f35b8ab0b5a2cef36673838d662e249dd9c94686"; + sha256 = "0dlszlshlxbmmfxj5hlwgv3r22x0y1af45gn1vd198nvvs3pnvfs"; + }; + } + { + goPackagePath = "golang.org/x/crypto"; + fetch = { + type = "git"; + url = "https://go.googlesource.com/crypto"; + rev = "c10c31b5e94b6f7a0283272dc2bb27163dcea24b"; + sha256 = "1a4k61xrwmr99fib2m1rcavbaxihnsmy1bgqhff5hkcv4n7bpsl2"; + }; + } + { + goPackagePath = "golang.org/x/mobile"; + fetch = { + type = "git"; + url = "https://go.googlesource.com/mobile"; + rev = "0ff817254b04da935cce10d2d1270ccf047fbbd7"; + sha256 = "0hzsis106xh3hcydjribcar75va3ghp4hwbj9982h2msi27v54x4"; + }; + } + { + goPackagePath = "golang.org/x/net"; + fetch = { + type = "git"; + url = "https://go.googlesource.com/net"; + rev = "1c05540f6879653db88113bc4a2b70aec4bd491f"; + sha256 = "0h8yqb0vcqgllgydrf9d3rzp83w8wlr8f0nm6r1rwf2qg30pq1pd"; + }; + } + { + goPackagePath = "golang.org/x/sys"; + fetch = { + type = "git"; + url = "https://go.googlesource.com/sys"; + rev = "a9d3bda3a223baa6bba6ef412cb273f0fd163c05"; + sha256 = "1w45zc13xrjzl19s1sx74r5mg3lf2z2nm13wygcdq5r5pyjlhdz9"; + }; + } + { + goPackagePath = "golang.org/x/text"; + fetch = { + type = "git"; + url = "https://go.googlesource.com/text"; + rev = "b19bf474d317b857955b12035d2c5acb57ce8b01"; + sha256 = "0wc8csaafp0ps9jb2hdk8d6xpyw1axhk1np73h0z17x09zk3ylcr"; + }; + } + { + goPackagePath = "golang.org/x/time"; + fetch = { + type = "git"; + url = "https://go.googlesource.com/time"; + rev = "a4bde12657593d5e90d0533a3e4fd95e635124cb"; + sha256 = "07r227rrqgwkchm63dzmdyv5yplbla1vnwkn6qrr940l4psy15aw"; + }; + } + { + goPackagePath = "gopkg.in/inf.v0"; + fetch = { + type = "git"; + url = "https://github.com/go-inf/inf"; + rev = "3887ee99ecf07df5b447e9b00d9c0b2adaa9f3e4"; + sha256 = "0rf3vwyb8aqnac9x9d6ax7z5526c45a16yjm2pvkijr6qgqz8b82"; + }; + } + { + goPackagePath = "gopkg.in/yaml.v2"; + fetch = { + type = "git"; + url = "https://github.com/go-yaml/yaml"; + rev = "d670f9405373e636a5a2765eea47fac0c9bc91a4"; + sha256 = "1w1xid51n8v1mydn2m3vgggw8qgpd5a5sr62snsc77d99fpjsrs0"; + }; + } + { + goPackagePath = "gopkg.in/zorkian/go-datadog-api.v2"; + fetch = { + type = "git"; + url = "https://github.com/zorkian/go-datadog-api"; + rev = "d7b8b10db6a7eb1c1c2424b10a795a1662e80c9a"; + sha256 = "069psfvgal6pkwc1s09gdy4mjn4ki4d1zvqnnzn7y15i5llb97kk"; + }; + } + { + goPackagePath = "k8s.io/api"; + fetch = { + type = "git"; + url = "https://github.com/kubernetes/api"; + rev = "9e5ffd1f1320950b238cfce291b926411f0af722"; + sha256 = "03992x9n9b8w9rlf70wizn7iqk8cbyksxg0sdc1mm5jyzyvgksgf"; + }; + } + { + goPackagePath = "k8s.io/apimachinery"; + fetch = { + type = "git"; + url = "https://github.com/kubernetes/apimachinery"; + rev = "e386b2658ed20923da8cc9250e552f082899a1ee"; + sha256 = "0lgwpsvx0gpnrdnkqc9m96xwkifdq50l7cj9rvh03njws4rbd8jz"; + }; + } + { + goPackagePath = "k8s.io/apiserver"; + fetch = { + type = "git"; + url = "https://github.com/kubernetes/apiserver"; + rev = "2cf66d2375dce045e1e02e1d7b74a0d1e34fedb3"; + sha256 = "0x0am99n25njpbd1x20bhyadpv9w6qqjmspp1ahzpmdwjzrnsagg"; + }; + } + { + goPackagePath = "k8s.io/client-go"; + fetch = { + type = "git"; + url = "https://github.com/kubernetes/client-go"; + rev = "23781f4d6632d88e869066eaebb743857aa1ef9b"; + sha256 = "0cazbcv7j7fgjs00arx3a8f0z0ikybmv16ccy0yg0wp0nbc05r6v"; + }; + } + { + goPackagePath = "k8s.io/metrics"; + fetch = { + type = "git"; + url = "https://github.com/kubernetes/metrics"; + rev = "0d9ea2ac660031c8f2726a735dda29441f396f99"; + sha256 = "0bcsb7s4wlmrja35zvz4s10cf3w7dfn2ckjv6apxd1ykdjxnsk71"; + }; + } +] diff --git a/nixpkgs/pkgs/tools/networking/dd-agent/datadog-process-agent.nix b/nixpkgs/pkgs/tools/networking/dd-agent/datadog-process-agent.nix new file mode 100644 index 000000000000..e2c497dad405 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/dd-agent/datadog-process-agent.nix @@ -0,0 +1,24 @@ +{ lib, fetchFromGitHub, buildGoPackage }: + +buildGoPackage rec { + pname = "datadog-process-agent"; + version = "6.11.1"; + owner = "DataDog"; + repo = "datadog-process-agent"; + + src = fetchFromGitHub { + inherit owner repo; + rev = version; + sha256 = "0fc2flm0pa44mjxvn4fan0mkvg9yyg27w68xdgrnpdifj99kxxjf"; + }; + + goDeps = ./datadog-process-agent-deps.nix; + goPackagePath = "github.com/${owner}/${repo}"; + + meta = with lib; { + description = "Live process collector for the DataDog Agent v6"; + homepage = "https://www.datadoghq.com"; + license = licenses.bsd3; + maintainers = with maintainers; [ domenkozar rvl ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/dd-agent/integrations-core.nix b/nixpkgs/pkgs/tools/networking/dd-agent/integrations-core.nix new file mode 100644 index 000000000000..edf7a8faaf86 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/dd-agent/integrations-core.nix @@ -0,0 +1,91 @@ +# The declarations in this file build the Datadog agent's core +# integrations. These integrations are tracked in a separate +# repository[1] outside of the agent's primary repository and provide +# checks for various kinds of services. +# +# Not all services are relevant for all users, however. As some of +# them depend on various tools and Python packages it is nonsensical +# to build *all* integrations by default. +# +# A set of default integrations is defined and built either way. +# Additional integrations can be specified by overriding +# `extraIntegrations` in datadog-integrations-core. +# +# In practice the syntax for using this with additional integrations +# is not the most beautiful, but it works. For example to use +# datadog-agent from the top-level with the `ntp`-integration +# included, one could say: +# +# let +# integrationsWithNtp = datadog-integrations-core { +# # Extra integrations map from the integration name (as in the +# # integrations-core repository) to a function that receives the +# # Python package set and returns the required dependencies.g +# ntp = (ps: [ ps.ntplib ]); +# }; +# +# in ddAgentWithNtp = datadog-agent.overrideAttrs(_ : { +# python = integrationsWithNtp.python; +# }); +# +# The NixOS module 'datadog-agent' provides a simplified interface to +# this. Please see the module itself for more information. +# +# [1]: https://github.com/DataDog/integrations-core + +{ pkgs, python, extraIntegrations ? {} }: + +with pkgs.lib; + +let + src = pkgs.fetchFromGitHub { + owner = "DataDog"; + repo = "integrations-core"; + rev = "7e9bebbb5b79ac30c16814ecefdc8f5c63cb4ea4"; + sha256 = "0yi7dlbd0rkzzl8cag713r86f40vl87aqrj97ral58csnnj7vfzb"; + }; + version = "git-2018-09-18"; + + # Build helper to build a single datadog integration package. + buildIntegration = { pname, ... }@args: python.pkgs.buildPythonPackage (args // { + inherit src version; + name = "datadog-integration-${pname}-${version}"; + + postPatch = '' + # jailbreak install_requires + sed -i 's/==.*//' requirements.in + cp requirements.in requirements.txt + ''; + sourceRoot = "source/${args.sourceRoot or pname}"; + doCheck = false; + }); + + # Base package depended on by all other integrations. + datadog_checks_base = buildIntegration { + pname = "checks-base"; + sourceRoot = "datadog_checks_base"; + propagatedBuildInputs = with python.pkgs; [ + requests protobuf prometheus_client uuid simplejson uptime + ]; + }; + + # Default integrations that should be built: + defaultIntegrations = { + disk = (ps: [ ps.psutil ]); + mongo = (ps: [ ps.pymongo ]); + network = (ps: [ ps.psutil ]); + nginx = (ps: []); + postgres = (ps: with ps; [ pg8000_1_12 psycopg2 ]); + }; + + # All integrations (default + extra): + integrations = defaultIntegrations // extraIntegrations; + builtIntegrations = mapAttrs (pname: fdeps: buildIntegration { + inherit pname; + propagatedBuildInputs = (fdeps python.pkgs) ++ [ datadog_checks_base ]; + }) integrations; + +in builtIntegrations // { + inherit datadog_checks_base; + python = python.withPackages (_: (attrValues builtIntegrations)); +} diff --git a/nixpkgs/pkgs/tools/networking/ddclient/default.nix b/nixpkgs/pkgs/tools/networking/ddclient/default.nix new file mode 100644 index 000000000000..72daa0608a67 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/ddclient/default.nix @@ -0,0 +1,49 @@ +{ lib, fetchFromGitHub, perlPackages, iproute2, perl }: + +perlPackages.buildPerlPackage rec { + pname = "ddclient"; + version = "3.9.1"; + + src = fetchFromGitHub { + owner = "ddclient"; + repo = "ddclient"; + rev = "v${version}"; + sha256 = "0hf377g4j9r9sac75xp17nk2h58mazswz4vkg4g2gl2yyhvzq91w"; + }; + + # perl packages by default get devdoc which isn't present + outputs = [ "out" ]; + + buildInputs = with perlPackages; [ IOSocketSSL DigestSHA1 DataValidateIP JSONPP ]; + + # Use iproute2 instead of ifconfig + preConfigure = '' + touch Makefile.PL + substituteInPlace ddclient \ + --replace 'in the output of ifconfig' 'in the output of ip addr show' \ + --replace 'ifconfig -a' '${iproute2}/sbin/ip addr show' \ + --replace 'ifconfig $arg' '${iproute2}/sbin/ip addr show $arg' \ + --replace '/usr/bin/perl' '${perl}/bin/perl' # Until we get the patchShebangs fixed (issue #55786) we need to patch this manually + ''; + + installPhase = '' + runHook preInstall + + install -Dm755 ddclient $out/bin/ddclient + install -Dm644 -t $out/share/doc/ddclient COP* ChangeLog README.* RELEASENOTE + + runHook postInstall + ''; + + # there are no tests distributed with ddclient + doCheck = false; + + meta = with lib; { + description = "Client for updating dynamic DNS service entries"; + homepage = "https://ddclient.net/"; + license = licenses.gpl2Plus; + # Mostly since `iproute` is Linux only. + platforms = platforms.linux; + maintainers = with maintainers; [ SuperSandro2000 ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/dhcp/default.nix b/nixpkgs/pkgs/tools/networking/dhcp/default.nix new file mode 100644 index 000000000000..08b3543c5c04 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/dhcp/default.nix @@ -0,0 +1,90 @@ +{ stdenv, fetchurl, perl, file, nettools, iputils, iproute2, makeWrapper +, coreutils, gnused, openldap ? null +, buildPackages, lib +}: + +stdenv.mkDerivation rec { + pname = "dhcp"; + version = "4.4.2"; + + src = fetchurl { + url = "https://ftp.isc.org/isc/dhcp/${version}/${pname}-${version}.tar.gz"; + sha256 = "08a5003zdxgl41b29zjkxa92h2i40zyjgxg0npvnhpkfl5jcsz0s"; + }; + + patches = + [ + # Make sure that the hostname gets set on reboot. Without this + # patch, the hostname doesn't get set properly if the old + # hostname (i.e. before reboot) is equal to the new hostname. + ./set-hostname.patch + ]; + + nativeBuildInputs = [ perl makeWrapper ]; + + buildInputs = [ openldap ]; + + depsBuildBuild = [ buildPackages.stdenv.cc ]; + + configureFlags = [ + "--enable-failover" + "--enable-execute" + "--enable-tracing" + "--enable-delayed-ack" + "--enable-dhcpv6" + "--enable-paranoia" + "--enable-early-chroot" + "--sysconfdir=/etc" + "--localstatedir=/var" + ] ++ lib.optional stdenv.isLinux "--with-randomdev=/dev/random" + ++ lib.optionals (openldap != null) [ "--with-ldap" "--with-ldapcrypto" ]; + + NIX_CFLAGS_COMPILE = builtins.toString [ + "-Wno-error=pointer-compare" + "-Wno-error=format-truncation" + "-Wno-error=stringop-truncation" + "-Wno-error=format-overflow" + "-Wno-error=stringop-overflow=8" + ]; + + installFlags = [ "DESTDIR=\${out}" ]; + + postInstall = + '' + mv $out/$out/* $out + DIR=$out/$out + while rmdir $DIR 2>/dev/null; do + DIR="$(dirname "$DIR")" + done + + cp client/scripts/linux $out/sbin/dhclient-script + substituteInPlace $out/sbin/dhclient-script \ + --replace /sbin/ip ${iproute2}/sbin/ip + wrapProgram "$out/sbin/dhclient-script" --prefix PATH : \ + "${nettools}/bin:${nettools}/sbin:${iputils}/bin:${coreutils}/bin:${gnused}/bin" + ''; + + preConfigure = + '' + substituteInPlace configure --replace "/usr/bin/file" "${file}/bin/file" + sed -i "includes/dhcpd.h" \ + -e "s|^ *#define \+_PATH_DHCLIENT_SCRIPT.*$|#define _PATH_DHCLIENT_SCRIPT \"$out/sbin/dhclient-script\"|g" + + export AR='${stdenv.cc.bintools.bintools}/bin/${stdenv.cc.targetPrefix}ar' + ''; + + meta = with lib; { + description = "Dynamic Host Configuration Protocol (DHCP) tools"; + + longDescription = '' + ISC's Dynamic Host Configuration Protocol (DHCP) distribution + provides a freely redistributable reference implementation of + all aspects of DHCP, through a suite of DHCP tools: server, + client, and relay agent. + ''; + + homepage = "https://www.isc.org/dhcp/"; + license = licenses.isc; + platforms = platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/dhcp/set-hostname.patch b/nixpkgs/pkgs/tools/networking/dhcp/set-hostname.patch new file mode 100644 index 000000000000..7aa9d0814514 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/dhcp/set-hostname.patch @@ -0,0 +1,12 @@ +--- a/client/scripts/linux 2010-09-15 00:49:48.000000000 +0200 ++++ b/client/scripts/linux 2011-04-01 16:08:10.984372269 +0200 +@@ -133,9 +133,7 @@ + [ "$current_hostname" = '(none)' ] || + [ "$current_hostname" = 'localhost' ] || + [ "$current_hostname" = "$old_host_name" ]; then +- if [ "$new_host_name" != "$old_host_name" ]; then +- hostname "$new_host_name" +- fi ++ hostname "$new_host_name" + fi + fi diff --git a/nixpkgs/pkgs/tools/networking/dhcpcd/default.nix b/nixpkgs/pkgs/tools/networking/dhcpcd/default.nix new file mode 100644 index 000000000000..cc1bad106f75 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/dhcpcd/default.nix @@ -0,0 +1,56 @@ +{ lib, stdenv, fetchurl, fetchpatch, pkg-config, udev, runtimeShellPackage, +runtimeShell }: + +stdenv.mkDerivation rec { + # when updating this to >=7, check, see previous reverts: + # nix-build -A nixos.tests.networking.scripted.macvlan.x86_64-linux nixos/release-combined.nix + pname = "dhcpcd"; + version = "8.1.4"; + + src = fetchurl { + url = "mirror://roy/${pname}/${pname}-${version}.tar.xz"; + sha256 = "0gf1qif25wy5lffzw39pi4sshmpxz1f4a1m9sglj7am1gaix3817"; + }; + + nativeBuildInputs = [ pkg-config ]; + buildInputs = [ + udev + runtimeShellPackage # So patchShebangs finds a bash suitable for the installed scripts + ]; + + prePatch = '' + substituteInPlace hooks/dhcpcd-run-hooks.in --replace /bin/sh ${runtimeShell} + ''; + + patches = [ + (fetchpatch { + name = "?id=114870290a8d3d696bc4049c32eef3eed03d6070"; + url = "https://roy.marples.name/git/dhcpcd/commitdiff_plain/114870290a8d3d696bc4049c32eef3eed03d6070"; + sha256 = "0kzpwjh2gzvl5lvlnw6lis610p67nassk3apns68ga2pyxlky8qb"; + }) + ]; + + preConfigure = "patchShebangs ./configure"; + + configureFlags = [ + "--sysconfdir=/etc" + "--localstatedir=/var" + ]; + + makeFlags = [ "PREFIX=${placeholder "out"}" ]; + + # Hack to make installation succeed. dhcpcd will still use /var/db + # at runtime. + installFlags = [ "DBDIR=$(TMPDIR)/db" "SYSCONFDIR=${placeholder "out"}/etc" ]; + + # Check that the udev plugin got built. + postInstall = lib.optional (udev != null) "[ -e ${placeholder "out"}/lib/dhcpcd/dev/udev.so ]"; + + meta = with lib; { + description = "A client for the Dynamic Host Configuration Protocol (DHCP)"; + homepage = "https://roy.marples.name/projects/dhcpcd"; + platforms = platforms.linux; + license = licenses.bsd2; + maintainers = with maintainers; [ eelco fpletz ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/dhcpdump/default.nix b/nixpkgs/pkgs/tools/networking/dhcpdump/default.nix new file mode 100644 index 000000000000..dba08fea7956 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/dhcpdump/default.nix @@ -0,0 +1,26 @@ +{ lib, stdenv, fetchurl, libpcap, perl }: + +stdenv.mkDerivation { + name = "dhcpdump-1.8"; + + src = fetchurl { + url = "http://archive.ubuntu.com/ubuntu/pool/universe/d/dhcpdump/dhcpdump_1.8.orig.tar.gz"; + sha256 = "143iyzkqvhj4dscwqs75jvfr4wvzrs11ck3fqn5p7yv2h50vjpkd"; + }; + + buildInputs = [libpcap perl]; + + hardeningDisable = [ "fortify" ]; + + installPhase = '' + mkdir -pv $out/bin + cp dhcpdump $out/bin + ''; + + meta = with lib; { + description = "A tool for visualization of DHCP packets as recorded and output by tcpdump to analyze DHCP server responses"; + homepage = "http://www.mavetju.org/unix/dhcpdump-man.php"; + platforms = platforms.linux; + license = licenses.bsd2; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/dhcping/default.nix b/nixpkgs/pkgs/tools/networking/dhcping/default.nix new file mode 100644 index 000000000000..f1f8cd8b5e4b --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/dhcping/default.nix @@ -0,0 +1,32 @@ +{ lib, stdenv, fetchurl }: + +stdenv.mkDerivation rec { + pname = "dhcping"; + version = "1.2"; + + src = fetchurl { + sha256 = "0sk4sg3hn88n44dxikipf3ggfj3ixrp22asb7nry9p0bkfaqdvrj"; + url = "https://www.mavetju.org/download/dhcping-${version}.tar.gz"; + }; + + enableParallelBuilding = true; + + doCheck = true; + + meta = with lib; { + description = "Send DHCP request to find out if a DHCP server is running"; + longDescription = '' + dhcping sends either a DHCPREQUEST or DHCPINFORM packet to the server + and waits for an answer. Then, if a DHCPREQUEST was send, it will send + a DHCPRELEASE back to the server. + + This program should be installed setuid root or ran by root only, as it + requires the privileges to bind itself to port 68 (bootpc). Root + privileges are dropped as soon as the program has bound itself to that + port. + ''; + homepage = "http://www.mavetju.org/unix/general.php"; + license = licenses.bsd2; + platforms = platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/dibbler/default.nix b/nixpkgs/pkgs/tools/networking/dibbler/default.nix new file mode 100644 index 000000000000..1633505763c6 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/dibbler/default.nix @@ -0,0 +1,25 @@ +{ lib, stdenv, fetchurl }: + +stdenv.mkDerivation rec { + pname = "dibbler"; + version = "1.0.1"; + + src = fetchurl { + url = "http://www.klub.com.pl/dhcpv6/dibbler/${pname}-${version}.tar.gz"; + sha256 = "18bnwkvax02scjdg5z8gvrkvy1lhssfnlpsaqb5kkh30w1vri1i7"; + }; + + configureFlags = [ + "--enable-resolvconf" + ]; + + NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-D__APPLE_USE_RFC_2292=1"; + + meta = with lib; { + description = "Portable DHCPv6 implementation"; + homepage = "http://www.klub.com.pl/dhcpv6/"; + license = licenses.gpl2; + platforms = platforms.all; + maintainers = with maintainers; [ fpletz ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/dirb/default.nix b/nixpkgs/pkgs/tools/networking/dirb/default.nix new file mode 100644 index 000000000000..09f1fbc2f9f9 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/dirb/default.nix @@ -0,0 +1,40 @@ +{ fetchurl, lib, stdenv, autoreconfHook, curl }: + +let + major = "2"; + minor = "22"; +in stdenv.mkDerivation rec { + pname = "dirb"; + version = "${major}.${minor}"; + + src = fetchurl { + url = "mirror://sourceforge/dirb/${version}/dirb${major}${minor}.tar.gz"; + sha256 = "0b7wc2gvgnyp54rxf1n9arn6ymrvdb633v6b3ah138hw4gg8lx7k"; + }; + + nativeBuildInputs = [ autoreconfHook ]; + buildInputs = [ curl ]; + + unpackPhase = '' + tar -xf $src + find . -exec chmod +x "{}" ";" + export sourceRoot="dirb222" + ''; + + postPatch = '' + sed -i "s#/usr#$out#" src/dirb.c + ''; + + postInstall = '' + mkdir -p $out/share/dirb/ + cp -r wordlists/ $out/share/dirb/ + ''; + + meta = { + description = "A web content scanner"; + homepage = "http://dirb.sourceforge.net/"; + maintainers = with lib.maintainers; [ bennofs ]; + license = with lib.licenses; [ gpl2 ]; + platforms = lib.platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/djbdns/default.nix b/nixpkgs/pkgs/tools/networking/djbdns/default.nix new file mode 100644 index 000000000000..1b93d64d08f5 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/djbdns/default.nix @@ -0,0 +1,51 @@ +{ lib, stdenv, fetchurl, glibc, dns-root-data } : + +let + version = "1.05"; + + manSrc = fetchurl { + url = "http://smarden.org/pape/djb/manpages/djbdns-${version}-man-20031023.tar.gz"; + sha256 = "0sg51gjy6j1hnrra406q1qhf5kvk1m00y8qqhs6r0a699gqmh75s"; + }; + +in + +stdenv.mkDerivation { + pname = "djbdns"; + inherit version; + + src = fetchurl { + url = "https://cr.yp.to/djbdns/djbdns-${version}.tar.gz"; + sha256 = "0j3baf92vkczr5fxww7rp1b7gmczxmmgrqc8w2dy7kgk09m85k9w"; + }; + + patches = [ ./hier.patch ./fix-nix-usernamespace-build.patch ]; + + postPatch = '' + echo gcc -O2 -include ${glibc.dev}/include/errno.h > conf-cc + echo $out > conf-home + # djbdns ships with an outdated list of root servers + awk '/^.?.ROOT-SERVERS.NET/ { print $4 }' ${dns-root-data}/root.hints > dnsroots.global + sed -i "s|/etc/dnsroots.global|$out/etc/dnsroots.global|" dnscache-conf.c + ''; + + installPhase = '' + mkdir -pv $out/etc; + make setup + cd $out; + tar xzvf ${manSrc}; + for n in 1 5 8; do + mkdir -p man/man$n; + mv -iv djbdns-man/*.$n man/man$n; + done; + rm -rv djbdns-man; + ''; + + meta = with lib; { + description = "A collection of Domain Name System tools"; + longDescription = "Includes software for all the fundamental DNS operations: DNS cache: finding addresses of Internet hosts; DNS server: publishing addresses of Internet hosts; and DNS client: talking to a DNS cache."; + homepage = "https://cr.yp.to/djbdns.html"; + license = licenses.publicDomain; + maintainers = with maintainers; [ jerith666 ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/djbdns/fix-nix-usernamespace-build.patch b/nixpkgs/pkgs/tools/networking/djbdns/fix-nix-usernamespace-build.patch new file mode 100644 index 000000000000..abd9e756a21f --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/djbdns/fix-nix-usernamespace-build.patch @@ -0,0 +1,10 @@ +--- djbdns-1.05.org/chkshsgr.c 2001-02-11 21:11:45.000000000 +0000 ++++ djbdns-1.05/chkshsgr.c 2017-10-13 10:06:09.392578927 +0100 +@@ -2,6 +2,7 @@ + + int main() + { ++ return 0; + short x[4]; + + x[0] = x[1] = 0; diff --git a/nixpkgs/pkgs/tools/networking/djbdns/hier.patch b/nixpkgs/pkgs/tools/networking/djbdns/hier.patch new file mode 100644 index 000000000000..7fddd1213834 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/djbdns/hier.patch @@ -0,0 +1,15 @@ +--- a/hier.c 2016-04-19 21:22:21.992192405 -0400 ++++ b/hier.c 2016-04-19 21:22:33.160229778 -0400 +@@ -2,9 +2,9 @@ + + void hier() + { +- c("/","etc","dnsroots.global",-1,-1,0644); ++ c(auto_home,"etc","dnsroots.global",-1,-1,0644); + +- h(auto_home,-1,-1,02755); +- d(auto_home,"bin",-1,-1,02755); ++ h(auto_home,-1,-1,0755); ++ d(auto_home,"bin",-1,-1,0755); + + c(auto_home,"bin","dnscache-conf",-1,-1,0755); diff --git a/nixpkgs/pkgs/tools/networking/dnscrypt-proxy2/default.nix b/nixpkgs/pkgs/tools/networking/dnscrypt-proxy2/default.nix new file mode 100644 index 000000000000..8aedb4032608 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/dnscrypt-proxy2/default.nix @@ -0,0 +1,26 @@ +{ lib, buildGoModule, fetchFromGitHub }: + +buildGoModule rec { + pname = "dnscrypt-proxy2"; + version = "2.0.45"; + + vendorSha256 = null; + + doCheck = false; + + src = fetchFromGitHub { + owner = "DNSCrypt"; + repo = "dnscrypt-proxy"; + rev = version; + sha256 = "sha256-BvCxrFMRWPVVjK2sDlVbJKC/YK/bi4lBquIsdwOFXkw="; + }; + + meta = with lib; { + description = "A tool that provides secure DNS resolution"; + + license = licenses.isc; + homepage = "https://dnscrypt.info/"; + maintainers = with maintainers; [ atemu waynr ]; + platforms = with platforms; unix; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/dnscrypt-wrapper/default.nix b/nixpkgs/pkgs/tools/networking/dnscrypt-wrapper/default.nix new file mode 100644 index 000000000000..88d753baf5b6 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/dnscrypt-wrapper/default.nix @@ -0,0 +1,26 @@ +{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config, libsodium, libevent }: + +stdenv.mkDerivation rec { + pname = "dnscrypt-wrapper"; + version = "0.4.2"; + + src = fetchFromGitHub { + owner = "Cofyc"; + repo = "dnscrypt-wrapper"; + rev = "v${version}"; + sha256 = "055vxpcfg80b1456p6p0p236pwykknph9x3c9psg8ya3i8qqywkl"; + }; + + enableParallelBuilding = true; + + nativeBuildInputs = [ pkg-config autoreconfHook ]; + buildInputs = [ libsodium libevent ]; + + meta = with lib; { + description = "A tool for adding dnscrypt support to any name resolver"; + homepage = "https://dnscrypt.info/"; + license = licenses.isc; + maintainers = with maintainers; [ tstrobel joachifm ]; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/dnsmasq/default.nix b/nixpkgs/pkgs/tools/networking/dnsmasq/default.nix new file mode 100644 index 000000000000..131a645d838c --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/dnsmasq/default.nix @@ -0,0 +1,81 @@ +{ lib, stdenv, fetchurl, pkg-config, dbus, nettle, fetchpatch +, libidn, libnetfilter_conntrack, buildPackages }: + +with lib; +let + copts = concatStringsSep " " ([ + "-DHAVE_IDN" + "-DHAVE_DNSSEC" + ] ++ optionals stdenv.isLinux [ + "-DHAVE_DBUS" + "-DHAVE_CONNTRACK" + ]); +in +stdenv.mkDerivation rec { + pname = "dnsmasq"; + version = "2.85"; + + src = fetchurl { + url = "https://www.thekelleys.org.uk/dnsmasq/${pname}-${version}.tar.xz"; + sha256 = "sha256-rZjTgD32h+W5OAgPPSXGKP5ByHh1LQP7xhmXh/7jEvo="; + }; + + postPatch = lib.optionalString stdenv.hostPlatform.isLinux '' + sed '1i#include <linux/sockios.h>' -i src/dhcp.c + ''; + + preBuild = '' + makeFlagsArray=("COPTS=${copts}") + ''; + + makeFlags = [ + "DESTDIR=" + "BINDIR=$(out)/bin" + "MANDIR=$(out)/man" + "LOCALEDIR=$(out)/share/locale" + "PKG_CONFIG=${buildPackages.pkg-config}/bin/${buildPackages.pkg-config.targetPrefix}pkg-config" + ]; + + hardeningEnable = [ "pie" ]; + + postBuild = optionalString stdenv.isLinux '' + make -C contrib/lease-tools + ''; + + # XXX: Does the systemd service definition really belong here when our NixOS + # module can create it in Nix-land? + postInstall = '' + install -Dm644 trust-anchors.conf $out/share/dnsmasq/trust-anchors.conf + '' + optionalString stdenv.isDarwin '' + install -Dm644 contrib/MacOSX-launchd/uk.org.thekelleys.dnsmasq.plist \ + $out/Library/LaunchDaemons/uk.org.thekelleys.dnsmasq.plist + substituteInPlace $out/Library/LaunchDaemons/uk.org.thekelleys.dnsmasq.plist \ + --replace "/usr/local/sbin" "$out/bin" + '' + optionalString stdenv.isLinux '' + install -Dm644 dbus/dnsmasq.conf $out/share/dbus-1/system.d/dnsmasq.conf + install -Dm755 contrib/lease-tools/dhcp_lease_time $out/bin/dhcp_lease_time + install -Dm755 contrib/lease-tools/dhcp_release $out/bin/dhcp_release + install -Dm755 contrib/lease-tools/dhcp_release6 $out/bin/dhcp_release6 + + mkdir -p $out/share/dbus-1/system-services + cat <<END > $out/share/dbus-1/system-services/uk.org.thekelleys.dnsmasq.service + [D-BUS Service] + Name=uk.org.thekelleys.dnsmasq + Exec=$out/bin/dnsmasq -k -1 + User=root + SystemdService=dnsmasq.service + END + ''; + + nativeBuildInputs = [ pkg-config ]; + buildInputs = [ nettle libidn ] + ++ optionals stdenv.isLinux [ dbus libnetfilter_conntrack ]; + + meta = { + description = "An integrated DNS, DHCP and TFTP server for small networks"; + homepage = "https://www.thekelleys.org.uk/dnsmasq/doc.html"; + license = licenses.gpl2; + platforms = with platforms; linux ++ darwin; + maintainers = with maintainers; [ eelco fpletz globin ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/dnsperf/default.nix b/nixpkgs/pkgs/tools/networking/dnsperf/default.nix new file mode 100644 index 000000000000..bb63e05c0e14 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/dnsperf/default.nix @@ -0,0 +1,51 @@ +{ lib, stdenv, fetchurl, fetchFromGitHub, autoreconfHook, pkg-config +, openssl, ldns, libck +}: + +stdenv.mkDerivation rec { + pname = "dnsperf"; + version = "2.5.2"; + + # The same as the initial commit of the new GitHub repo (only readme changed). + src = fetchFromGitHub { + owner = "DNS-OARC"; + repo = "dnsperf"; + rev = "v${version}"; + sha256 = "0dzi28z7hnyxbibwdsalvd93czf4d5pgmvrbn6hlh52znsn40gbb"; + }; + + outputs = [ "out" "man" "doc" ]; + + nativeBuildInputs = [ autoreconfHook pkg-config ]; + + buildInputs = [ + openssl + ldns # optional for DDNS (but cheap anyway) + libck + ]; + + doCheck = true; + + # For now, keep including the old PDFs as well. + # https://github.com/DNS-OARC/dnsperf/issues/27 + postInstall = let + src-doc = fetchurl { + url = "ftp://ftp.nominum.com/pub/nominum/dnsperf/2.1.0.0/" + + "dnsperf-src-2.1.0.0-1.tar.gz"; + sha256 = "03kfc65s5a9csa5i7xjsv0psq144k8d9yw7xlny61bg1h2kg1db4"; + }; + in '' + tar xf '${src-doc}' + cp ./dnsperf-src-*/doc/*.pdf "$doc/share/doc/dnsperf/" + ''; + + meta = with lib; { + outputsToInstall = outputs; # The man pages and docs are likely useful to most. + + description = "Tools for DNS benchmaring"; + homepage = "https://github.com/DNS-OARC/dnsperf"; + license = licenses.isc; + platforms = platforms.unix; + maintainers = [ maintainers.vcunat ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/dnsproxy/default.nix b/nixpkgs/pkgs/tools/networking/dnsproxy/default.nix new file mode 100644 index 000000000000..79e9e6e64172 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/dnsproxy/default.nix @@ -0,0 +1,24 @@ +{ lib, fetchFromGitHub, buildGoModule }: + +buildGoModule rec { + pname = "dnsproxy"; + version = "0.37.5"; + + src = fetchFromGitHub { + owner = "AdguardTeam"; + repo = pname; + rev = "v${version}"; + sha256 = "sha256-j+8PA5kYHaRWbugcBjUIeos6488rw8lCOjCyz7IAcQg="; + }; + + vendorSha256 = null; + + doCheck = false; + + meta = with lib; { + description = "Simple DNS proxy with DoH, DoT, and DNSCrypt support"; + homepage = "https://github.com/AdguardTeam/dnsproxy"; + license = licenses.gpl3; + maintainers = with maintainers; [ contrun ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/dnstop/default.nix b/nixpkgs/pkgs/tools/networking/dnstop/default.nix new file mode 100644 index 000000000000..cee24f1976ff --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/dnstop/default.nix @@ -0,0 +1,23 @@ +{ lib, stdenv, fetchurl, libpcap, ncurses }: + +stdenv.mkDerivation rec { + name = "dnstop-20140915"; + + src = fetchurl { + url = "http://dns.measurement-factory.com/tools/dnstop/src/${name}.tar.gz"; + sha256 = "0yn5s2825l826506gclbcfk3lzllx9brk9rzja6yj5jv0013vc5l"; + }; + + buildInputs = [ libpcap ncurses ]; + + preInstall = '' + mkdir -p $out/share/man/man8 $out/bin + ''; + + meta = { + description = "libpcap application that displays DNS traffic on your network"; + homepage = "http://dns.measurement-factory.com/tools/dnstop"; + license = lib.licenses.bsd3; + platforms = lib.platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/dnstracer/default.nix b/nixpkgs/pkgs/tools/networking/dnstracer/default.nix new file mode 100644 index 000000000000..597592b4d7ce --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/dnstracer/default.nix @@ -0,0 +1,34 @@ +{ lib, stdenv, fetchurl, libresolv, perl }: + +stdenv.mkDerivation rec { + version = "1.10"; + pname = "dnstracer"; + + src = fetchurl { + url = "https://www.mavetju.org/download/${pname}-${version}.tar.bz2"; + sha256 = "089bmrjnmsga2n0r4xgw4bwbf41xdqsnmabjxhw8lngg2pns1kb4"; + }; + + outputs = [ "out" "man" ]; + + nativeBuildInputs = [ perl /* for pod2man */ ]; + + setOutputFlags = false; + + installPhase = '' + install -Dm755 -t $out/bin dnstracer + install -Dm755 -t $man/share/man/man8 dnstracer.8 + ''; + + buildInputs = [] ++ lib.optionals stdenv.isDarwin [ libresolv ]; + + NIX_LDFLAGS = lib.optionalString stdenv.isDarwin "-lresolv"; + + meta = with lib; { + description = "Determines where a given Domain Name Server (DNS) gets its information from, and follows the chain of DNS servers back to the servers which know the data"; + homepage = "http://www.mavetju.org/unix/general.php"; + license = licenses.bsd2; + maintainers = with maintainers; [ andir ]; + platforms = platforms.all; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/dnstwist/default.nix b/nixpkgs/pkgs/tools/networking/dnstwist/default.nix new file mode 100644 index 000000000000..e19b4dabd78b --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/dnstwist/default.nix @@ -0,0 +1,37 @@ +{ lib +, fetchFromGitHub +, python3 +}: + +python3.pkgs.buildPythonApplication rec { + pname = "dnstwist"; + version = "20201228"; + disabled = python3.pythonOlder "3.6"; + + src = fetchFromGitHub { + owner = "elceef"; + repo = pname; + rev = version; + sha256 = "0bxshi1p0va2f449v6vsm8bav5caa3r3pyknj3zf4n5rvk6say70"; + }; + + propagatedBuildInputs = with python3.pkgs; [ + dnspython + GeoIP + ppdeep + requests + tld + whois + ]; + + # Project has no tests + doCheck = false; + pythonImportsCheck = [ "dnstwist" ]; + + meta = with lib; { + description = "Domain name permutation engine for detecting homograph phishing attacks"; + homepage = "https://github.com/elceef/dnstwist"; + license = with licenses; [ gpl3Only ]; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/dnsviz/default.nix b/nixpkgs/pkgs/tools/networking/dnsviz/default.nix new file mode 100644 index 000000000000..ba31aba8d6c2 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/dnsviz/default.nix @@ -0,0 +1,51 @@ +{ lib +, buildPythonApplication +, fetchFromGitHub +, dnspython +, m2crypto +, pygraphviz +}: + +buildPythonApplication rec { + pname = "dnsviz"; + version = "0.9.3"; + + src = fetchFromGitHub { + owner = "dnsviz"; + repo = "dnsviz"; + rev = "v${version}"; + sha256 = "sha256-QsTYpNaAJiIRUrr2JYjXWOKFihENhAccvmB/DRhX1PA="; + }; + + patches = [ + # override DNSVIZ_INSTALL_PREFIX with $out + ./fix-path.patch + ]; + + propagatedBuildInputs = [ + dnspython + m2crypto + pygraphviz + ]; + + postPatch = '' + substituteInPlace dnsviz/config.py.in --replace '@out@' $out + ''; + + # Tests require network connection and /etc/resolv.conf + doCheck = false; + + pythonImportsCheck = [ "dnsviz" ]; + + meta = with lib; { + description = "Tool suite for analyzing and visualizing DNS and DNSSEC behavior"; + longDescription = '' + DNSViz is a tool suite for analysis and visualization of Domain Name System (DNS) behavior, + including its security extensions (DNSSEC). + + This tool suite powers the Web-based analysis available at https://dnsviz.net/ + ''; + license = licenses.gpl2Plus; + maintainers = with maintainers; [ jojosch ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/dnsviz/fix-path.patch b/nixpkgs/pkgs/tools/networking/dnsviz/fix-path.patch new file mode 100644 index 000000000000..7906058cd98e --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/dnsviz/fix-path.patch @@ -0,0 +1,18 @@ +diff --git a/dnsviz/config.py.in b/dnsviz/config.py.in +index 373fde2..007f0f1 100644 +--- a/dnsviz/config.py.in ++++ b/dnsviz/config.py.in +@@ -26,12 +26,7 @@ from __future__ import unicode_literals + import os + import sys + +-_prefix = '__DNSVIZ_INSTALL_PREFIX__' +-if (hasattr(sys, 'real_prefix') or hasattr(sys, 'base_prefix')) and \ +- not _prefix: +- DNSVIZ_INSTALL_PREFIX = sys.prefix +-else: +- DNSVIZ_INSTALL_PREFIX = _prefix ++DNSVIZ_INSTALL_PREFIX = "@out@" + DNSVIZ_SHARE_PATH = os.path.join(DNSVIZ_INSTALL_PREFIX, 'share', 'dnsviz') + JQUERY_PATH = __JQUERY_PATH__ + JQUERY_UI_PATH = __JQUERY_UI_PATH__ diff --git a/nixpkgs/pkgs/tools/networking/dogdns/default.nix b/nixpkgs/pkgs/tools/networking/dogdns/default.nix new file mode 100644 index 000000000000..1374e4473c07 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/dogdns/default.nix @@ -0,0 +1,38 @@ +{ lib, stdenv +, fetchFromGitHub +, rustPlatform +, pkg-config +, openssl +, Security +, installShellFiles +}: + +rustPlatform.buildRustPackage rec { + pname = "dogdns"; + version = "0.1.0"; + + src = fetchFromGitHub { + owner = "ogham"; + repo = "dog"; + rev = "v${version}"; + sha256 = "088ib0sncv0vrvnqfvxf5zc79v7pnxd2cmgp4378r6pmgax9z9zy"; + }; + + nativeBuildInputs = [ installShellFiles ] + ++ lib.optionals stdenv.isLinux [ pkg-config ]; + buildInputs = lib.optionals stdenv.isLinux [ openssl ] + ++ lib.optionals stdenv.isDarwin [ Security ]; + + cargoSha256 = "0zgzaq303zy8lymhldm6dpm5hwsxi2ph42zw5brvsdjmgm9ga0rb"; + + postInstall = '' + installShellCompletion completions/dog.{bash,fish,zsh} + ''; + + meta = with lib; { + description = "Command-line DNS client"; + homepage = "https://dns.lookup.dog"; + license = licenses.eupl12; + maintainers = with maintainers; [ bbigras ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/driftnet/default.nix b/nixpkgs/pkgs/tools/networking/driftnet/default.nix new file mode 100644 index 000000000000..042f29d3ca31 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/driftnet/default.nix @@ -0,0 +1,64 @@ +{ stdenv +, lib +, fetchFromGitHub +, fetchpatch +, autoreconfHook +, cairo +, giflib +, glib +, gtk2-x11 +, libjpeg +, libpcap +, libpng +, libwebsockets +, pkg-config +, libuv +, openssl +}: + +stdenv.mkDerivation rec { + pname = "driftnet"; + version = "1.3.0"; + + src = fetchFromGitHub { + owner = "deiv"; + repo = "driftnet"; + rev = "v${version}"; + sha256 = "0kd22aqb25kf54jjv3ml8wy8xm7lmbf0xz1wfp31m08cbzsbizib"; + }; + + # https://github.com/deiv/driftnet/pull/33 + # remove on version bump from 1.3.0 + patches = [ + (fetchpatch { + name = "fix-darwin-build"; + url = "https://github.com/deiv/driftnet/pull/33/commits/bef5f3509ab5710161e9e21ea960a997eada534f.patch"; + sha256 = "1b7p9fkgp7dxv965l7q7y632s80h3nnrkaqnak2h0hakwv0i4pvm"; + }) + ]; + + enableParallelBuilding = true; + + nativeBuildInputs = [ pkg-config autoreconfHook ]; + + buildInputs = [ + cairo + giflib + glib + gtk2-x11 + libjpeg + libpcap + libpng + libwebsockets + openssl + libuv + ]; + + meta = with lib; { + description = "Watches network traffic, and picks out and displays JPEG and GIF images for display"; + homepage = "https://github.com/deiv/driftnet"; + maintainers = with maintainers; [ offline ]; + platforms = platforms.linux ++ platforms.darwin; + license = licenses.gpl2; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/driftnet/fix-darwin-build.patch b/nixpkgs/pkgs/tools/networking/driftnet/fix-darwin-build.patch new file mode 100644 index 000000000000..d1bde0f2e605 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/driftnet/fix-darwin-build.patch @@ -0,0 +1,61 @@ +diff --git a/src/compat/compat.h b/src/compat/compat.h +index 6add422..ea80406 100644 +--- a/src/compat/compat.h ++++ b/src/compat/compat.h +@@ -17,7 +17,7 @@ + #include <config.h> + #endif + +-#ifdef __FreeBSD__ ++#if defined(__FreeBSD__) || defined(__APPLE__) + #include <sys/types.h> + #endif + +diff --git a/src/network/layer2.c b/src/network/layer2.c +index 763f0ac..2497b72 100644 +--- a/src/network/layer2.c ++++ b/src/network/layer2.c +@@ -14,7 +14,7 @@ + + #include <string.h> + +-#ifdef __FreeBSD__ ++#if defined(__FreeBSD__) || defined(__APPLE__) + #include <netinet/in_systm.h> + #include <netinet/in.h> + #else +@@ -29,7 +29,7 @@ + /* + * Freebsd and Cygwin doesn't define 'ethhdr' + */ +-#if defined(__FreeBSD__) || defined(__CYGWIN__) ++#if defined(__FreeBSD__) || defined(__CYGWIN__) || defined(__APPLE__) + + #define ETH_ALEN 6 /* Octets in one ethernet addr */ + #define ETH_P_IP 0x0800 /* Internet Protocol packet */ +diff --git a/src/network/layer3.c b/src/network/layer3.c +index 7864126..aae2041 100644 +--- a/src/network/layer3.c ++++ b/src/network/layer3.c +@@ -15,7 +15,7 @@ + #include <string.h> + #include <assert.h> + +-#ifdef __FreeBSD__ ++#if defined(__FreeBSD__) || defined(__APPLE__) + #include <netinet/in_systm.h> + #include <netinet/in.h> + #include <sys/socket.h> +diff --git a/src/pid.c b/src/pid.c +index 621834e..94e7dcc 100644 +--- a/src/pid.c ++++ b/src/pid.c +@@ -14,7 +14,7 @@ + + #include "compat/compat.h" + +-#ifdef __FreeBSD__ ++#if defined(__FreeBSD__) || defined(__APPLE__) + #include <sys/stat.h> + #endif + #include <fcntl.h> diff --git a/nixpkgs/pkgs/tools/networking/drill/default.nix b/nixpkgs/pkgs/tools/networking/drill/default.nix new file mode 100644 index 000000000000..f29a7ee705f4 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/drill/default.nix @@ -0,0 +1,33 @@ +{ lib, stdenv +, rustPlatform +, fetchFromGitHub +, pkg-config +, openssl +, Security +}: + +rustPlatform.buildRustPackage rec { + pname = "drill"; + version = "0.7.0"; + + src = fetchFromGitHub { + owner = "fcsonline"; + repo = pname; + rev = version; + sha256 = "07zz0dj0wjwrc1rmayz7s8kpcv03i0ygl4vfwsam72qd4nf6v538"; + }; + + cargoSha256 = "04gj9gaysjcm2d81ds2raak847hr8w84jgfdwqd51wi8xm32w5jf"; + + nativeBuildInputs = lib.optionals stdenv.isLinux [ pkg-config ]; + buildInputs = [ ] + ++ lib.optionals stdenv.isLinux [ openssl ] + ++ lib.optionals stdenv.isDarwin [ Security ]; + + meta = with lib; { + description = "HTTP load testing application inspired by Ansible syntax"; + homepage = "https://github.com/fcsonline/drill"; + license = licenses.gpl3; + maintainers = with maintainers; [ Br1ght0ne ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/dropbear/default.nix b/nixpkgs/pkgs/tools/networking/dropbear/default.nix new file mode 100644 index 000000000000..f922a70344c4 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/dropbear/default.nix @@ -0,0 +1,40 @@ +{ stdenv, lib, fetchurl, glibc, zlib +, enableStatic ? stdenv.hostPlatform.isStatic +, sftpPath ? "/run/current-system/sw/libexec/sftp-server" +}: + +stdenv.mkDerivation rec { + name = "dropbear-2020.81"; + + src = fetchurl { + url = "https://matt.ucc.asn.au/dropbear/releases/${name}.tar.bz2"; + sha256 = "0fy5ma4cfc2pk25mcccc67b2mf1rnb2c06ilb7ddnxbpnc85s8s8"; + }; + + dontDisableStatic = enableStatic; + + configureFlags = lib.optional enableStatic "LDFLAGS=-static"; + + CFLAGS = "-DSFTPSERVER_PATH=\\\"${sftpPath}\\\""; + + # https://www.gnu.org/software/make/manual/html_node/Libraries_002fSearch.html + preConfigure = '' + makeFlags=VPATH=`cat $NIX_CC/nix-support/orig-libc`/lib + ''; + + patches = [ + # Allow sessions to inherit the PATH from the parent dropbear. + # Otherwise they only get the usual /bin:/usr/bin kind of PATH + ./pass-path.patch + ]; + + buildInputs = [ zlib ] ++ lib.optionals enableStatic [ glibc.static zlib.static ]; + + meta = with lib; { + homepage = "https://matt.ucc.asn.au/dropbear/dropbear.html"; + description = "A small footprint implementation of the SSH 2 protocol"; + license = licenses.mit; + maintainers = with maintainers; [ abbradar ]; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/dropbear/pass-path.patch b/nixpkgs/pkgs/tools/networking/dropbear/pass-path.patch new file mode 100644 index 000000000000..2ce08b05799d --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/dropbear/pass-path.patch @@ -0,0 +1,36 @@ +diff --git a/svr-chansession.c b/svr-chansession.c +index e44299e..7ef750a 100644 +--- a/svr-chansession.c ++++ b/svr-chansession.c +@@ -893,6 +893,8 @@ static void addchildpid(struct ChanSess *chansess, pid_t pid) { + static void execchild(void *user_data) { + struct ChanSess *chansess = user_data; + char *usershell = NULL; ++ const char *path = DEFAULT_PATH; ++ const char *ldpath = NULL; + + /* with uClinux we'll have vfork()ed, so don't want to overwrite the + * hostkey. can't think of a workaround to clear it */ +@@ -905,6 +907,10 @@ static void execchild(void *user_data) { + seedrandom(); + #endif + ++ if (getenv("PATH")) ++ path = getenv("PATH"); ++ ldpath = getenv("LD_LIBRARY_PATH"); ++ + /* clear environment */ + /* if we're debugging using valgrind etc, we need to keep the LD_PRELOAD + * etc. This is hazardous, so should only be used for debugging. */ +@@ -948,7 +954,10 @@ static void execchild(void *user_data) { + addnewvar("LOGNAME", ses.authstate.pw_name); + addnewvar("HOME", ses.authstate.pw_dir); + addnewvar("SHELL", get_user_shell()); +- addnewvar("PATH", DEFAULT_PATH); ++ addnewvar("PATH", path); ++ if (ldpath != NULL) { ++ addnewvar("LD_LIBRARY_PATH", ldpath); ++ } + if (chansess->term != NULL) { + addnewvar("TERM", chansess->term); + } diff --git a/nixpkgs/pkgs/tools/networking/dsniff/default.nix b/nixpkgs/pkgs/tools/networking/dsniff/default.nix new file mode 100644 index 000000000000..8e641ec83e73 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/dsniff/default.nix @@ -0,0 +1,89 @@ +{ gcc9Stdenv, lib, fetchFromGitLab, autoreconfHook, libpcap, db, glib, libnet, libnids, symlinkJoin, openssl +, rpcsvc-proto, libtirpc, libnsl +}: + +# We compile with GCC 9 since GCC 10 segfaults on the code +# (see https://bugzilla.redhat.com/show_bug.cgi?id=1862809). + +let + /* + dsniff's build system unconditionnaly wants static libraries and does not + support multi output derivations. We do some overriding to give it + satisfaction. + */ + staticdb = symlinkJoin { + inherit (db) name; + paths = with db.overrideAttrs(old: { dontDisableStatic = true; }); [ out dev ]; + postBuild = '' + rm $out/lib/*.so* + ''; + }; + pcap = symlinkJoin { + inherit (libpcap) name; + paths = [ (libpcap.overrideAttrs(old: { dontDisableStatic = true; })) ]; + postBuild = '' + cp -rs $out/include/pcap $out/include/net + # prevent references to libpcap + rm $out/lib/*.so* + ''; + }; + net = symlinkJoin { + inherit (libnet) name; + paths = [ (libnet.overrideAttrs(old: { dontDisableStatic = true; })) ]; + postBuild = '' + # prevent dynamic linking, now that we have a static library + rm $out/lib/*.so* + ''; + }; + nids = libnids.overrideAttrs(old: { + dontDisableStatic = true; + }); + ssl = symlinkJoin { + inherit (openssl) name; + paths = with openssl.override { static = true; }; [ out dev ]; + }; +in gcc9Stdenv.mkDerivation rec { + pname = "dsniff"; + version = "2.4b1"; + # upstream is so old that nearly every distribution packages the beta version. + # Also, upstream only serves the latest version, so we use debian's sources. + # this way we can benefit the numerous debian patches to be able to build + # dsniff with recent libraries. + src = fetchFromGitLab { + domain = "salsa.debian.org"; + owner = "pkg-security-team"; + repo = "dsniff"; + rev = "debian/${version}+debian-30"; + sha256 = "1fk2k0sfdp5g27i11g0sbzm7al52raz5yr1aibzssnysv7l9xgzh"; + name = "dsniff.tar.gz"; + }; + + nativeBuildInputs = [ autoreconfHook rpcsvc-proto ]; + buildInputs = [ glib pcap libtirpc libnsl ]; + NIX_CFLAGS_LINK = "-lglib-2.0 -lpthread -ldl -ltirpc"; + NIX_CFLAGS_COMPILE = [ "-I${libtirpc.dev}/include/tirpc" ]; + postPatch = '' + for patch in debian/patches/*.patch; do + patch < $patch + done; + ''; + configureFlags = [ + "--with-db=${staticdb}" + "--with-libpcap=${pcap}" + "--with-libnet=${net}" + "--with-libnids=${nids}" + "--with-openssl=${ssl}" + ]; + + meta = with lib; { + description = "collection of tools for network auditing and penetration testing"; + longDescription = '' + dsniff, filesnarf, mailsnarf, msgsnarf, urlsnarf, and webspy passively monitor a network for interesting data (passwords, e-mail, files, etc.). arpspoof, dnsspoof, and macof facilitate the interception of network traffic normally unavailable to an attacker (e.g, due to layer-2 switching). sshmitm and webmitm implement active monkey-in-the-middle attacks against redirected SSH and HTTPS sessions by exploiting weak bindings in ad-hoc PKI. + ''; + homepage = "https://www.monkey.org/~dugsong/dsniff/"; + license = licenses.bsd3; + maintainers = [ maintainers.symphorien ]; + # bsd and solaris should work as well + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/easyrsa/2.x.nix b/nixpkgs/pkgs/tools/networking/easyrsa/2.x.nix new file mode 100644 index 000000000000..52cf2082d63f --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/easyrsa/2.x.nix @@ -0,0 +1,38 @@ +{ lib, stdenv, fetchurl, autoreconfHook, makeWrapper +, gnugrep, openssl }: + +stdenv.mkDerivation { + name = "easyrsa-2.2.0"; + + src = fetchurl { + url = "https://github.com/OpenVPN/easy-rsa/archive/v2.2.0.tar.gz"; + sha256 = "1xq4by5frb6ikn53ss3y8v7ss639dccxfq8jfrbk07ynkmk668qk"; + }; + + preBuild = '' + mkdir -p $out/share/easy-rsa + ''; + + nativeBuildInputs = [ autoreconfHook makeWrapper ]; + buildInputs = [ gnugrep openssl ]; + + # Make sane defaults and patch default config vars + postInstall = '' + cp $out/share/easy-rsa/openssl-1.0.0.cnf $out/share/easy-rsa/openssl.cnf + for prog in $(find "$out/share/easy-rsa" -executable -type f); do + makeWrapper "$prog" "$out/bin/$(basename $prog)" \ + --set EASY_RSA "$out/share/easy-rsa" \ + --set OPENSSL "${openssl.bin}/bin/openssl" \ + --set GREP "${gnugrep}/bin/grep" + done + sed -i "/EASY_RSA=\|OPENSSL=\|GREP=/d" $out/share/easy-rsa/vars + ''; + + meta = with lib; { + description = "Simple shell based CA utility"; + homepage = "https://openvpn.net/"; + license = licenses.gpl2; + maintainers = [ maintainers.offline ]; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/easyrsa/default.nix b/nixpkgs/pkgs/tools/networking/easyrsa/default.nix new file mode 100644 index 000000000000..34e326858fdc --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/easyrsa/default.nix @@ -0,0 +1,42 @@ +{ lib, stdenv, fetchFromGitHub, openssl, runtimeShell }: + +let + version = "3.0.8"; +in stdenv.mkDerivation { + pname = "easyrsa"; + inherit version; + + src = fetchFromGitHub { + owner = "OpenVPN"; + repo = "easy-rsa"; + rev = "v${version}"; + sha256 = "05q60s343ydh9j6hzj0840qdcq8fkyz06q68yw4pqgqg4w68rbgs"; + }; + + patches = [ ./fix-paths.patch ]; + + installPhase = '' + mkdir -p $out/share/easyrsa + cp -r easyrsa3/{*.cnf,x509-types,vars.example} $out/share/easyrsa + cp easyrsa3/openssl-easyrsa.cnf $out/share/easyrsa/safessl-easyrsa.cnf + install -D -m755 easyrsa3/easyrsa $out/bin/easyrsa + substituteInPlace $out/bin/easyrsa \ + --subst-var out \ + --subst-var-by openssl ${openssl.bin}/bin/openssl + + # Helper utility + cat > $out/bin/easyrsa-init <<EOF + #!${runtimeShell} -e + cp -r $out/share/easyrsa/* . + EOF + chmod +x $out/bin/easyrsa-init + ''; + + meta = with lib; { + description = "Simple shell based CA utility"; + homepage = "https://openvpn.net/"; + license = licenses.gpl2; + maintainers = [ maintainers.offline maintainers.numinit ]; + platforms = platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/easyrsa/fix-paths.patch b/nixpkgs/pkgs/tools/networking/easyrsa/fix-paths.patch new file mode 100644 index 000000000000..7891adcb20c7 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/easyrsa/fix-paths.patch @@ -0,0 +1,49 @@ +diff --git a/easyrsa3/easyrsa b/easyrsa3/easyrsa +index 261336f..7b9a79b 100755 +--- a/easyrsa3/easyrsa ++++ b/easyrsa3/easyrsa +@@ -1661,7 +1661,7 @@ Note: using Easy-RSA configuration from: $vars" + + # Set defaults, preferring existing env-vars if present + set_var EASYRSA "$prog_dir" +- set_var EASYRSA_OPENSSL openssl ++ set_var EASYRSA_OPENSSL "@openssl@" + set_var EASYRSA_PKI "$PWD/pki" + set_var EASYRSA_DN cn_only + set_var EASYRSA_REQ_COUNTRY "US" +@@ -1683,16 +1683,31 @@ Note: using Easy-RSA configuration from: $vars" + set_var EASYRSA_TEMP_DIR "$EASYRSA_PKI" + set_var EASYRSA_REQ_CN ChangeMe + set_var EASYRSA_DIGEST sha256 +- set_var EASYRSA_SSL_CONF "$EASYRSA_PKI/openssl-easyrsa.cnf" +- set_var EASYRSA_SAFE_CONF "$EASYRSA_PKI/safessl-easyrsa.cnf" + set_var EASYRSA_KDC_REALM "CHANGEME.EXAMPLE.COM" + ++ if [ -f "$EASYRSA_PKI/safessl-easyrsa.conf" ]; then ++ set_var EASYRSA_SAFE_CONF "$EASYRSA_PKI/safessl-easyrsa.cnf" ++ elif [ -f "$EASYRSA/safessl-easyrsa.conf" ]; then ++ set_var EASYRSA_SAFE_CONF "$EASYRSA/safessl-easyrsa.cnf" ++ elif [ -f "@out@/share/easyrsa/safessl-easyrsa.cnf" ]; then ++ set_var EASYRSA_SAFE_CONF "@out@/share/easyrsa/safessl-easyrsa.cnf" ++ fi ++ ++ if [ -f "$EASYRSA_PKI/openssl-easyrsa.conf" ]; then ++ set_var EASYRSA_SSL_CONF "$EASYRSA_PKI/openssl-easyrsa.cnf" ++ elif [ -f "$EASYRSA/openssl-easyrsa.conf" ]; then ++ set_var EASYRSA_SSL_CONF "$EASYRSA/openssl-easyrsa.cnf" ++ elif [ -f "@out@/share/easyrsa/openssl-easyrsa.cnf" ]; then ++ set_var EASYRSA_SSL_CONF "@out@/share/easyrsa/openssl-easyrsa.cnf" ++ fi ++ + # Same as above for the x509-types extensions dir + if [ -d "$EASYRSA_PKI/x509-types" ]; then + set_var EASYRSA_EXT_DIR "$EASYRSA_PKI/x509-types" +- else +- #TODO: This should be removed. Not really suitable for packaging. ++ elif [ -d "$EASYRSA/x509-types" ]; then + set_var EASYRSA_EXT_DIR "$EASYRSA/x509-types" ++ else ++ set_var EASYRSA_EXT_DIR "@out@/share/easyrsa/x509-types" + fi + + # EASYRSA_ALGO_PARAMS must be set depending on selected algo diff --git a/nixpkgs/pkgs/tools/networking/eggdrop/default.nix b/nixpkgs/pkgs/tools/networking/eggdrop/default.nix new file mode 100644 index 000000000000..2db99bfa8280 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/eggdrop/default.nix @@ -0,0 +1,38 @@ +{ lib, stdenv, fetchFromGitHub, tcl }: + +stdenv.mkDerivation rec { + pname = "eggdrop"; + version = "1.8.4"; + + src = fetchFromGitHub { + owner = "eggheads"; + repo = "eggdrop"; + rev = "v${version}"; + sha256 = "0xqdrv4ydxw72a740lkmpg3fs7ldicaf08b0sfqdyaj7cq8l5x5l"; + }; + + buildInputs = [ tcl ]; + + hardeningDisable = [ "format" ]; + + preConfigure = '' + prefix=$out/eggdrop + mkdir -p $prefix + ''; + + postConfigure = '' + make config + ''; + + configureFlags = [ + "--with-tcllib=${tcl}/lib/lib${tcl.libPrefix}${stdenv.hostPlatform.extensions.sharedLibrary}" + "--with-tclinc=${tcl}/include/tcl.h" + ]; + + meta = with lib; { + license = licenses.gpl2; + platforms = platforms.unix; + homepage = "http://www.eggheads.org"; + description = "An Internet Relay Chat (IRC) bot"; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/email/default.nix b/nixpkgs/pkgs/tools/networking/email/default.nix new file mode 100644 index 000000000000..5c24acb912f9 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/email/default.nix @@ -0,0 +1,40 @@ +{ stdenv, lib, fetchFromGitHub, openssl }: + +let + eMailSrc = fetchFromGitHub { + owner = "deanproxy"; + repo = "eMail"; + rev = "7d23c8f508a52bd8809e2af4290417829b6bb5ae"; + sha256 = "1cxxzhm36civ6vjdgrk7mfmlzkih44kdii6l2xgy4r434s8rzcpn"; + }; + + srcRoot = eMailSrc.name; + + dlibSrc = fetchFromGitHub { + owner = "deanproxy"; + repo = "dlib"; + rev = "f62f29e918748b7cea476220f7492672be81c9de"; + sha256 = "0h34cikch98sb7nsqjnb9wl384c8ndln3m6yb1172l4y89qjg9rr"; + }; + +in + +stdenv.mkDerivation { + name = "email-git-2016-01-31"; + src = eMailSrc; + + buildInputs = [ openssl ]; + + unpackPhase = '' + unpackPhase; + cp -Rp ${dlibSrc}/* ${srcRoot}/dlib; + chmod -R +w ${srcRoot}/dlib; + ''; + + meta = { + description = "Command line SMTP client"; + license = with lib.licenses; [ gpl2 ]; + homepage = "https://deanproxy.com/code"; + platforms = lib.platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/eternal-terminal/default.nix b/nixpkgs/pkgs/tools/networking/eternal-terminal/default.nix new file mode 100644 index 000000000000..21bd75a3ebae --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/eternal-terminal/default.nix @@ -0,0 +1,41 @@ +{ lib, stdenv +, fetchFromGitHub +, cmake +, gflags +, libsodium +, openssl +, protobuf +, zlib +}: + +stdenv.mkDerivation rec { + pname = "eternal-terminal"; + version = "6.1.8"; + + src = fetchFromGitHub { + owner = "MisterTea"; + repo = "EternalTerminal"; + rev = "et-v${version}"; + sha256 = "sha256-VSJ6AoVBvlCdKSirSDqsemixF+kAnvPgBQlyJxjoPcs="; + }; + + cmakeFlags= [ + "-DDISABLE_VCPKG=TRUE" + "-DDISABLE_SENTRY=TRUE" + "-DDISABLE_CRASH_LOG=TRUE" + ]; + + CXXFLAGS = lib.optional stdenv.cc.isClang "-std=c++17"; + LDFLAGS = lib.optional stdenv.cc.isClang "-lc++fs"; + + nativeBuildInputs = [ cmake ]; + buildInputs = [ gflags openssl zlib libsodium protobuf ]; + + meta = with lib; { + description = "Remote shell that automatically reconnects without interrupting the session"; + license = licenses.asl20; + homepage = "https://eternalterminal.dev/"; + platforms = platforms.linux ++ platforms.darwin; + maintainers = with maintainers; [ dezgeg pingiun ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/evillimiter/default.nix b/nixpkgs/pkgs/tools/networking/evillimiter/default.nix new file mode 100644 index 000000000000..20cc10728d60 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/evillimiter/default.nix @@ -0,0 +1,53 @@ +{ lib +, buildPythonApplication +, fetchFromGitHub +, colorama +, iproute2 +, iptables +, netaddr +, netifaces +, scapy +, terminaltables +, tqdm +}: + +buildPythonApplication rec { + pname = "evillimiter"; + version = "1.5.0"; + + src = fetchFromGitHub { + owner = "bitbrute"; + repo = pname; + rev = "v${version}"; + sha256 = "1l0acd4a36wzz1gyc6mcw3zpagyi2mc425c6d4c6anq3jxwm3847"; + }; + + propagatedBuildInputs = [ + colorama + iproute2 + iptables + netaddr + netifaces + scapy + terminaltables + tqdm + ]; + + # no tests present + doCheck = false; + + pythonImportsCheck = [ "evillimiter.evillimiter" ]; + + meta = with lib; { + description = "Tool that monitors, analyzes and limits the bandwidth"; + longDescription = '' + A tool to monitor, analyze and limit the bandwidth (upload/download) of + devices on your local network without physical or administrative access. + evillimiter employs ARP spoofing and traffic shaping to throttle the + bandwidth of hosts on the network. + ''; + homepage = "https://github.com/bitbrute/evillimiter"; + license = with licenses; [ mit ]; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/fakeroute/default.nix b/nixpkgs/pkgs/tools/networking/fakeroute/default.nix new file mode 100644 index 000000000000..025eef72332f --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/fakeroute/default.nix @@ -0,0 +1,21 @@ +{ lib, stdenv, fetchurl }: + +stdenv.mkDerivation rec { + pname = "fakeroute"; + version = "0.3"; + + src = fetchurl { + url = "https://moxie.org/software/fakeroute/${pname}-${version}.tar.gz"; + sha256 = "1sp342rxgm1gz4mvi5vvz1knz7kn9px9s39ii3jdjp4ks7lr5c8f"; + }; + + meta = with lib; { + description = '' + Makes your machine appear to be anywhere on the internet + to any host running a (UDP) unix traceroute + ''; + homepage = "https://moxie.org/software/fakeroute/"; + license = licenses.bsd3; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/fastd/default.nix b/nixpkgs/pkgs/tools/networking/fastd/default.nix new file mode 100644 index 000000000000..493112b93ac0 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/fastd/default.nix @@ -0,0 +1,55 @@ +{ lib +, stdenv +, fetchFromGitHub +, bison +, meson +, ninja +, pkg-config +, libuecc +, libsodium +, libcap +, json_c +, openssl +}: + +stdenv.mkDerivation rec { + pname = "fastd"; + version = "21"; + + src = fetchFromGitHub { + owner = "Neoraider"; + repo = "fastd"; + rev = "v${version}"; + sha256 = "1p4k50dk8byrghbr0fwmgwps8df6rlkgcd603r14i71m5g27z5gw"; + }; + + nativeBuildInputs = [ + bison + meson + ninja + pkg-config + ]; + + buildInputs = [ + json_c + libcap + libsodium + libuecc + openssl + ]; + + # some options are only available on x86 + mesonFlags = lib.optionals (!stdenv.isx86_64 && !stdenv.isi686) [ + "-Dcipher_salsa20_xmm=disabled" + "-Dcipher_salsa2012_xmm=disabled" + "-Dmac_ghash_pclmulqdq=disabled" + ]; + + meta = with lib; { + description = "Fast and Secure Tunneling Daemon"; + homepage = "https://projects.universe-factory.net/projects/fastd/wiki"; + license = with licenses; [ bsd2 bsd3 ]; + platforms = platforms.linux; + maintainers = with maintainers; [ fpletz ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/fdm/default.nix b/nixpkgs/pkgs/tools/networking/fdm/default.nix new file mode 100644 index 000000000000..608b669535d4 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/fdm/default.nix @@ -0,0 +1,26 @@ +{ lib, stdenv, fetchFromGitHub, autoreconfHook, openssl, tdb, zlib, flex, bison }: + +stdenv.mkDerivation rec { + pname = "fdm"; + version = "2.0"; + + src = fetchFromGitHub { + owner = "nicm"; + repo = pname; + rev = version; + sha256 = "0j2n271ni5wslgjq1f4zgz1nsvqjf895dxy3ij5c904bbp8ckcwq"; + }; + + nativeBuildInputs = [ autoreconfHook ]; + buildInputs = [ openssl tdb zlib flex bison ]; + + + meta = with lib; { + description = "Mail fetching and delivery tool - should do the job of getmail and procmail"; + maintainers = with maintainers; [ ninjin raskin ]; + platforms = with platforms; linux; + homepage = "https://github.com/nicm/fdm"; + downloadPage = "https://github.com/nicm/fdm/releases"; + license = licenses.isc; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/ferm/default.nix b/nixpkgs/pkgs/tools/networking/ferm/default.nix new file mode 100644 index 000000000000..29f9481fe328 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/ferm/default.nix @@ -0,0 +1,46 @@ +{ lib, stdenv, fetchurl, makeWrapper, perl, ebtables, ipset, iptables, nixosTests }: + +let + inherit (lib.versions) majorMinor; +in stdenv.mkDerivation rec { + version = "2.6"; + pname = "ferm"; + + src = fetchurl { + url = "http://ferm.foo-projects.org/download/${majorMinor version}/ferm-${version}.tar.xz"; + sha256 = "sha256-aJVBRl58Bzy9YEyc0Y8RPDHAtBuxJhRyalmxfkQFiIU="; + }; + + # perl is used at build time to gather the ferm version. + nativeBuildInputs = [ makeWrapper perl ]; + buildInputs = [ perl ]; + + makeFlags = [ + "PERL=perl" + "PREFIX=${placeholder "out"}" + ]; + + postInstall = '' + rm -r $out/lib/systemd + for i in "$out/sbin/"*; do + wrapProgram "$i" --prefix PATH : "${lib.makeBinPath [ iptables ipset ebtables ]}" + done + ''; + + passthru.tests.ferm = nixosTests.ferm; + + meta = { + homepage = "http://ferm.foo-projects.org/"; + description = "Tool to maintain complex firewalls"; + longDescription = '' + ferm is a tool to maintain complex firewalls, without having the trouble to + rewrite the complex rules over and over again. ferm allows the entire + firewall rule set to be stored in a separate file, and to be loaded with one + command. The firewall configuration resembles structured programming-like + language, which can contain levels and lists. + ''; + license = lib.licenses.gpl2; + maintainers = with lib.maintainers; [mic92]; + platforms = lib.platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/filegive/default.nix b/nixpkgs/pkgs/tools/networking/filegive/default.nix new file mode 100644 index 000000000000..1d7bf884edd5 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/filegive/default.nix @@ -0,0 +1,22 @@ +{ buildGoPackage, lib, fetchurl }: + +buildGoPackage rec { + name = "filegive-0.7.4"; + + src = fetchurl { + url = "http://viric.name/soft/filegive/${name}.tar.gz"; + sha256 = "1z3vyqfdp271qa5ah0i6jmn9gh3gb296wcm33sd2zfjqapyh12hy"; + }; + + goDeps = ./deps.nix; + + goPackagePath = "viric.name/soft/filegive"; + + meta = with lib; { + homepage = "http://viric.name/cgi-bin/filegive"; + description = "Easy p2p file sending program"; + license = licenses.agpl3Plus; + maintainers = [ maintainers.viric ]; + platforms = platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/filegive/deps.nix b/nixpkgs/pkgs/tools/networking/filegive/deps.nix new file mode 100644 index 000000000000..24c262195086 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/filegive/deps.nix @@ -0,0 +1,12 @@ +# This file was generated by https://github.com/kamilchm/go2nix v1.3.0 +[ + { + goPackagePath = "code.google.com/p/go-nat-pmp"; + fetch = { + type = "git"; + url = "https://github.com/jackpal/go-nat-pmp"; + rev = "e04deda90d5683d6e375732740814a89eea7bafd"; + sha256 = "1swwfyzaj3l40yh9np3x4fcracgs79nwryc85sxbdakx8wwxs2xb"; + }; + } +] diff --git a/nixpkgs/pkgs/tools/networking/findomain/default.nix b/nixpkgs/pkgs/tools/networking/findomain/default.nix new file mode 100644 index 000000000000..018a210e4aa2 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/findomain/default.nix @@ -0,0 +1,37 @@ +{ stdenv +, lib +, fetchFromGitHub +, rustPlatform +, installShellFiles +, perl +, libiconv +, Security +}: + +rustPlatform.buildRustPackage rec { + pname = "findomain"; + version = "4.3.0"; + + src = fetchFromGitHub { + owner = "Edu4rdSHL"; + repo = pname; + rev = version; + sha256 = "sha256-UC70XmhAVf2a2QO9bkIRE5vEsWyIA0DudZfKraNffGY="; + }; + + cargoSha256 = "sha256-Cdfh3smX6UjiG29L9hG22bOQQIjaNrv+okl153mIiso="; + + nativeBuildInputs = [ installShellFiles perl ]; + buildInputs = lib.optionals stdenv.isDarwin [ libiconv Security ]; + + postInstall = '' + installManPage ${pname}.1 + ''; + + meta = with lib; { + description = "The fastest and cross-platform subdomain enumerator"; + homepage = "https://github.com/Edu4rdSHL/findomain"; + license = licenses.gpl3Plus; + maintainers = with maintainers; [ Br1ght0ne ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/flannel/default.nix b/nixpkgs/pkgs/tools/networking/flannel/default.nix new file mode 100644 index 000000000000..86010f4adb91 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/flannel/default.nix @@ -0,0 +1,26 @@ +{ lib, buildGoPackage, fetchFromGitHub }: + +with lib; + +buildGoPackage rec { + pname = "flannel"; + version = "0.13.0"; + rev = "v${version}"; + + goPackagePath = "github.com/coreos/flannel"; + + src = fetchFromGitHub { + inherit rev; + owner = "coreos"; + repo = "flannel"; + sha256 = "0mmswnaybwpf18h832haapcs5b63wn5w2hax0smm3inldiggsbw8"; + }; + + meta = { + description = "Network fabric for containers, designed for Kubernetes"; + license = licenses.asl20; + homepage = "https://github.com/coreos/flannel"; + maintainers = with maintainers; [johanot offline]; + platforms = with platforms; linux; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/flvstreamer/default.nix b/nixpkgs/pkgs/tools/networking/flvstreamer/default.nix new file mode 100644 index 000000000000..d31751e7d5ca --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/flvstreamer/default.nix @@ -0,0 +1,39 @@ +{ lib, stdenv, fetchurl }: + +stdenv.mkDerivation rec { + + name = "flvstreamer-2.1c1"; + + src = fetchurl { + url = "mirror://savannah/flvstreamer/source/${name}.tar.gz"; + sha256 = "e90e24e13a48c57b1be01e41c9a7ec41f59953cdb862b50cf3e667429394d1ee"; + }; + + buildPhase = '' + make CC=${stdenv.cc.targetPrefix}cc posix + ''; + + installPhase = '' + mkdir -p $out/bin + cp flvstreamer $out/bin + cp streams $out/bin + cp rtmpsrv $out/bin + cp rtmpsuck $out/bin + ''; + + meta = { + description = "Command-line RTMP client"; + + longDescription = + '' flvstreamer is an open source command-line RTMP client intended to + stream audio or video content from all types of flash or rtmp servers. + ''; + + license = lib.licenses.gpl2Plus; + + homepage = "https://savannah.nongnu.org/projects/flvstreamer"; + + maintainers = [ lib.maintainers.thammers ]; + platforms = with lib.platforms; linux ++ darwin; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/fping/default.nix b/nixpkgs/pkgs/tools/networking/fping/default.nix new file mode 100644 index 000000000000..7974fdd244bd --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/fping/default.nix @@ -0,0 +1,19 @@ +{ lib, stdenv, fetchurl }: + +stdenv.mkDerivation rec { + name = "fping-5.0"; + + src = fetchurl { + url = "https://www.fping.org/dist/${name}.tar.gz"; + sha256 = "1f2prmii4fyl44cfykp40hp4jjhicrhddh9v3dfs11j6nsww0f7d"; + }; + + configureFlags = [ "--enable-ipv6" "--enable-ipv4" ]; + + meta = with lib; { + homepage = "http://fping.org/"; + description = "Send ICMP echo probes to network hosts"; + license = licenses.bsd0; + platforms = platforms.all; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/freebind/default.nix b/nixpkgs/pkgs/tools/networking/freebind/default.nix new file mode 100644 index 000000000000..5ba462f15b24 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/freebind/default.nix @@ -0,0 +1,32 @@ +{ lib, stdenv, fetchFromGitHub, libnetfilter_queue, libnfnetlink }: + +stdenv.mkDerivation { + pname = "freebind"; + version = "2017-12-27"; + + src = fetchFromGitHub { + owner = "blechschmidt"; + repo = "freebind"; + rev = "9a13d6f9c12aeea4f6d3513ba2461d34f841f278"; + sha256 = "1iv2xiz9w8hbz684caw50fn4a9vc8ninfgaqafkh9sa8mzpfzcqr"; + }; + + buildInputs = [ libnetfilter_queue libnfnetlink ]; + + postPatch = '' + substituteInPlace preloader.c --replace /usr/local/ $out/ + substituteInPlace Makefile --replace /usr/local/ $out/ + ''; + + preInstall = '' + mkdir -p $out/bin $out/lib + ''; + + meta = with lib; { + description = "IPv4 and IPv6 address rate limiting evasion tool"; + homepage = "https://github.com/blechschmidt/freebind"; + license = licenses.gpl3; + platforms = platforms.linux; + maintainers = with maintainers; [ volth ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/frp/default.nix b/nixpkgs/pkgs/tools/networking/frp/default.nix new file mode 100644 index 000000000000..871dd5ee5bd9 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/frp/default.nix @@ -0,0 +1,32 @@ +{ buildGoModule, lib, fetchFromGitHub }: + +buildGoModule rec { + pname = "frp"; + version = "0.36.1"; + + src = fetchFromGitHub { + owner = "fatedier"; + repo = pname; + rev = "v${version}"; + sha256 = "sha256-oOq5Y/6n7VHU9WPjnt+moVWZgo8mQl6Jd8daLJ2/pSQ="; + }; + + vendorSha256 = "sha256-Q4ZwCH/RTa8cLtSg06s1S790MdZLgfWOvaD+WAt/RBM="; + + doCheck = false; + + subPackages = [ "cmd/frpc" "cmd/frps" ]; + + meta = with lib; { + description = "Fast reverse proxy"; + longDescription = '' + frp is a fast reverse proxy to help you expose a local server behind a + NAT or firewall to the Internet. As of now, it supports TCP and UDP, as + well as HTTP and HTTPS protocols, where requests can be forwarded to + internal services by domain name. frp also has a P2P connect mode. + ''; + homepage = "https://github.com/fatedier/frp"; + license = licenses.asl20; + maintainers = with maintainers; [ Br1ght0ne ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/gandi-cli/default.nix b/nixpkgs/pkgs/tools/networking/gandi-cli/default.nix new file mode 100644 index 000000000000..d7394ac94d88 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/gandi-cli/default.nix @@ -0,0 +1,38 @@ +{ lib +, buildPythonApplication +, click +, fetchFromGitHub +, ipy +, pyyaml +, requests +}: + +buildPythonApplication rec { + pname = "gandi-cli"; + version = "1.6"; + + src = fetchFromGitHub { + owner = "Gandi"; + repo = "gandi.cli"; + rev = version; + sha256 = "sha256-KLeEbbzgqpmBjeTc5RYsFScym8xtMqVjU+H0lyDM0+o="; + }; + + propagatedBuildInputs = [ + click + ipy + pyyaml + requests + ]; + + # Tests try to contact the actual remote API + doCheck = false; + pythonImportsCheck = [ "gandi" ]; + + meta = with lib; { + description = "Command-line interface to the public Gandi.net API"; + homepage = "https://cli.gandi.net/"; + license = licenses.gpl3Plus; + maintainers = with maintainers; [ ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/getmail/default.nix b/nixpkgs/pkgs/tools/networking/getmail/default.nix new file mode 100644 index 000000000000..44481802cc08 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/getmail/default.nix @@ -0,0 +1,30 @@ +{ lib, fetchurl, python2Packages }: + +python2Packages.buildPythonApplication rec { + pname = "getmail"; + version = "5.14"; + + src = fetchurl { + url = "http://pyropus.ca/software/getmail/old-versions/${pname}-${version}.tar.gz"; + sha256 = "1hcrd9h4g12f5gvl1djsbchcjry02ghq4icdr897s8v48pkrzagk"; + }; + + doCheck = false; + + postPatch = '' + # getmail spends a lot of effort to build an absolute path for + # documentation installation; too bad it is counterproductive now + sed -e '/datadir or prefix,/d' -i setup.py + ''; + + meta = { + description = "A program for retrieving mail"; + maintainers = [ lib.maintainers.raskin ]; + platforms = lib.platforms.linux; + + homepage = "http://pyropus.ca/software/getmail/"; + inherit version; + updateWalker = true; + license = lib.licenses.gpl2Plus; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/getmail6/default.nix b/nixpkgs/pkgs/tools/networking/getmail6/default.nix new file mode 100644 index 000000000000..673ff7f83a3f --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/getmail6/default.nix @@ -0,0 +1,31 @@ +{ fetchFromGitHub, python3Packages, lib }: + +python3Packages.buildPythonApplication rec { + pname = "getmail6"; + version = "6.16"; + + src = fetchFromGitHub { + owner = pname; + repo = pname; + rev = "v${version}"; + sha256 = "1y373nzbffjjjs43441cn3wrb0yq1mw2vqixhizbzdacrs45xbfa"; + }; + + doCheck = false; + + pythonImportsCheck = [ "getmailcore" ]; + + postPatch = '' + # getmail spends a lot of effort to build an absolute path for + # documentation installation; too bad it is counterproductive now + sed -e '/datadir or prefix,/d' -i setup.py + ''; + + meta = with lib; { + description = "A program for retrieving mail"; + homepage = "https://getmail6.org"; + updateWalker = true; + license = licenses.gpl2Plus; + maintainers = with maintainers; [ abbe ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/gftp/default.nix b/nixpkgs/pkgs/tools/networking/gftp/default.nix new file mode 100644 index 000000000000..b228967a73b5 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/gftp/default.nix @@ -0,0 +1,24 @@ +{ lib, stdenv, fetchurl, gtk2, readline, ncurses, gettext, openssl, pkg-config }: + +stdenv.mkDerivation { + name = "gftp-2.0.19"; + + src = fetchurl { + url = "https://www.gftp.org/gftp-2.0.19.tar.bz2"; + sha256 = "1z8b26n23k0sjbxgrix646b06cnpndpq7cbcj0ilsvvdx5ms81jk"; + }; + + postPatch = '' + sed -i -e '/<stropts.h>/d' lib/pty.c + ''; + + nativeBuildInputs = [ pkg-config ]; + buildInputs = [ gtk2 readline ncurses gettext openssl ]; + + meta = { + description = "GTK-based FTP client"; + homepage = "http://www.gftp.org"; + license = lib.licenses.gpl2Plus; + platforms = lib.platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/ghostunnel/default.nix b/nixpkgs/pkgs/tools/networking/ghostunnel/default.nix new file mode 100644 index 000000000000..5d00b493bc37 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/ghostunnel/default.nix @@ -0,0 +1,29 @@ +{ + buildGoModule, + fetchFromGitHub, + lib, + nixosTests, +}: + +buildGoModule rec { + pname = "ghostunnel"; + version = "1.5.3"; + + src = fetchFromGitHub { + owner = "ghostunnel"; + repo = "ghostunnel"; + rev = "v${version}"; + sha256 = "15rmd89j7sfpznzznss899smizbyshprsrvsdmrbhb617myd9fpy"; + }; + + vendorSha256 = "1i95fx4a0fh6id6iy6afbva4pazr7ym6sbwi9r7la6gxzyncd023"; + + meta = with lib; { + description = "A simple TLS proxy with mutual authentication support for securing non-TLS backend applications"; + homepage = "https://github.com/ghostunnel/ghostunnel#readme"; + license = licenses.asl20; + maintainers = with maintainers; [ roberth ]; + }; + + passthru.tests.nixos = nixosTests.ghostunnel; +} diff --git a/nixpkgs/pkgs/tools/networking/gmrender-resurrect/default.nix b/nixpkgs/pkgs/tools/networking/gmrender-resurrect/default.nix new file mode 100644 index 000000000000..d4fc1b22e8f1 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/gmrender-resurrect/default.nix @@ -0,0 +1,38 @@ +{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config, makeWrapper, gstreamer +, gst-plugins-base, gst-plugins-good, gst-plugins-bad, gst-plugins-ugly, gst-libav, libupnp }: + +let + version = "0.0.9"; + + makePluginPath = plugins: builtins.concatStringsSep ":" (map (p: p + "/lib/gstreamer-1.0") plugins); + + pluginPath = makePluginPath [ gstreamer gst-plugins-base gst-plugins-good gst-plugins-bad gst-plugins-ugly gst-libav ]; +in + stdenv.mkDerivation { + pname = "gmrender-resurrect"; + inherit version; + + src = fetchFromGitHub { + owner = "hzeller"; + repo = "gmrender-resurrect"; + rev = "v${version}"; + sha256 = "0byxd28hnhkhf3lqsad43n6czfajvc1ksg9zikxb95wwk4ljqv1q"; + }; + + buildInputs = [ gstreamer libupnp ]; + nativeBuildInputs = [ autoreconfHook pkg-config makeWrapper ]; + + postInstall = '' + for prog in "$out/bin/"*; do + wrapProgram "$prog" --suffix GST_PLUGIN_SYSTEM_PATH_1_0 : "${pluginPath}" + done + ''; + + meta = with lib; { + description = "Resource efficient UPnP/DLNA renderer, optimal for Raspberry Pi, CuBox or a general MediaServer"; + homepage = "https://github.com/hzeller/gmrender-resurrect"; + license = licenses.gpl2Plus; + platforms = platforms.linux; + maintainers = with maintainers; [ koral hzeller ]; + }; + } diff --git a/nixpkgs/pkgs/tools/networking/gnirehtet/default.nix b/nixpkgs/pkgs/tools/networking/gnirehtet/default.nix new file mode 100644 index 000000000000..123ab3d76eef --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/gnirehtet/default.nix @@ -0,0 +1,51 @@ +{ lib, stdenv, rustPlatform, fetchFromGitHub, fetchzip, androidenv, makeWrapper }: +let +version = "2.5"; +apk = stdenv.mkDerivation { + pname = "gnirehtet.apk"; + inherit version; + src = fetchzip { + url = "https://github.com/Genymobile/gnirehtet/releases/download/v${version}/gnirehtet-rust-linux64-v${version}.zip"; + sha256 = "1db0gkg5z8lighhkyqfsr9jiacrck89zmfnmp74vj865hhxgjzgq"; + }; + installPhase = '' + mkdir $out + mv gnirehtet.apk $out + ''; +}; +in +rustPlatform.buildRustPackage { + pname = "gnirehtet"; + inherit version; + + src = fetchFromGitHub { + owner = "Genymobile"; + repo = "gnirehtet"; + rev = "v${version}"; + sha256 = "0wk6n082gnj9xk46n542h1012h8gyhldca23bs7vl73g0534g878"; + }; + sourceRoot = "source/relay-rust"; + cargoSha256 = "03r8ivsvmhi5f32gj4yacbyzanziymszya18dani53bq9zis9z31"; + + nativeBuildInputs = [ makeWrapper ]; + + postInstall = '' + wrapProgram $out/bin/gnirehtet \ + --set GNIREHTET_APK ${apk}/gnirehtet.apk \ + --set ADB ${androidenv.androidPkgs_9_0.platform-tools}/bin/adb + ''; + + meta = with lib; { + description = "Reverse tethering over adb for Android"; + longDescription = '' + This project provides reverse tethering over adb for Android: it allows devices to use the internet connection of the computer they are plugged on. It does not require any root access (neither on the device nor on the computer). + + This relies on adb, make sure you have the required permissions/udev rules. + ''; + homepage = "https://github.com/Genymobile/gnirehtet"; + license = licenses.asl20; + maintainers = with maintainers; [ symphorien ]; + platforms = platforms.unix; + }; +} + diff --git a/nixpkgs/pkgs/tools/networking/go-shadowsocks2/default.nix b/nixpkgs/pkgs/tools/networking/go-shadowsocks2/default.nix new file mode 100644 index 000000000000..0c8505c7001e --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/go-shadowsocks2/default.nix @@ -0,0 +1,22 @@ +{ lib, buildGoModule, fetchFromGitHub }: + +buildGoModule rec { + pname = "go-shadowsocks2"; + version = "0.1.4"; + + src = fetchFromGitHub { + owner = "shadowsocks"; + repo = "go-shadowsocks2"; + rev = "v${version}"; + sha256 = "sha256-ouJGrVribymak4SWaLbGhlp41iuw07VdxCypoBr1hWA="; + }; + + vendorSha256 = "sha256-RrHksWET5kicbdQ5HRDWhNxx4rTi2zaVeaPoLdg4uQw="; + + meta = with lib; { + description = "Fresh implementation of Shadowsocks in Go"; + homepage = "https://github.com/shadowsocks/go-shadowsocks2/"; + license = licenses.asl20; + maintainers = with maintainers; [ oxzi ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/gobgp/default.nix b/nixpkgs/pkgs/tools/networking/gobgp/default.nix new file mode 100644 index 000000000000..96f806aad39f --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/gobgp/default.nix @@ -0,0 +1,33 @@ +{ buildGoModule, fetchFromGitHub, lib }: + +buildGoModule rec { + pname = "gobgp"; + version = "2.28.0"; + + src = fetchFromGitHub { + owner = "osrg"; + repo = "gobgp"; + rev = "v${version}"; + sha256 = "sha256-AlAfs1wi3hS7cqAtGqfUgv5CIonu7TmXWgxL1zSBh54="; + }; + + vendorSha256 = "sha256-PWm7XnO6LPaU8g8ymmqRkQv2KSX9kLv9RVaa000mrTY="; + + postConfigure = '' + export CGO_ENABLED=0 + ''; + + buildFlagsArray = '' + -ldflags= + -s -w -extldflags '-static' + ''; + + subPackages = [ "cmd/gobgp" ]; + + meta = with lib; { + description = "A CLI tool for GoBGP"; + homepage = "https://osrg.github.io/gobgp/"; + license = licenses.asl20; + maintainers = with maintainers; [ higebu ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/goimapnotify/default.nix b/nixpkgs/pkgs/tools/networking/goimapnotify/default.nix new file mode 100644 index 000000000000..619e364c884f --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/goimapnotify/default.nix @@ -0,0 +1,30 @@ +{ buildGoPackage, fetchFromGitLab, lib, runtimeShell }: + +buildGoPackage rec { + pname = "goimapnotify"; + version = "2.0"; + + goPackagePath = "gitlab.com/shackra/goimapnotify"; + + src = fetchFromGitLab { + owner = "shackra"; + repo = "goimapnotify"; + rev = version; + sha256 = "1d42gd3m2rkvy985d181dbcm5i3f7xsg2z8z6s4bpvw24pfnzs42"; + }; + + postPatch = '' + substituteInPlace command.go --replace '"sh"' '"${runtimeShell}"' + ''; + + goDeps = ./deps.nix; + + meta = with lib; { + description = + "Execute scripts on IMAP mailbox changes (new/deleted/updated messages) using IDLE"; + homepage = "https://gitlab.com/shackra/goimapnotify"; + license = licenses.gpl3Plus; + platforms = platforms.linux; + maintainers = with maintainers; [ wohanley ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/goimapnotify/deps.nix b/nixpkgs/pkgs/tools/networking/goimapnotify/deps.nix new file mode 100644 index 000000000000..fc377c50be4c --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/goimapnotify/deps.nix @@ -0,0 +1,66 @@ +# file generated from Gopkg.lock using dep2nix (https://github.com/nixcloud/dep2nix) +[ + { + goPackagePath = "github.com/emersion/go-imap"; + fetch = { + type = "git"; + url = "https://github.com/emersion/go-imap"; + rev = "b7db4a2bc5cc04fb568fb036a438da43ee9a9f78"; + sha256 = "1v5hp02k9rfdq7gqiydz575dw6a991pspynhxypv0fvgh1vgqs0s"; + }; + } + { + goPackagePath = "github.com/emersion/go-imap-idle"; + fetch = { + type = "git"; + url = "https://github.com/emersion/go-imap-idle"; + rev = "2af93776db6b042cc1116b0d0af00d7f58eea696"; + sha256 = "19dh8sryjr3a8f0bgwywiz2fqccxhf4j66sm0w1jkjzh131f3pr7"; + }; + } + { + goPackagePath = "github.com/emersion/go-sasl"; + fetch = { + type = "git"; + url = "https://github.com/emersion/go-sasl"; + rev = "7e096a0a6197b89989e8cc31016daa67c8c62051"; + sha256 = "0mr9nzi4wc3ck730zqfqwmy8wk7d90h80yvvivqnxyfyadqy48kd"; + }; + } + { + goPackagePath = "github.com/konsorten/go-windows-terminal-sequences"; + fetch = { + type = "git"; + url = "https://github.com/konsorten/go-windows-terminal-sequences"; + rev = "f55edac94c9bbba5d6182a4be46d86a2c9b5b50e"; + sha256 = "09mn209ika7ciy87xf2x31dq5fnqw39jidgaljvmqxwk7ff1hnx7"; + }; + } + { + goPackagePath = "github.com/sirupsen/logrus"; + fetch = { + type = "git"; + url = "https://github.com/sirupsen/logrus"; + rev = "8bdbc7bcc01dcbb8ec23dc8a28e332258d25251f"; + sha256 = "1m7ny9jkb98cxqhsp13xa5hnqh1s9f25x04q6arsala4zswsw33c"; + }; + } + { + goPackagePath = "golang.org/x/sys"; + fetch = { + type = "git"; + url = "https://go.googlesource.com/sys"; + rev = "a129542de9ae0895210abff9c95d67a1f33cb93d"; + sha256 = "13p5q7s25rsvfkk8fcwf432j8djf7bjg7chs296rzlig4vqcdxi4"; + }; + } + { + goPackagePath = "golang.org/x/text"; + fetch = { + type = "git"; + url = "https://go.googlesource.com/text"; + rev = "342b2e1fbaa52c93f31447ad2c6abc048c63e475"; + sha256 = "0flv9idw0jm5nm8lx25xqanbkqgfiym6619w575p7nrdh0riqwqh"; + }; + } +] diff --git a/nixpkgs/pkgs/tools/networking/goklp/default.nix b/nixpkgs/pkgs/tools/networking/goklp/default.nix new file mode 100644 index 000000000000..10c5c8ea64fe --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/goklp/default.nix @@ -0,0 +1,24 @@ +{ lib, buildGoPackage, fetchFromGitHub }: + +buildGoPackage rec { + pname = "goklp"; + version = "1.6"; + + goPackagePath = "github.com/AppliedTrust/goklp"; + + src = fetchFromGitHub { + owner = "AppliedTrust"; + repo = "goklp"; + rev = "v${version}"; + sha256 = "054qmwfaih8qbvdyy4rqbb1ip3jpnm547n390hgab8yc3bdd840c"; + }; + + goDeps = ./deps.nix; + + meta = with lib; { + description = "Golang OpenSSH Keys Ldap Provider for AuthorizedKeysCommand"; + homepage = "https://github.com/AppliedTrust/goklp"; + maintainers = with maintainers; [ disassembler ]; + license = licenses.bsd2; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/goklp/deps.nix b/nixpkgs/pkgs/tools/networking/goklp/deps.nix new file mode 100644 index 000000000000..2f6481f237f8 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/goklp/deps.nix @@ -0,0 +1,56 @@ +[ + { + goPackagePath = "github.com/asaskevich/govalidator"; + fetch = { + type = "git"; + url = "https://github.com/asaskevich/govalidator"; + rev = "ca5f9e638c83bac66bfac70ded5bded1503135a7"; + sha256 = "0lk4irlf4a4q8qharwjxl71y1s2cf5bjpg9cv5jlyp574331pn1w"; + }; + } + { + goPackagePath = "github.com/docopt/docopt-go"; + fetch = { + type = "git"; + url = "https://github.com/docopt/docopt-go"; + rev = "784ddc588536785e7299f7272f39101f7faccc3f"; + sha256 = "0wwz48jl9fvl1iknvn9dqr4gfy1qs03gxaikrxxp9gry6773v3sj"; + }; + } + { + goPackagePath = "github.com/kardianos/osext"; + fetch = { + type = "git"; + url = "https://github.com/kardianos/osext"; + rev = "ae77be60afb1dcacde03767a8c37337fad28ac14"; + sha256 = "056dkgxrqjj5r18bnc3knlpgdz5p3yvp12y4y978hnsfhwaqvbjz"; + }; + } + { + goPackagePath = "github.com/vaughan0/go-ini"; + fetch = { + type = "git"; + url = "https://github.com/vaughan0/go-ini"; + rev = "a98ad7ee00ec53921f08832bc06ecf7fd600e6a1"; + sha256 = "1l1isi3czis009d9k5awsj4xdxgbxn4n9yqjc1ac7f724x6jacfa"; + }; + } + { + goPackagePath = "gopkg.in/asn1-ber.v1"; + fetch = { + type = "git"; + url = "https://gopkg.in/asn1-ber.v1"; + rev = "379148ca0225df7a432012b8df0355c2a2063ac0"; + sha256 = "1y8bvzbxpw0lfnn7pbcdwzqj4l90qj6xf88dvv9pxd9yl5g6cskx"; + }; + } + { + goPackagePath = "gopkg.in/ldap.v2"; + fetch = { + type = "git"; + url = "https://gopkg.in/ldap.v2"; + rev = "8168ee085ee43257585e50c6441aadf54ecb2c9f"; + sha256 = "1w0993i8bl8sap01gwm1v6hjp0rsanj2mbpyabwcwnns2g79n895"; + }; + } +] diff --git a/nixpkgs/pkgs/tools/networking/goreplay/default.nix b/nixpkgs/pkgs/tools/networking/goreplay/default.nix new file mode 100644 index 000000000000..14d0a16366ba --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/goreplay/default.nix @@ -0,0 +1,26 @@ +{ lib, buildGoPackage, fetchFromGitHub, libpcap }: + +buildGoPackage rec { + pname = "goreplay"; + version = "1.1.0"; + rev = "v${version}"; + + goPackagePath = "github.com/buger/goreplay"; + + src = fetchFromGitHub { + inherit rev; + owner = "buger"; + repo = "goreplay"; + sha256 = "07nsrx5hwmk6l8bqp48gqk40i9bxf0g4fbmpqbngx6j5f7lpbk2n"; + }; + + buildInputs = [ libpcap ]; + + meta = { + homepage = "https://github.com/buger/goreplay"; + license = lib.licenses.lgpl3Only; + description = "Open-source tool for capturing and replaying live HTTP traffic"; + platforms = lib.platforms.unix; + maintainers = with lib.maintainers; [ lovek323 ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/gping/default.nix b/nixpkgs/pkgs/tools/networking/gping/default.nix new file mode 100644 index 000000000000..a6ace183df67 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/gping/default.nix @@ -0,0 +1,29 @@ +{ lib +, stdenv +, rustPlatform +, fetchFromGitHub +, libiconv +}: + +rustPlatform.buildRustPackage rec { + pname = "gping"; + version = "1.2.1"; + + src = fetchFromGitHub { + owner = "orf"; + repo = "gping"; + rev = "v${version}"; + sha256 = "sha256-lApm1JLXNjDKLj6zj25OaZDVp7lLW3qyrDsvJrudl8I="; + }; + + cargoSha256 = "sha256-d1NjPwT3YDp1U9JWeUejpWDbJonFlt5lYbUf7p3jVT0="; + + buildInputs = lib.optional stdenv.isDarwin libiconv; + + meta = with lib; { + description = "Ping, but with a graph"; + homepage = "https://github.com/orf/gping"; + license = licenses.mit; + maintainers = with maintainers; [ andrew-d ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/grpcui/default.nix b/nixpkgs/pkgs/tools/networking/grpcui/default.nix new file mode 100644 index 000000000000..a9fb7c823f9e --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/grpcui/default.nix @@ -0,0 +1,29 @@ +{ buildGoModule, fetchFromGitHub, lib }: + +buildGoModule rec { + pname = "grpcui"; + version = "1.1.0"; + + src = fetchFromGitHub { + owner = "fullstorydev"; + repo = pname; + rev = "v${version}"; + sha256 = "1l8ldx7nx2pa2ac5znss0j0dhapn3syj02xqys4jz22hr5gvfj6m"; + }; + + vendorSha256 = "15qgpbsl41swifw8w1lx0pbniwv3rf35127ald7h1r157vfa0r8b"; + + doCheck = false; + + subPackages = [ "cmd/grpcui" ]; + + buildFlagsArray = [ "-ldflags=-s -w -X main.version=${version}" ]; + + meta = with lib; { + description = "An interactive web UI for gRPC, along the lines of postman"; + homepage = "https://github.com/fullstorydev/grpcui"; + license = licenses.mit; + maintainers = with maintainers; [ pradyuman ]; + platforms = platforms.linux ++ platforms.darwin; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/grpcurl/default.nix b/nixpkgs/pkgs/tools/networking/grpcurl/default.nix new file mode 100644 index 000000000000..ec181c17e9ea --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/grpcurl/default.nix @@ -0,0 +1,26 @@ +{ lib, buildGoModule, fetchFromGitHub }: + +buildGoModule rec { + pname = "grpcurl"; + version = "1.8.1"; + + src = fetchFromGitHub { + owner = "fullstorydev"; + repo = "grpcurl"; + rev = "v${version}"; + sha256 = "sha256-BxmoIGhuAt/uhHLNdMiSrNVWAoxAAMKPJ/NsXjf2ynk="; + }; + + subPackages = [ "cmd/grpcurl" ]; + + vendorSha256 = "sha256-EnstvJk2kZ1Ft5xY1dO14wnmT//2K72OnDMZqeaOeQI="; + + buildFlagsArray = [ "-ldflags=-s -w -X main.version=${version}" ]; + + meta = with lib; { + description = "Like cURL, but for gRPC: Command-line tool for interacting with gRPC servers"; + homepage = "https://github.com/fullstorydev/grpcurl"; + license = licenses.mit; + maintainers = with maintainers; [ knl ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/guardian-agent/default.nix b/nixpkgs/pkgs/tools/networking/guardian-agent/default.nix new file mode 100644 index 000000000000..57080d223fa1 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/guardian-agent/default.nix @@ -0,0 +1,45 @@ +{ buildGoPackage +, fetchFromGitHub +, lib +, autossh +, makeWrapper +}: + +buildGoPackage rec { + pname = "guardian-agent"; + version = "0.7.2"; + + src = fetchFromGitHub { + owner = "StanfordSNR"; + repo = pname; + rev = "v${version}-beta"; + sha256 = "05269y944hcabn6dqa66387rdhx81vcqcyjv6m1hdbz5ba8j7mqn"; + }; + + nativeBuildInputs = [ makeWrapper ]; + + goPackagePath = "github.com/StanfordSNR/guardian-agent"; + + deleteVendor = true; + goDeps = ./deps.nix; + + postInstall = '' + mkdir -p $out/bin $out/share/doc/${pname} + cp -v ./go/src/github.com/StanfordSNR/${pname}/scripts/* $out/bin/ + cp -vr ./go/src/github.com/StanfordSNR/${pname}/{AUTHORS,doc,LICENSE,README.md} $out/share/doc/guardian-agent + ''; + + postFixup = '' + wrapProgram $out/bin/sga-guard \ + --prefix PATH : "$out/bin" \ + --prefix PATH : "${autossh}/bin" + ''; + + meta = with lib; { + description = "Secure ssh-agent forwarding for Mosh and SSH"; + homepage = "https://github.com/StanfordSNR/guardian-agent"; + license = licenses.bsd3; + maintainers = with maintainers; [ mmahut ]; + platforms = platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/guardian-agent/deps.nix b/nixpkgs/pkgs/tools/networking/guardian-agent/deps.nix new file mode 100644 index 000000000000..950a346ce8be --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/guardian-agent/deps.nix @@ -0,0 +1,58 @@ +# This file was generated by https://github.com/kamilchm/go2nix v1.3.0 +[ + { + goPackagePath = "github.com/hashicorp/yamux"; + fetch = { + type = "git"; + url = "https://github.com/hashicorp/yamux"; + rev = "2f1d1f20f75d5404f53b9edf6b53ed5505508675"; + sha256 = "1fga3p6j2g24ip9qjfwn3nqjr00m4nnjz92app7ms3sz7vgq2a7s"; + }; + } + { + goPackagePath = "github.com/howeyc/gopass"; + fetch = { + type = "git"; + url = "https://github.com/howeyc/gopass"; + rev = "bf9dde6d0d2c004a008c27aaee91170c786f6db8"; + sha256 = "1jxzyfnqi0h1fzlsvlkn10bncic803bfhslyijcxk55mgh297g45"; + }; + } + { + goPackagePath = "github.com/sternhenri/interact"; + fetch = { + type = "git"; + url = "https://github.com/sternhenri/interact"; + rev = "dfeb9ef2030483f98cee2c86f5775fe6c729f10b"; + sha256 = "00b09fyy9zhv11mbzm18ngg765g0gyb23bmr4fc83i09w912if7j"; + }; + } + { + goPackagePath = "golang.org/x/sys"; + fetch = { + type = "git"; + url = "https://go.googlesource.com/sys"; + rev = "04f50cda93cbb67f2afa353c52f342100e80e625"; + sha256 = "0hmfsz9y1ingwsn482hlzzmzs7kr3cklm0ana0mbdk70isw2bxnw"; + }; + } + { + goPackagePath = "golang.org/x/crypto"; + fetch = { + type = "git"; + url = "https://github.com/StanfordSNR/crypto"; + rev = "e451cabda2acd7a416728ee89b75975b8b0c90d7"; + sha256 = "0aj6fc0i1dm6rdgr1mlv2pl4s0i6sj821k2p4gig45h5mn06mhpz"; + }; + } + { + goPackagePath = "github.com/jessevdk/go-flags"; + fetch = { + type = "git"; + url = "https://github.com/jessevdk/go-flags"; + rev = "c0795c8afcf41dd1d786bebce68636c199b3bb45"; + sha256 = "0xsmr17mrpm9kx34zfzzirwy0n459h975x49p41fs2f6ly6lk9vp"; + }; + } + +] diff --git a/nixpkgs/pkgs/tools/networking/gupnp-tools/default.nix b/nixpkgs/pkgs/tools/networking/gupnp-tools/default.nix new file mode 100644 index 000000000000..c1861e33c081 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/gupnp-tools/default.nix @@ -0,0 +1,58 @@ +{ lib, stdenv +, fetchurl +, meson +, ninja +, gupnp +, gssdp +, pkg-config +, gtk3 +, libuuid +, gettext +, gupnp-av +, gtksourceview4 +, gnome +, wrapGAppsHook +}: + +stdenv.mkDerivation rec { + pname = "gupnp-tools"; + version = "0.10.0"; + + src = fetchurl { + url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz"; + sha256 = "13d1qr1avz9r76989nvgxhhclmqzr025xjk4rfnja94fpbspznj1"; + }; + + nativeBuildInputs = [ + meson + ninja + pkg-config + gettext + wrapGAppsHook + ]; + + buildInputs = [ + gupnp + libuuid + gssdp + gtk3 + gupnp-av + gtksourceview4 + gnome.adwaita-icon-theme + ]; + + passthru = { + updateScript = gnome.updateScript { + packageName = pname; + versionPolicy = "odd-unstable"; + }; + }; + + meta = with lib; { + description = "Set of utilities and demos to work with UPnP"; + homepage = "https://wiki.gnome.org/Projects/GUPnP"; + license = licenses.gpl2Plus; + maintainers = teams.gnome.members; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/gvpe/default.nix b/nixpkgs/pkgs/tools/networking/gvpe/default.nix new file mode 100644 index 000000000000..59748f6f9676 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/gvpe/default.nix @@ -0,0 +1,34 @@ +{ lib, stdenv, fetchurl, openssl, gmp, zlib, iproute2, nettools }: + +stdenv.mkDerivation rec { + pname = "gvpe"; + version = "3.0"; + + src = fetchurl { + url = "https://ftp.gnu.org/gnu/gvpe/gvpe-${version}.tar.gz"; + sha256 = "1v61mj25iyd91z0ir7cmradkkcm1ffbk52c96v293ibsvjs2s2hf"; + }; + + patches = [ ./gvpe-3.0-glibc-2.26.patch ]; + + buildInputs = [ openssl gmp zlib ]; + + configureFlags = [ + "--enable-tcp" + "--enable-http-proxy" + "--enable-dns" + ]; + + preBuild = '' + sed -e 's@"/sbin/ifconfig.*"@"${iproute2}/sbin/ip link set $IFNAME address $MAC mtu $MTU"@' -i src/device-linux.C + sed -e 's@/sbin/ifconfig@${nettools}/sbin/ifconfig@g' -i src/device-*.C + ''; + + meta = with lib; { + description = "A protected multinode virtual network"; + homepage = "http://software.schmorp.de/pkg/gvpe.html"; + maintainers = [ maintainers.raskin ]; + platforms = with platforms; linux ++ freebsd; + license = licenses.gpl2; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/gvpe/gvpe-3.0-glibc-2.26.patch b/nixpkgs/pkgs/tools/networking/gvpe/gvpe-3.0-glibc-2.26.patch new file mode 100644 index 000000000000..9cfb6472c4e1 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/gvpe/gvpe-3.0-glibc-2.26.patch @@ -0,0 +1,18 @@ +diff --git a/lib/getopt.h b/lib/getopt.h +index 2d02142..5e7d8d4 100644 +--- a/lib/getopt.h ++++ b/lib/getopt.h +@@ -101,13 +101,6 @@ struct option + #define optional_argument 2 + + #if defined (__STDC__) && __STDC__ +-#ifdef __GNU_LIBRARY__ +-/* Many other libraries have conflicting prototypes for getopt, with +- differences in the consts, in stdlib.h. To avoid compilation +- errors, only prototype getopt for the GNU C library. */ +-extern int getopt (int argc, char *const *argv, const char *shortopts); +-#else /* not __GNU_LIBRARY__ */ +-#endif /* __GNU_LIBRARY__ */ + extern int getopt_long (int argc, char *const *argv, const char *shortopts, + const struct option *longopts, int *longind); + extern int getopt_long_only (int argc, char *const *argv, diff --git a/nixpkgs/pkgs/tools/networking/hans/default.nix b/nixpkgs/pkgs/tools/networking/hans/default.nix new file mode 100644 index 000000000000..04271d6ef710 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/hans/default.nix @@ -0,0 +1,38 @@ +{ lib, stdenv, fetchFromGitHub, nettools }: + +stdenv.mkDerivation rec { + pname = "hans"; + version = "1.0"; + + src = fetchFromGitHub { + sha256 = "1qnfl7wr5x937b6jx3vhhvnwnrclrqvq7d7zxbfhk74pdwnjy8n4"; + rev = "v${version}"; + repo = "hans"; + owner = "friedrich"; + }; + + buildInputs = [ nettools ]; + + postPatch = '' + substituteInPlace src/tun.cpp --replace "/sbin/" "${nettools}/bin/" + ''; + + enableParallelBuilding = true; + + installPhase = '' + install -D -m0755 hans $out/bin/hans + ''; + + meta = with lib; { + description = "Tunnel IPv4 over ICMP"; + longDescription = '' + Hans makes it possible to tunnel IPv4 through ICMP echo packets, so you + could call it a ping tunnel. This can be useful when you find yourself in + the situation that your Internet access is firewalled, but pings are + allowed. + ''; + homepage = "https://code.gerade.org/hans/"; + license = licenses.gpl3Plus; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/haproxy/default.nix b/nixpkgs/pkgs/tools/networking/haproxy/default.nix new file mode 100644 index 000000000000..bb79ad956a67 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/haproxy/default.nix @@ -0,0 +1,72 @@ +{ useLua ? !stdenv.isDarwin +, usePcre ? true +, withPrometheusExporter ? true +, stdenv, lib, fetchurl, nixosTests +, openssl, zlib +, lua5_3 ? null, pcre ? null, systemd ? null +}: + +assert useLua -> lua5_3 != null; +assert usePcre -> pcre != null; + +stdenv.mkDerivation rec { + pname = "haproxy"; + version = "2.3.10"; + + src = fetchurl { + url = "https://www.haproxy.org/download/${lib.versions.majorMinor version}/src/${pname}-${version}.tar.gz"; + sha256 = "sha256-mUbgz8g/KQcrNDHjckYiHPnUqdKKFYwHVxTTRSZvTzU="; + }; + + buildInputs = [ openssl zlib ] + ++ lib.optional useLua lua5_3 + ++ lib.optional usePcre pcre + ++ lib.optional stdenv.isLinux systemd; + + # TODO: make it work on bsd as well + makeFlags = [ + "PREFIX=\${out}" + ("TARGET=" + (if stdenv.isSunOS then "solaris" + else if stdenv.isLinux then "linux-glibc" + else if stdenv.isDarwin then "osx" + else "generic")) + ]; + + buildFlags = [ + "USE_OPENSSL=yes" + "USE_ZLIB=yes" + ] ++ lib.optionals usePcre [ + "USE_PCRE=yes" + "USE_PCRE_JIT=yes" + ] ++ lib.optionals useLua [ + "USE_LUA=yes" + "LUA_LIB_NAME=lua" + "LUA_LIB=${lua5_3}/lib" + "LUA_INC=${lua5_3}/include" + ] ++ lib.optionals stdenv.isLinux [ + "USE_SYSTEMD=yes" + "USE_GETADDRINFO=1" + ] ++ lib.optionals withPrometheusExporter [ + "EXTRA_OBJS=contrib/prometheus-exporter/service-prometheus.o" + ] ++ [ "CC=${stdenv.cc.targetPrefix}cc" ]; + + enableParallelBuilding = true; + + passthru.tests.haproxy = nixosTests.haproxy; + + meta = with lib; { + description = "Reliable, high performance TCP/HTTP load balancer"; + longDescription = '' + HAProxy is a free, very fast and reliable solution offering high + availability, load balancing, and proxying for TCP and HTTP-based + applications. It is particularly suited for web sites crawling under very + high loads while needing persistence or Layer7 processing. Supporting + tens of thousands of connections is clearly realistic with todays + hardware. + ''; + homepage = "https://haproxy.org"; + license = licenses.gpl2; + maintainers = with maintainers; [ fuzzy-id ]; + platforms = with platforms; linux ++ darwin; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/hey/default.nix b/nixpkgs/pkgs/tools/networking/hey/default.nix new file mode 100644 index 000000000000..edf91dd311d9 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/hey/default.nix @@ -0,0 +1,24 @@ +{ buildGoModule, lib, fetchFromGitHub }: + +buildGoModule rec { + pname = "hey"; + version = "0.1.4"; + + src = fetchFromGitHub { + owner = "rakyll"; + repo = pname; + rev = "v${version}"; + sha256 = "0gsdksrzlwpba14a43ayyy41l1hxpw4ayjpvqyd4ycakddlkvgzb"; + }; + + vendorSha256 = null; + + doCheck = false; + + meta = with lib; { + description = "HTTP load generator, ApacheBench (ab) replacement"; + homepage = "https://github.com/rakyll/hey"; + license = licenses.asl20; + maintainers = with maintainers; [ Br1ght0ne ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/horst/default.nix b/nixpkgs/pkgs/tools/networking/horst/default.nix new file mode 100644 index 000000000000..194365130bf3 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/horst/default.nix @@ -0,0 +1,26 @@ +{lib, stdenv, fetchFromGitHub, pkg-config, ncurses, libnl }: + +stdenv.mkDerivation rec { + pname = "horst"; + version = "5.1"; + + src = fetchFromGitHub { + owner = "br101"; + repo = "horst"; + rev = "v${version}"; + sha256 = "140pyv6rlsh4c745w4b59pz3hrarr39qq3mz9z1lsd3avc12nx1a"; + }; + + nativeBuildInputs = [ pkg-config ]; + buildInputs = [ ncurses libnl ]; + + installFlags = [ "DESTDIR=${placeholder "out"}" ]; + + meta = with lib; { + description = "Small and lightweight IEEE802.11 wireless LAN analyzer with a text interface"; + homepage = "http://br1.einfach.org/tech/horst/"; + maintainers = [ maintainers.fpletz ]; + license = licenses.gpl3; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/hping/default.nix b/nixpkgs/pkgs/tools/networking/hping/default.nix new file mode 100644 index 000000000000..97b45c64ee24 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/hping/default.nix @@ -0,0 +1,41 @@ +{ lib, stdenv, fetchFromGitHub, libpcap, withTcl ? true, tcl }: + +stdenv.mkDerivation rec { + pname = "hping"; + version = "2014-12-26"; + + src = fetchFromGitHub { + owner = "antirez"; + repo = pname; + rev = "3547c7691742c6eaa31f8402e0ccbb81387c1b99"; # there are no tags/releases + sha256 = "0y0n1ybij3yg9lfgzcwfmjz1sjg913zcqrv391xx83dm0j80sdpb"; + }; + + buildInputs = [ libpcap ] ++ lib.optional withTcl tcl; + + postPatch = '' + substituteInPlace Makefile.in --replace "gcc" "$CC" + substituteInPlace version.c --replace "RELEASE_DATE" "\"$version\"" + '' + lib.optionalString stdenv.isLinux '' + sed -i -e 's|#include <net/bpf.h>|#include <pcap/bpf.h>|' \ + libpcap_stuff.c script.c + ''; + + configureFlags = [ (if withTcl then "TCLSH=${tcl}/bin/tclsh" else "--no-tcl") ]; + + installPhase = '' + install -Dm755 hping3 -t $out/sbin + ln -s $out/sbin/hping3 $out/sbin/hping + ln -s $out/sbin/hping3 $out/sbin/hping2 + install -Dm644 docs/hping3.8 -t $out/share/man/man8 + ln -s hping3.8.gz $out/share/man/man8/hping.8.gz + ln -s hping3.8.gz $out/share/man/man8/hping2.8.gz + ''; + + meta = with lib; { + description = "A command-line oriented TCP/IP packet assembler/analyzer"; + homepage = "http://www.hping.org/"; + license = licenses.gpl2Only; + platforms = platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/hss/default.nix b/nixpkgs/pkgs/tools/networking/hss/default.nix new file mode 100644 index 000000000000..77f96113decf --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/hss/default.nix @@ -0,0 +1,34 @@ +{ lib, buildRubyGem, ruby, openssh }: + +# Example ~/.hss.yml +#--- +#patterns: +# - note: Basic test +# example: g -> github +# short: '^g$' +# long: 'git@github.com' + +buildRubyGem rec { + name = "hss-${version}"; + inherit ruby; + gemName = "hss"; + version = "1.0.1"; + source.sha256 = "0hdfpxxqsh6gisn8mm0knsl1aig9fir0h2x9sirk3gr36qbz5xa4"; + + postInstall = '' + substituteInPlace $GEM_HOME/gems/${gemName}-${version}/bin/hss \ + --replace \ + "'ssh'" \ + "'${openssh}/bin/ssh'" + ''; + + meta = with lib; { + description = '' + A SSH helper that uses regex and fancy expansion to dynamically manage SSH shortcuts. + ''; + homepage = "https://github.com/akerl/hss"; + license = licenses.mit; + maintainers = with maintainers; [ nixy ]; + platforms = platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/htpdate/default.nix b/nixpkgs/pkgs/tools/networking/htpdate/default.nix new file mode 100644 index 000000000000..cd2b3a18d421 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/htpdate/default.nix @@ -0,0 +1,26 @@ +{ lib, stdenv, fetchurl }: + +stdenv.mkDerivation rec { + version = "1.2.2"; + pname = "htpdate"; + + src = fetchurl { + url = "http://www.vervest.org/htp/archive/c/${pname}-${version}.tar.xz"; + sha256 = "0mgr350qwgzrdrwkb9kaj6z7l6hn6a2pwh7sacqvnal5fyc9a7sz"; + }; + + makeFlags = [ + "INSTALL=install" + "STRIP=${stdenv.cc.bintools.targetPrefix}strip" + "prefix=$(out)" + ]; + + enableParallelBuilding = true; + + meta = with lib; { + description = "Utility to fetch time and set the system clock over HTTP"; + homepage = "http://www.vervest.org/htp/"; + platforms = platforms.linux; + license = licenses.gpl2Plus; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/http-prompt/default.nix b/nixpkgs/pkgs/tools/networking/http-prompt/default.nix new file mode 100644 index 000000000000..3732fbd879f5 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/http-prompt/default.nix @@ -0,0 +1,34 @@ +{ lib, fetchFromGitHub, python3Packages, httpie }: + +python3Packages.buildPythonApplication rec { + pname = "http-prompt"; + version = "1.0.0"; + + src = fetchFromGitHub { + rev = "v${version}"; + repo = "http-prompt"; + owner = "eliangcs"; + sha256 = "0kngz2izcqjphbrdkg489p0xmf65xjc8ki1a2szcc8sgwc7z74xy"; + }; + + propagatedBuildInputs = with python3Packages; [ + click + httpie + parsimonious + (python.pkgs.callPackage ../../../development/python-modules/prompt_toolkit/1.nix {}) + pygments + six + ]; + + checkPhase = '' + $out/bin/${pname} --version | grep -q "${version}" + ''; + + meta = with lib; { + description = "An interactive command-line HTTP client featuring autocomplete and syntax highlighting"; + homepage = "https://github.com/eliangcs/http-prompt"; + license = licenses.mit; + maintainers = with maintainers; [ matthiasbeyer ]; + platforms = platforms.linux ++ platforms.darwin; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/http2tcp/default.nix b/nixpkgs/pkgs/tools/networking/http2tcp/default.nix new file mode 100644 index 000000000000..b1f3c704b1fa --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/http2tcp/default.nix @@ -0,0 +1,47 @@ +{ lib +, python3 +, stdenv +, fetchurl +}: + +stdenv.mkDerivation rec { + pname = "http2tcp"; + version = "0.5"; + + src = fetchurl { + url = "https://www.linta.de/~aehlig/http2tcp/${pname}-${version}.tar.gz"; + sha256 = "34fb83c091689dee398ca80db76487e0c39abb17cef390d845ffd888009a5caa"; + }; + + buildInputs = [ + (python3.withPackages (ps: [ + ps.wsgitools + ])) + ]; + + dontBuild = true; + + installPhase = '' + mkdir -p $out/{bin,share/${pname}} + cp http2tcp* $out/bin + cp Protocol $out/share/${pname}/ + ''; + + meta = with lib; { + maintainers = with maintainers; [ clkamp ]; + description = "A tool for tunneling TCP connections via HTTP GET requests"; + longDescription = '' + The http2tcp tools allow to tunnel tcp connections (presumably + ssh) via syntactically correct http requests. It is designed to + work in the presence of so-called "transparent" + store-and-forward proxies disallowing POST requests. + + It also turned out to be useful to stabilise connections where + the client's internet connection is unreliable (frequent long + network outages, rapidly changing IP address, etc). + ''; + homepage = "https://www.linta.de/~aehlig/http2tcp/"; + license = licenses.bsd3; + platforms = platforms.all; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/httperf/default.nix b/nixpkgs/pkgs/tools/networking/httperf/default.nix new file mode 100644 index 000000000000..975b050de7e3 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/httperf/default.nix @@ -0,0 +1,37 @@ +{ lib, stdenv, fetchFromGitHub, autoreconfHook, openssl }: + +stdenv.mkDerivation rec { + pname = "httperf"; + version = "0.9.1"; + + src = fetchFromGitHub { + repo = pname; + owner = pname; + rev = "3209c7f9b15069d4b79079e03bafba5b444569ff"; + sha256 = "0p48z9bcpdjq3nsarl26f0xbxmqgw42k5qmfy8wv5bcrz6b3na42"; + }; + + nativeBuildInputs = [ autoreconfHook ]; + propagatedBuildInputs = [ openssl ]; + + configurePhase = '' + autoreconf -i + mkdir -pv build + cd build + ../configure + ''; + + installPhase = '' + mkdir -vp $out/bin + mv -v src/httperf $out/bin + ''; + + meta = with lib; { + description = "The httperf HTTP load generator"; + homepage = "https://github.com/httperf/httperf"; + maintainers = with maintainers; [ ]; + license = licenses.gpl2; + platforms = platforms.all; + }; + +} diff --git a/nixpkgs/pkgs/tools/networking/httpie/default.nix b/nixpkgs/pkgs/tools/networking/httpie/default.nix new file mode 100644 index 000000000000..a7ecabe8e627 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/httpie/default.nix @@ -0,0 +1,93 @@ +{ lib, fetchFromGitHub, python3Packages, docutils }: + +python3Packages.buildPythonApplication rec { + pname = "httpie"; + version = "2.4.0"; + + src = fetchFromGitHub { + owner = "httpie"; + repo = "httpie"; + rev = version; + sha256 = "00lafjqg9nfnak0nhcr2l2hzzkwn2y6qv0wdkm6r6f69snizy3hf"; + }; + + patches = [ + ./strip-venv.patch + ]; + + outputs = [ "out" "doc" "man" ]; + + nativeBuildInputs = [ docutils ]; + + propagatedBuildInputs = with python3Packages; [ pygments requests requests-toolbelt setuptools ]; + + checkInputs = with python3Packages; [ + mock + pytest + pytest-httpbin + pytestCheckHook + ]; + + postInstall = '' + # install completions + install -Dm555 \ + extras/httpie-completion.bash \ + $out/share/bash-completion/completions/http.bash + install -Dm555 \ + extras/httpie-completion.fish \ + $out/share/fish/vendor_completions.d/http.fish + + mkdir -p $man/share/man/man1 + + docdir=$doc/share/doc/httpie + mkdir -p $docdir/html + + cp AUTHORS.rst CHANGELOG.rst CONTRIBUTING.rst $docdir + + # helpfully, the readme has a `no-web` class to exclude + # the parts that are not relevant for offline docs + + # this one build link was not marked however + sed -e 's/^|build|//g' -i README.rst + + toHtml() { + rst2html5 \ + --strip-elements-with-class=no-web \ + --title=http \ + --no-generator \ + --no-datestamp \ + --no-source-link \ + "$1" \ + "$2" + } + + toHtml README.rst $docdir/html/index.html + toHtml CHANGELOG.rst $docdir/html/CHANGELOG.html + toHtml CONTRIBUTING.rst $docdir/html/CONTRIBUTING.html + + rst2man \ + --strip-elements-with-class=no-web \ + --title=http \ + --no-generator \ + --no-datestamp \ + --no-source-link \ + README.rst \ + $man/share/man/man1/http.1 + ''; + + # the tests call rst2pseudoxml.py from docutils + preCheck = '' + export PATH=${docutils}/bin:$PATH + ''; + + checkPhase = '' + py.test ./httpie ./tests --doctest-modules --verbose ./httpie ./tests -k 'not test_chunked and not test_verbose_chunked and not test_multipart_chunked and not test_request_body_from_file_by_path_chunked' + ''; + + meta = with lib; { + description = "A command line HTTP client whose goal is to make CLI human-friendly"; + homepage = "https://httpie.org/"; + license = licenses.bsd3; + maintainers = with maintainers; [ antono relrod schneefux SuperSandro2000 ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/httpie/strip-venv.patch b/nixpkgs/pkgs/tools/networking/httpie/strip-venv.patch new file mode 100644 index 000000000000..9cfddbfdf78f --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/httpie/strip-venv.patch @@ -0,0 +1,22 @@ +diff --git a/tests/test_docs.py b/tests/test_docs.py +index 340e64d..a6b4dc9 100644 +--- a/tests/test_docs.py ++++ b/tests/test_docs.py +@@ -42,15 +42,10 @@ assert filenames + # HACK: hardcoded paths, venv should be irrelevant, etc. + # TODO: simplify by using the Python API instead of a subprocess + # then we wont’t need the paths. +-VENV_BIN = Path(__file__).parent.parent / 'venv/bin' +-VENV_PYTHON = VENV_BIN / 'python' +-VENV_RST2PSEUDOXML = VENV_BIN / 'rst2pseudoxml.py' ++VENV_PYTHON = 'python' ++VENV_RST2PSEUDOXML = 'rst2pseudoxml.py' + + +-@pytest.mark.skipif( +- not VENV_RST2PSEUDOXML.exists(), +- reason='docutils not installed', +-) + @pytest.mark.parametrize('filename', filenames) + def test_rst_file_syntax(filename): + p = subprocess.Popen( diff --git a/nixpkgs/pkgs/tools/networking/httping/default.nix b/nixpkgs/pkgs/tools/networking/httping/default.nix new file mode 100644 index 000000000000..7389c78ef8db --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/httping/default.nix @@ -0,0 +1,34 @@ +{ lib, stdenv, fetchurl, gettext, libintl, ncurses, openssl +, fftw ? null }: + +stdenv.mkDerivation rec { + pname = "httping"; + version = "2.5"; + + src = fetchurl { + url = "https://vanheusden.com/httping/${pname}-${version}.tgz"; + sha256 = "1y7sbgkhgadmd93x1zafqc4yp26ssiv16ni5bbi9vmvvdl55m29y"; + }; + + buildInputs = [ fftw libintl ncurses openssl ]; + nativeBuildInputs = [ gettext ]; + + makeFlags = [ + "DESTDIR=$(out)" + "PREFIX=" + ]; + + meta = with lib; { + homepage = "https://vanheusden.com/httping"; + description = "ping with HTTP requests"; + longDescription = '' + Give httping an url, and it'll show you how long it takes to connect, + send a request and retrieve the reply (only the headers). Be aware that + the transmission across the network also takes time! So it measures the + latency of the webserver + network. It supports IPv6. + ''; + license = licenses.agpl3; + maintainers = []; + platforms = platforms.linux ++ platforms.darwin; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/httplab/default.nix b/nixpkgs/pkgs/tools/networking/httplab/default.nix new file mode 100644 index 000000000000..40851d370c79 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/httplab/default.nix @@ -0,0 +1,23 @@ +{ lib, buildGoPackage, fetchFromGitHub }: + +buildGoPackage rec { + pname = "httplab"; + version = "0.4.0"; + rev = "v${version}"; + + goPackagePath = "github.com/gchaincl/httplab"; + + src = fetchFromGitHub { + owner = "gchaincl"; + repo = "httplab"; + inherit rev; + sha256 = "0442nnpxyfl2gi9pilv7q6cxs2cd98wblg8d4nw6dx98yh4h99zs"; + }; + + meta = with lib; { + homepage = "https://github.com/gchaincl/httplab"; + description = "Interactive WebServer"; + license = licenses.mit; + maintainers = with maintainers; [ pradeepchhetri ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/httplz/cargo-lock.patch b/nixpkgs/pkgs/tools/networking/httplz/cargo-lock.patch new file mode 100644 index 000000000000..293d65f7a238 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/httplz/cargo-lock.patch @@ -0,0 +1,1275 @@ +diff --git a/Cargo.lock b/Cargo.lock +new file mode 100644 +index 0000000..722bfbd +--- /dev/null ++++ b/Cargo.lock +@@ -0,0 +1,1269 @@ ++# This file is automatically @generated by Cargo. ++# It is not intended for manual editing. ++[[package]] ++name = "adler32" ++version = "1.0.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "5d2e7343e7fc9de883d1b0341e0b13970f764c14101234857d2ddafa1cb1cac2" ++ ++[[package]] ++name = "aho-corasick" ++version = "0.7.10" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "8716408b8bc624ed7f65d223ddb9ac2d044c0547b6fa4b0d554f3a9540496ada" ++dependencies = [ ++ "memchr", ++] ++ ++[[package]] ++name = "ansi_term" ++version = "0.11.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" ++dependencies = [ ++ "winapi", ++] ++ ++[[package]] ++name = "antidote" ++version = "1.0.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "34fde25430d87a9388dadbe6e34d7f72a462c8b43ac8d309b42b0a8505d7e2a5" ++ ++[[package]] ++name = "atty" ++version = "0.2.14" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" ++dependencies = [ ++ "hermit-abi", ++ "libc", ++ "winapi", ++] ++ ++[[package]] ++name = "autocfg" ++version = "0.1.7" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "1d49d90015b3c36167a20fe2810c5cd875ad504b39cff3d4eae7977e6b7c1cb2" ++ ++[[package]] ++name = "autocfg" ++version = "1.0.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d" ++ ++[[package]] ++name = "base64" ++version = "0.9.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "489d6c0ed21b11d038c31b6ceccca973e65d73ba3bd8ecb9a2babf5546164643" ++dependencies = [ ++ "byteorder", ++ "safemem", ++] ++ ++[[package]] ++name = "base64" ++version = "0.10.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "0b25d992356d2eb0ed82172f5248873db5560c4721f564b13cb5193bda5e668e" ++dependencies = [ ++ "byteorder", ++] ++ ++[[package]] ++name = "bitflags" ++version = "1.2.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" ++ ++[[package]] ++name = "bitstring" ++version = "0.1.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "3e54f7b7a46d7b183eb41e2d82965261fa8a1597c68b50aced268ee1fc70272d" ++ ++[[package]] ++name = "brotli-sys" ++version = "0.3.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "4445dea95f4c2b41cde57cc9fee236ae4dbae88d8fcbdb4750fc1bb5d86aaecd" ++dependencies = [ ++ "cc", ++ "libc", ++] ++ ++[[package]] ++name = "brotli2" ++version = "0.3.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "0cb036c3eade309815c15ddbacec5b22c4d1f3983a774ab2eac2e3e9ea85568e" ++dependencies = [ ++ "brotli-sys", ++ "libc", ++] ++ ++[[package]] ++name = "byteorder" ++version = "1.3.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" ++ ++[[package]] ++name = "bzip2" ++version = "0.3.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "42b7c3cbf0fa9c1b82308d57191728ca0256cb821220f4e2fd410a72ade26e3b" ++dependencies = [ ++ "bzip2-sys", ++ "libc", ++] ++ ++[[package]] ++name = "bzip2-sys" ++version = "0.1.8+1.0.8" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "05305b41c5034ff0e93937ac64133d109b5a2660114ec45e9760bc6816d83038" ++dependencies = [ ++ "cc", ++ "libc", ++] ++ ++[[package]] ++name = "cc" ++version = "1.0.52" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "c3d87b23d6a92cd03af510a5ade527033f6aa6fa92161e2d5863a907d4c5e31d" ++ ++[[package]] ++name = "cfg-if" ++version = "0.1.10" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" ++ ++[[package]] ++name = "cidr" ++version = "0.1.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "2da1cf0f275bb8dc1867a7f40cdb3b746951db73a183048e6e37fa89ed81bd01" ++dependencies = [ ++ "bitstring", ++] ++ ++[[package]] ++name = "clap" ++version = "2.33.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "5067f5bb2d80ef5d68b4c87db81601f0b75bca627bc2ef76b141d7b846a3c6d9" ++dependencies = [ ++ "ansi_term", ++ "atty", ++ "bitflags", ++ "strsim", ++ "textwrap", ++ "unicode-width", ++ "vec_map", ++] ++ ++[[package]] ++name = "cloudabi" ++version = "0.0.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" ++dependencies = [ ++ "bitflags", ++] ++ ++[[package]] ++name = "core-foundation" ++version = "0.7.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "57d24c7a13c43e870e37c1556b74555437870a04514f7685f5b354e090567171" ++dependencies = [ ++ "core-foundation-sys", ++ "libc", ++] ++ ++[[package]] ++name = "core-foundation-sys" ++version = "0.7.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "b3a71ab494c0b5b860bdc8407ae08978052417070c2ced38573a9157ad75b8ac" ++ ++[[package]] ++name = "crc32fast" ++version = "1.2.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ba125de2af0df55319f41944744ad91c71113bf74a4646efff39afe1f6842db1" ++dependencies = [ ++ "cfg-if", ++] ++ ++[[package]] ++name = "ctrlc" ++version = "3.1.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "7a4ba686dff9fa4c1c9636ce1010b0cf98ceb421361b0bb3d6faeec43bd217a7" ++dependencies = [ ++ "nix", ++ "winapi", ++] ++ ++[[package]] ++name = "dtoa" ++version = "0.4.5" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "4358a9e11b9a09cf52383b451b49a169e8d797b68aa02301ff586d70d9661ea3" ++ ++[[package]] ++name = "either" ++version = "1.5.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "bb1f6b1ce1c140482ea30ddd3335fc0024ac7ee112895426e0a629a6c20adfe3" ++ ++[[package]] ++name = "embed-resource" ++version = "1.3.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "1f6b0b4403da80c2fd32333937dd468292c001d778c587ae759b75432772715d" ++dependencies = [ ++ "vswhom", ++ "winreg", ++] ++ ++[[package]] ++name = "flate2" ++version = "1.0.14" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "2cfff41391129e0a856d6d822600b8d71179d46879e310417eb9c762eb178b42" ++dependencies = [ ++ "cfg-if", ++ "crc32fast", ++ "libc", ++ "miniz_oxide", ++] ++ ++[[package]] ++name = "foreign-types" ++version = "0.3.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" ++dependencies = [ ++ "foreign-types-shared", ++] ++ ++[[package]] ++name = "foreign-types-shared" ++version = "0.1.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" ++ ++[[package]] ++name = "fuchsia-cprng" ++version = "0.1.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" ++ ++[[package]] ++name = "gcc" ++version = "0.3.55" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "8f5f3913fa0bfe7ee1fd8248b6b9f42a5af4b9d65ec2dd2c3c26132b950ecfc2" ++ ++[[package]] ++name = "getrandom" ++version = "0.1.14" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "7abc8dd8451921606d809ba32e95b6111925cd2906060d2dcc29c070220503eb" ++dependencies = [ ++ "cfg-if", ++ "libc", ++ "wasi", ++] ++ ++[[package]] ++name = "hermit-abi" ++version = "0.1.11" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "8a0d737e0f947a1864e93d33fdef4af8445a00d1ed8dc0c8ddb73139ea6abf15" ++dependencies = [ ++ "libc", ++] ++ ++[[package]] ++name = "httparse" ++version = "1.3.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "cd179ae861f0c2e53da70d892f5f3029f9594be0c41dc5269cd371691b1dc2f9" ++ ++[[package]] ++name = "https" ++version = "1.9.2" ++dependencies = [ ++ "base64 0.10.1", ++ "brotli2", ++ "bzip2", ++ "cc", ++ "cidr", ++ "clap", ++ "ctrlc", ++ "embed-resource", ++ "flate2", ++ "hyper-native-tls", ++ "iron", ++ "itertools", ++ "lazy_static", ++ "lazysort", ++ "libc", ++ "md6", ++ "mime_guess", ++ "os-str-generic", ++ "percent-encoding 2.1.0", ++ "rand 0.7.3", ++ "regex", ++ "rfsapi", ++ "serde", ++ "serde_json", ++ "tabwriter", ++ "time", ++ "trivial_colours", ++ "unicase 2.6.0", ++ "walkdir", ++ "winapi", ++ "xml-rs", ++] ++ ++[[package]] ++name = "hyper" ++version = "0.10.16" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "0a0652d9a2609a968c14be1a9ea00bf4b1d64e2e1f53a1b51b6fff3a6e829273" ++dependencies = [ ++ "base64 0.9.3", ++ "httparse", ++ "language-tags", ++ "log 0.3.9", ++ "mime", ++ "num_cpus", ++ "time", ++ "traitobject", ++ "typeable", ++ "unicase 1.4.2", ++ "url", ++] ++ ++[[package]] ++name = "hyper-native-tls" ++version = "0.3.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "6d375598f442742b0e66208ee12501391f1c7ac0bafb90b4fe53018f81f06068" ++dependencies = [ ++ "antidote", ++ "hyper", ++ "native-tls", ++] ++ ++[[package]] ++name = "idna" ++version = "0.1.5" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "38f09e0f0b1fb55fdee1f17470ad800da77af5186a1a76c026b679358b7e844e" ++dependencies = [ ++ "matches", ++ "unicode-bidi", ++ "unicode-normalization", ++] ++ ++[[package]] ++name = "iron" ++version = "0.6.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "c6d308ca2d884650a8bf9ed2ff4cb13fbb2207b71f64cda11dc9b892067295e8" ++dependencies = [ ++ "hyper", ++ "hyper-native-tls", ++ "log 0.3.9", ++ "mime_guess", ++ "modifier", ++ "num_cpus", ++ "plugin", ++ "typemap", ++ "url", ++] ++ ++[[package]] ++name = "itertools" ++version = "0.8.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "f56a2d0bc861f9165be4eb3442afd3c236d8a98afd426f65d92324ae1091a484" ++dependencies = [ ++ "either", ++] ++ ++[[package]] ++name = "itoa" ++version = "0.3.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "8324a32baf01e2ae060e9de58ed0bc2320c9a2833491ee36cd3b4c414de4db8c" ++ ++[[package]] ++name = "language-tags" ++version = "0.2.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "a91d884b6667cd606bb5a69aa0c99ba811a115fc68915e7056ec08a46e93199a" ++ ++[[package]] ++name = "lazy_static" ++version = "1.4.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" ++ ++[[package]] ++name = "lazysort" ++version = "0.2.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "d0e22ff43b231e0e2f87d74984e53ebc73b90ae13397e041214fb07efc64168f" ++ ++[[package]] ++name = "libc" ++version = "0.2.69" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "99e85c08494b21a9054e7fe1374a732aeadaff3980b6990b94bfd3a70f690005" ++ ++[[package]] ++name = "log" ++version = "0.3.9" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b" ++dependencies = [ ++ "log 0.4.8", ++] ++ ++[[package]] ++name = "log" ++version = "0.4.8" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" ++dependencies = [ ++ "cfg-if", ++] ++ ++[[package]] ++name = "matches" ++version = "0.1.8" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" ++ ++[[package]] ++name = "md6" ++version = "2.0.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "21baf112ff708069b0d0544843236583c9c18675cc1af78ba4ace0f60f63fb31" ++dependencies = [ ++ "gcc", ++ "libc", ++] ++ ++[[package]] ++name = "memchr" ++version = "2.3.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400" ++ ++[[package]] ++name = "mime" ++version = "0.2.6" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ba626b8a6de5da682e1caa06bdb42a335aee5a84db8e5046a3e8ab17ba0a3ae0" ++dependencies = [ ++ "log 0.3.9", ++] ++ ++[[package]] ++name = "mime_guess" ++version = "1.8.8" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "216929a5ee4dd316b1702eedf5e74548c123d370f47841ceaac38ca154690ca3" ++dependencies = [ ++ "mime", ++ "phf", ++ "phf_codegen", ++ "unicase 1.4.2", ++] ++ ++[[package]] ++name = "miniz_oxide" ++version = "0.3.6" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "aa679ff6578b1cddee93d7e82e263b94a575e0bfced07284eb0c037c1d2416a5" ++dependencies = [ ++ "adler32", ++] ++ ++[[package]] ++name = "modifier" ++version = "0.1.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "41f5c9112cb662acd3b204077e0de5bc66305fa8df65c8019d5adb10e9ab6e58" ++ ++[[package]] ++name = "native-tls" ++version = "0.2.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "2b0d88c06fe90d5ee94048ba40409ef1d9315d86f6f38c2efdaad4fb50c58b2d" ++dependencies = [ ++ "lazy_static", ++ "libc", ++ "log 0.4.8", ++ "openssl", ++ "openssl-probe", ++ "openssl-sys", ++ "schannel", ++ "security-framework", ++ "security-framework-sys", ++ "tempfile", ++] ++ ++[[package]] ++name = "nix" ++version = "0.17.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "50e4785f2c3b7589a0d0c1dd60285e1188adac4006e8abd6dd578e1567027363" ++dependencies = [ ++ "bitflags", ++ "cc", ++ "cfg-if", ++ "libc", ++ "void", ++] ++ ++[[package]] ++name = "num-traits" ++version = "0.1.43" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "92e5113e9fd4cc14ded8e499429f396a20f98c772a47cc8622a736e1ec843c31" ++dependencies = [ ++ "num-traits 0.2.11", ++] ++ ++[[package]] ++name = "num-traits" ++version = "0.2.11" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "c62be47e61d1842b9170f0fdeec8eba98e60e90e5446449a0545e5152acd7096" ++dependencies = [ ++ "autocfg 1.0.0", ++] ++ ++[[package]] ++name = "num_cpus" ++version = "1.13.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3" ++dependencies = [ ++ "hermit-abi", ++ "libc", ++] ++ ++[[package]] ++name = "openssl" ++version = "0.10.29" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "cee6d85f4cb4c4f59a6a85d5b68a233d280c82e29e822913b9c8b129fbf20bdd" ++dependencies = [ ++ "bitflags", ++ "cfg-if", ++ "foreign-types", ++ "lazy_static", ++ "libc", ++ "openssl-sys", ++] ++ ++[[package]] ++name = "openssl-probe" ++version = "0.1.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "77af24da69f9d9341038eba93a073b1fdaaa1b788221b00a69bce9e762cb32de" ++ ++[[package]] ++name = "openssl-sys" ++version = "0.9.55" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "7717097d810a0f2e2323f9e5d11e71608355e24828410b55b9d4f18aa5f9a5d8" ++dependencies = [ ++ "autocfg 1.0.0", ++ "cc", ++ "libc", ++ "pkg-config", ++ "vcpkg", ++] ++ ++[[package]] ++name = "os-str-generic" ++version = "0.2.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "78f3d620827b89763f54b7f1da3029bd4e0ca7eb1ae61a5c4d3b0bc0dca5157e" ++ ++[[package]] ++name = "percent-encoding" ++version = "1.0.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831" ++ ++[[package]] ++name = "percent-encoding" ++version = "2.1.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" ++ ++[[package]] ++name = "phf" ++version = "0.7.24" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "b3da44b85f8e8dfaec21adae67f95d93244b2ecf6ad2a692320598dcc8e6dd18" ++dependencies = [ ++ "phf_shared", ++] ++ ++[[package]] ++name = "phf_codegen" ++version = "0.7.24" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "b03e85129e324ad4166b06b2c7491ae27fe3ec353af72e72cd1654c7225d517e" ++dependencies = [ ++ "phf_generator", ++ "phf_shared", ++] ++ ++[[package]] ++name = "phf_generator" ++version = "0.7.24" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "09364cc93c159b8b06b1f4dd8a4398984503483891b0c26b867cf431fb132662" ++dependencies = [ ++ "phf_shared", ++ "rand 0.6.5", ++] ++ ++[[package]] ++name = "phf_shared" ++version = "0.7.24" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "234f71a15de2288bcb7e3b6515828d22af7ec8598ee6d24c3b526fa0a80b67a0" ++dependencies = [ ++ "siphasher", ++ "unicase 1.4.2", ++] ++ ++[[package]] ++name = "pkg-config" ++version = "0.3.17" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "05da548ad6865900e60eaba7f589cc0783590a92e940c26953ff81ddbab2d677" ++ ++[[package]] ++name = "plugin" ++version = "0.2.6" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "1a6a0dc3910bc8db877ffed8e457763b317cf880df4ae19109b9f77d277cf6e0" ++dependencies = [ ++ "typemap", ++] ++ ++[[package]] ++name = "ppv-lite86" ++version = "0.2.6" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "74490b50b9fbe561ac330df47c08f3f33073d2d00c150f719147d7c54522fa1b" ++ ++[[package]] ++name = "quote" ++version = "0.3.15" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "7a6e920b65c65f10b2ae65c831a81a073a89edd28c7cce89475bff467ab4167a" ++ ++[[package]] ++name = "rand" ++version = "0.6.5" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "6d71dacdc3c88c1fde3885a3be3fbab9f35724e6ce99467f7d9c5026132184ca" ++dependencies = [ ++ "autocfg 0.1.7", ++ "libc", ++ "rand_chacha 0.1.1", ++ "rand_core 0.4.2", ++ "rand_hc 0.1.0", ++ "rand_isaac", ++ "rand_jitter", ++ "rand_os", ++ "rand_pcg", ++ "rand_xorshift", ++ "winapi", ++] ++ ++[[package]] ++name = "rand" ++version = "0.7.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" ++dependencies = [ ++ "getrandom", ++ "libc", ++ "rand_chacha 0.2.2", ++ "rand_core 0.5.1", ++ "rand_hc 0.2.0", ++] ++ ++[[package]] ++name = "rand_chacha" ++version = "0.1.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "556d3a1ca6600bfcbab7c7c91ccb085ac7fbbcd70e008a98742e7847f4f7bcef" ++dependencies = [ ++ "autocfg 0.1.7", ++ "rand_core 0.3.1", ++] ++ ++[[package]] ++name = "rand_chacha" ++version = "0.2.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" ++dependencies = [ ++ "ppv-lite86", ++ "rand_core 0.5.1", ++] ++ ++[[package]] ++name = "rand_core" ++version = "0.3.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" ++dependencies = [ ++ "rand_core 0.4.2", ++] ++ ++[[package]] ++name = "rand_core" ++version = "0.4.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" ++ ++[[package]] ++name = "rand_core" ++version = "0.5.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" ++dependencies = [ ++ "getrandom", ++] ++ ++[[package]] ++name = "rand_hc" ++version = "0.1.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "7b40677c7be09ae76218dc623efbf7b18e34bced3f38883af07bb75630a21bc4" ++dependencies = [ ++ "rand_core 0.3.1", ++] ++ ++[[package]] ++name = "rand_hc" ++version = "0.2.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" ++dependencies = [ ++ "rand_core 0.5.1", ++] ++ ++[[package]] ++name = "rand_isaac" ++version = "0.1.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ded997c9d5f13925be2a6fd7e66bf1872597f759fd9dd93513dd7e92e5a5ee08" ++dependencies = [ ++ "rand_core 0.3.1", ++] ++ ++[[package]] ++name = "rand_jitter" ++version = "0.1.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "1166d5c91dc97b88d1decc3285bb0a99ed84b05cfd0bc2341bdf2d43fc41e39b" ++dependencies = [ ++ "libc", ++ "rand_core 0.4.2", ++ "winapi", ++] ++ ++[[package]] ++name = "rand_os" ++version = "0.1.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "7b75f676a1e053fc562eafbb47838d67c84801e38fc1ba459e8f180deabd5071" ++dependencies = [ ++ "cloudabi", ++ "fuchsia-cprng", ++ "libc", ++ "rand_core 0.4.2", ++ "rdrand", ++ "winapi", ++] ++ ++[[package]] ++name = "rand_pcg" ++version = "0.1.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "abf9b09b01790cfe0364f52bf32995ea3c39f4d2dd011eac241d2914146d0b44" ++dependencies = [ ++ "autocfg 0.1.7", ++ "rand_core 0.4.2", ++] ++ ++[[package]] ++name = "rand_xorshift" ++version = "0.1.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "cbf7e9e623549b0e21f6e97cf8ecf247c1a8fd2e8a992ae265314300b2455d5c" ++dependencies = [ ++ "rand_core 0.3.1", ++] ++ ++[[package]] ++name = "rdrand" ++version = "0.4.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" ++dependencies = [ ++ "rand_core 0.3.1", ++] ++ ++[[package]] ++name = "redox_syscall" ++version = "0.1.56" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "2439c63f3f6139d1b57529d16bc3b8bb855230c8efcc5d3a896c8bea7c3b1e84" ++ ++[[package]] ++name = "regex" ++version = "1.3.7" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "a6020f034922e3194c711b82a627453881bc4682166cabb07134a10c26ba7692" ++dependencies = [ ++ "aho-corasick", ++ "memchr", ++ "regex-syntax", ++ "thread_local", ++] ++ ++[[package]] ++name = "regex-syntax" ++version = "0.6.17" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "7fe5bd57d1d7414c6b5ed48563a2c855d995ff777729dcd91c369ec7fea395ae" ++ ++[[package]] ++name = "remove_dir_all" ++version = "0.5.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "4a83fa3702a688b9359eccba92d153ac33fd2e8462f9e0e3fdf155239ea7792e" ++dependencies = [ ++ "winapi", ++] ++ ++[[package]] ++name = "rfsapi" ++version = "0.1.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "1b6fbc119d00459f80252adb96e554766d75de071ed5d3c49f46a000d137cd49" ++dependencies = [ ++ "hyper", ++ "mime", ++ "serde", ++ "serde_derive", ++ "time", ++] ++ ++[[package]] ++name = "safemem" ++version = "0.3.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ef703b7cb59335eae2eb93ceb664c0eb7ea6bf567079d843e09420219668e072" ++ ++[[package]] ++name = "same-file" ++version = "1.0.6" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" ++dependencies = [ ++ "winapi-util", ++] ++ ++[[package]] ++name = "schannel" ++version = "0.1.18" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "039c25b130bd8c1321ee2d7de7fde2659fa9c2744e4bb29711cfc852ea53cd19" ++dependencies = [ ++ "lazy_static", ++ "winapi", ++] ++ ++[[package]] ++name = "security-framework" ++version = "0.4.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "3f331b9025654145cd425b9ded0caf8f5ae0df80d418b326e2dc1c3dc5eb0620" ++dependencies = [ ++ "bitflags", ++ "core-foundation", ++ "core-foundation-sys", ++ "libc", ++ "security-framework-sys", ++] ++ ++[[package]] ++name = "security-framework-sys" ++version = "0.4.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "17bf11d99252f512695eb468de5516e5cf75455521e69dfe343f3b74e4748405" ++dependencies = [ ++ "core-foundation-sys", ++ "libc", ++] ++ ++[[package]] ++name = "serde" ++version = "0.9.15" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "34b623917345a631dc9608d5194cc206b3fe6c3554cd1c75b937e55e285254af" ++ ++[[package]] ++name = "serde_codegen_internals" ++version = "0.14.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "bc888bd283bd2420b16ad0d860e35ad8acb21941180a83a189bb2046f9d00400" ++dependencies = [ ++ "syn", ++] ++ ++[[package]] ++name = "serde_derive" ++version = "0.9.15" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "978fd866f4d4872084a81ccc35e275158351d3b9fe620074e7d7504b816b74ba" ++dependencies = [ ++ "quote", ++ "serde_codegen_internals", ++ "syn", ++] ++ ++[[package]] ++name = "serde_json" ++version = "0.9.10" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ad8bcf487be7d2e15d3d543f04312de991d631cfe1b43ea0ade69e6a8a5b16a1" ++dependencies = [ ++ "dtoa", ++ "itoa", ++ "num-traits 0.1.43", ++ "serde", ++] ++ ++[[package]] ++name = "siphasher" ++version = "0.2.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "0b8de496cf83d4ed58b6be86c3a275b8602f6ffe98d3024a869e124147a9a3ac" ++ ++[[package]] ++name = "smallvec" ++version = "1.4.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "c7cb5678e1615754284ec264d9bb5b4c27d2018577fd90ac0ceb578591ed5ee4" ++ ++[[package]] ++name = "strsim" ++version = "0.8.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" ++ ++[[package]] ++name = "syn" ++version = "0.11.11" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "d3b891b9015c88c576343b9b3e41c2c11a51c219ef067b264bd9c8aa9b441dad" ++dependencies = [ ++ "quote", ++ "synom", ++ "unicode-xid", ++] ++ ++[[package]] ++name = "synom" ++version = "0.11.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "a393066ed9010ebaed60b9eafa373d4b1baac186dd7e008555b0f702b51945b6" ++dependencies = [ ++ "unicode-xid", ++] ++ ++[[package]] ++name = "tabwriter" ++version = "1.2.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "36205cfc997faadcc4b0b87aaef3fbedafe20d38d4959a7ca6ff803564051111" ++dependencies = [ ++ "unicode-width", ++] ++ ++[[package]] ++name = "tempfile" ++version = "3.1.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9" ++dependencies = [ ++ "cfg-if", ++ "libc", ++ "rand 0.7.3", ++ "redox_syscall", ++ "remove_dir_all", ++ "winapi", ++] ++ ++[[package]] ++name = "textwrap" ++version = "0.11.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" ++dependencies = [ ++ "unicode-width", ++] ++ ++[[package]] ++name = "thread_local" ++version = "1.0.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "d40c6d1b69745a6ec6fb1ca717914848da4b44ae29d9b3080cbee91d72a69b14" ++dependencies = [ ++ "lazy_static", ++] ++ ++[[package]] ++name = "time" ++version = "0.1.43" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438" ++dependencies = [ ++ "libc", ++ "winapi", ++] ++ ++[[package]] ++name = "traitobject" ++version = "0.1.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "efd1f82c56340fdf16f2a953d7bda4f8fdffba13d93b00844c25572110b26079" ++ ++[[package]] ++name = "trivial_colours" ++version = "0.3.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "7153365ea16c5a0ce2eebc4da1b33339a6b21d90c49f670e82130639656bb458" ++ ++[[package]] ++name = "typeable" ++version = "0.1.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "1410f6f91f21d1612654e7cc69193b0334f909dcf2c790c4826254fbb86f8887" ++ ++[[package]] ++name = "typemap" ++version = "0.3.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "653be63c80a3296da5551e1bfd2cca35227e13cdd08c6668903ae2f4f77aa1f6" ++dependencies = [ ++ "unsafe-any", ++] ++ ++[[package]] ++name = "unicase" ++version = "1.4.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "7f4765f83163b74f957c797ad9253caf97f103fb064d3999aea9568d09fc8a33" ++dependencies = [ ++ "version_check 0.1.5", ++] ++ ++[[package]] ++name = "unicase" ++version = "2.6.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6" ++dependencies = [ ++ "version_check 0.9.1", ++] ++ ++[[package]] ++name = "unicode-bidi" ++version = "0.3.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" ++dependencies = [ ++ "matches", ++] ++ ++[[package]] ++name = "unicode-normalization" ++version = "0.1.12" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "5479532badd04e128284890390c1e876ef7a993d0570b3597ae43dfa1d59afa4" ++dependencies = [ ++ "smallvec", ++] ++ ++[[package]] ++name = "unicode-width" ++version = "0.1.7" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "caaa9d531767d1ff2150b9332433f32a24622147e5ebb1f26409d5da67afd479" ++ ++[[package]] ++name = "unicode-xid" ++version = "0.0.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "8c1f860d7d29cf02cb2f3f359fd35991af3d30bac52c57d265a3c461074cb4dc" ++ ++[[package]] ++name = "unsafe-any" ++version = "0.4.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "f30360d7979f5e9c6e6cea48af192ea8fab4afb3cf72597154b8f08935bc9c7f" ++dependencies = [ ++ "traitobject", ++] ++ ++[[package]] ++name = "url" ++version = "1.7.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "dd4e7c0d531266369519a4aa4f399d748bd37043b00bde1e4ff1f60a120b355a" ++dependencies = [ ++ "idna", ++ "matches", ++ "percent-encoding 1.0.1", ++] ++ ++[[package]] ++name = "vcpkg" ++version = "0.2.8" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "3fc439f2794e98976c88a2a2dafce96b930fe8010b0a256b3c2199a773933168" ++ ++[[package]] ++name = "vec_map" ++version = "0.8.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "05c78687fb1a80548ae3250346c3db86a80a7cdd77bda190189f2d0a0987c81a" ++ ++[[package]] ++name = "version_check" ++version = "0.1.5" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "914b1a6776c4c929a602fafd8bc742e06365d4bcbe48c30f9cca5824f70dc9dd" ++ ++[[package]] ++name = "version_check" ++version = "0.9.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "078775d0255232fb988e6fccf26ddc9d1ac274299aaedcedce21c6f72cc533ce" ++ ++[[package]] ++name = "void" ++version = "1.0.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" ++ ++[[package]] ++name = "vswhom" ++version = "0.1.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "be979b7f07507105799e854203b470ff7c78a1639e330a58f183b5fea574608b" ++dependencies = [ ++ "libc", ++ "vswhom-sys", ++] ++ ++[[package]] ++name = "vswhom-sys" ++version = "0.1.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "fc2f5402d3d0e79a069714f7b48e3ecc60be7775a2c049cb839457457a239532" ++dependencies = [ ++ "cc", ++ "libc", ++] ++ ++[[package]] ++name = "walkdir" ++version = "2.3.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "777182bc735b6424e1a57516d35ed72cb8019d85c8c9bf536dccb3445c1a2f7d" ++dependencies = [ ++ "same-file", ++ "winapi", ++ "winapi-util", ++] ++ ++[[package]] ++name = "wasi" ++version = "0.9.0+wasi-snapshot-preview1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" ++ ++[[package]] ++name = "winapi" ++version = "0.3.8" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6" ++dependencies = [ ++ "winapi-i686-pc-windows-gnu", ++ "winapi-x86_64-pc-windows-gnu", ++] ++ ++[[package]] ++name = "winapi-i686-pc-windows-gnu" ++version = "0.4.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" ++ ++[[package]] ++name = "winapi-util" ++version = "0.1.5" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" ++dependencies = [ ++ "winapi", ++] ++ ++[[package]] ++name = "winapi-x86_64-pc-windows-gnu" ++version = "0.4.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" ++ ++[[package]] ++name = "winreg" ++version = "0.6.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "b2986deb581c4fe11b621998a5e53361efe6b48a151178d0cd9eeffa4dc6acc9" ++dependencies = [ ++ "winapi", ++] ++ ++[[package]] ++name = "xml-rs" ++version = "0.8.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "2bb76e5c421bbbeb8924c60c030331b345555024d56261dae8f3e786ed817c23" diff --git a/nixpkgs/pkgs/tools/networking/httplz/default.nix b/nixpkgs/pkgs/tools/networking/httplz/default.nix new file mode 100644 index 000000000000..2424018d8856 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/httplz/default.nix @@ -0,0 +1,35 @@ +{ stdenv, lib, fetchFromGitHub, makeWrapper, rustPlatform +, openssl, pkg-config, darwin, libiconv }: + +rustPlatform.buildRustPackage rec { + pname = "httplz"; + version = "1.9.2"; + + src = fetchFromGitHub { + owner = "thecoshman"; + repo = "http"; + rev = "v${version}"; + sha256 = "154alxxclz78r29m656c8yahnzq0vd64s4sp19h0ca92dfw4s46y"; + }; + + nativeBuildInputs = [ makeWrapper pkg-config ]; + buildInputs = [ openssl ] ++ lib.optionals stdenv.isDarwin [ + libiconv darwin.apple_sdk.frameworks.Security + ]; + + cargoBuildFlags = [ "--bin httplz" ]; + cargoPatches = [ ./cargo-lock.patch ]; + cargoSha256 = "0r33vg9431jv32r03ryxb3rc4mp6h1kc00d3h1knssfvkwsh31yn"; + + postInstall = '' + wrapProgram $out/bin/httplz \ + --prefix PATH : "${openssl}/bin" + ''; + + meta = with lib; { + description = "A basic http server for hosting a folder fast and simply"; + homepage = "https://github.com/thecoshman/http"; + license = licenses.mit; + maintainers = with maintainers; [ ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/httpstat/default.nix b/nixpkgs/pkgs/tools/networking/httpstat/default.nix new file mode 100644 index 000000000000..be4a8f2a168d --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/httpstat/default.nix @@ -0,0 +1,24 @@ +{ lib, fetchFromGitHub, curl, python3Packages, glibcLocales }: + +python3Packages.buildPythonApplication rec { + pname = "httpstat"; + version = "1.3.1"; + src = fetchFromGitHub { + owner = "reorx"; + repo = pname; + rev = version; + sha256 = "sha256-zUdis41sQpJ1E3LdNwaCVj6gexi/Rk21IBUgoFISiDM="; + }; + doCheck = false; # No tests + buildInputs = [ glibcLocales ]; + runtimeDeps = [ curl ]; + + LC_ALL = "en_US.UTF-8"; + + meta = { + description = "curl statistics made simple"; + homepage = "https://github.com/reorx/httpstat"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ nequissimus ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/httptunnel/default.nix b/nixpkgs/pkgs/tools/networking/httptunnel/default.nix new file mode 100644 index 000000000000..13ef64175358 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/httptunnel/default.nix @@ -0,0 +1,19 @@ +{ lib, stdenv, fetchurl }: + +stdenv.mkDerivation rec { + version = "3.3"; + pname = "httptunnel"; + + src = fetchurl { + url = "http://www.nocrew.org/software/httptunnel/${pname}-${version}.tar.gz"; + sha256 = "0mn5s6p68n32xzadz6ds5i6bp44dyxzkq68r1yljlv470jr84bql"; + }; + + meta = with lib; { + description = "Creates a bidirectional virtual data connection tunnelled in HTTP requests"; + homepage = "http://www.nocrew.org/software/httptunnel"; + license = licenses.gpl2; + maintainers = with maintainers; [ koral ]; + platforms = platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/hue-cli/Gemfile b/nixpkgs/pkgs/tools/networking/hue-cli/Gemfile new file mode 100644 index 000000000000..7049659d503d --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/hue-cli/Gemfile @@ -0,0 +1,2 @@ +source 'https://rubygems.org' +gem 'hue-cli' diff --git a/nixpkgs/pkgs/tools/networking/hue-cli/Gemfile.lock b/nixpkgs/pkgs/tools/networking/hue-cli/Gemfile.lock new file mode 100644 index 000000000000..0600d6b7eca6 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/hue-cli/Gemfile.lock @@ -0,0 +1,18 @@ +GEM + remote: https://rubygems.org/ + specs: + hue-cli (0.1.4) + hue-lib (>= 0.7.4) + json + hue-lib (0.7.4) + json + json (2.2.0) + +PLATFORMS + ruby + +DEPENDENCIES + hue-cli + +BUNDLED WITH + 2.1.4 diff --git a/nixpkgs/pkgs/tools/networking/hue-cli/default.nix b/nixpkgs/pkgs/tools/networking/hue-cli/default.nix new file mode 100644 index 000000000000..f2ea6b37c810 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/hue-cli/default.nix @@ -0,0 +1,17 @@ +{ lib, bundlerApp, bundlerUpdateScript }: + +bundlerApp { + pname = "hue-cli"; + gemdir = ./.; + exes = [ "hue" ]; + + passthru.updateScript = bundlerUpdateScript "hue-cli"; + + meta = with lib; { + description = "Command line interface for controlling Philips Hue system's lights and bridge"; + homepage = "https://github.com/birkirb/hue-cli"; + license = licenses.mit; + platforms = platforms.unix; + maintainers = with maintainers; [ manveru nicknovitski ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/hue-cli/gemset.nix b/nixpkgs/pkgs/tools/networking/hue-cli/gemset.nix new file mode 100644 index 000000000000..08fd67c38856 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/hue-cli/gemset.nix @@ -0,0 +1,34 @@ +{ + hue-cli = { + dependencies = ["hue-lib" "json"]; + groups = ["default"]; + platforms = []; + source = { + remotes = ["https://rubygems.org"]; + sha256 = "10gjf59pamfy2m17fs271d9ffrg1194b1m6vxzn6p7smzry52h9z"; + type = "gem"; + }; + version = "0.1.4"; + }; + hue-lib = { + dependencies = ["json"]; + groups = ["default"]; + platforms = []; + source = { + remotes = ["https://rubygems.org"]; + sha256 = "1pyl8g8gisdhl79gbzvnddqrsbq0lmflzg7n6yi6xrp5b5290shz"; + type = "gem"; + }; + version = "0.7.4"; + }; + json = { + groups = ["default"]; + platforms = []; + source = { + remotes = ["https://rubygems.org"]; + sha256 = "0sx97bm9by389rbzv8r1f43h06xcz8vwi3h5jv074gvparql7lcx"; + type = "gem"; + }; + version = "2.2.0"; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/hyenae/default.nix b/nixpkgs/pkgs/tools/networking/hyenae/default.nix new file mode 100644 index 000000000000..5007a69fb9b7 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/hyenae/default.nix @@ -0,0 +1,23 @@ +{lib, stdenv, fetchurl, libdnet, pkg-config, libpcap}: + +stdenv.mkDerivation { + name = "hyenae-0.36-1"; + + enableParallelBuilding = true; + + src = fetchurl { + url = "mirror://sourceforge/hyenae/0.36-1/hyenae-0.36-1.tar.gz"; + sha256 = "1f3x4yn9a9p4f4wk4l8pv7hxfjc8q7cv20xzf7ky735sq1hj0xcg"; + }; + + nativeBuildInputs = [ pkg-config ]; + buildInputs = [libdnet libpcap]; + + meta = { + description = ""; + homepage = "https://sourceforge.net/projects/hyenae/"; + license = lib.licenses.gpl3; + maintainers = [lib.maintainers.marcweber]; + platforms = lib.platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/i2p/default.nix b/nixpkgs/pkgs/tools/networking/i2p/default.nix new file mode 100644 index 000000000000..a3b52d19e2dc --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/i2p/default.nix @@ -0,0 +1,82 @@ +{ lib, stdenv, ps, coreutils, fetchurl, jdk, jre, ant, gettext, which }: + +let wrapper = stdenv.mkDerivation rec { + pname = "wrapper"; + version = "3.5.44"; + + src = fetchurl { + url = "https://wrapper.tanukisoftware.com/download/${version}/wrapper_${version}_src.tar.gz"; + sha256 = "1iq4j7srzy5p8q3nci9316bnwx4g71jyvzd1i5hp3s8v1k61910g"; + }; + + buildInputs = [ jdk ]; + + buildPhase = '' + export ANT_HOME=${ant} + export JAVA_HOME=${jdk}/lib/openjdk/jre/ + export JAVA_TOOL_OPTIONS=-Djava.home=$JAVA_HOME + export CLASSPATH=${jdk}/lib/openjdk/lib/tools.jar + sed 's/ testsuite$//' -i src/c/Makefile-linux-x86-64.make + ${if stdenv.isi686 then "./build32.sh" else "./build64.sh"} + ''; + + installPhase = '' + mkdir -p $out/{bin,lib} + cp bin/wrapper $out/bin/wrapper + cp lib/wrapper.jar $out/lib/wrapper.jar + cp lib/libwrapper.so $out/lib/libwrapper.so + ''; +}; + +in + +stdenv.mkDerivation rec { + pname = "i2p"; + version = "0.9.48"; + + src = fetchurl { + url = "https://download.i2p2.de/releases/${version}/i2psource_${version}.tar.bz2"; + sha256 = "0cnm4bwl1gqcx89i96j2qlq6adphy4l72h5whamqwv86n8bmpig8"; + }; + + buildInputs = [ jdk ant gettext which ]; + patches = [ ./i2p.patch ]; + + buildPhase = '' + export JAVA_TOOL_OPTIONS="-Dfile.encoding=UTF8" + ant preppkg-linux-only + ''; + + installPhase = '' + set -B + mkdir -p $out/{bin,share} + cp -r pkg-temp/* $out + + cp ${wrapper}/bin/wrapper $out/i2psvc + cp ${wrapper}/lib/wrapper.jar $out/lib + cp ${wrapper}/lib/libwrapper.so $out/lib + + sed -i $out/i2prouter -i $out/runplain.sh \ + -e "s#uname#${coreutils}/bin/uname#" \ + -e "s#which#${which}/bin/which#" \ + -e "s#%gettext%#${gettext}/bin/gettext#" \ + -e "s#/usr/ucb/ps#${ps}/bin/ps#" \ + -e "s#/usr/bin/tr#${coreutils}/bin/tr#" \ + -e "s#%INSTALL_PATH#$out#" \ + -e 's#%USER_HOME#$HOME#' \ + -e "s#%SYSTEM_java_io_tmpdir#/tmp#" \ + -e "s#%JAVA%#${jre}/bin/java#" + mv $out/runplain.sh $out/bin/i2prouter-plain + mv $out/man $out/share/ + chmod +x $out/bin/* $out/i2psvc + rm $out/{osid,postinstall.sh,INSTALL-headless.txt} + ''; + + meta = with lib; { + description = "Applications and router for I2P, anonymity over the Internet"; + homepage = "https://geti2p.net"; + license = licenses.gpl2; + platforms = [ "x86_64-linux" "i686-linux" ]; + maintainers = with maintainers; [ joelmo ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/i2p/i2p.patch b/nixpkgs/pkgs/tools/networking/i2p/i2p.patch new file mode 100644 index 000000000000..3bb4da729173 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/i2p/i2p.patch @@ -0,0 +1,43 @@ +diff --git a/installer/resources/i2prouter b/installer/resources/i2prouter +index 365737d89..2ea14db3e 100644 +--- a/installer/resources/i2prouter ++++ b/installer/resources/i2prouter +@@ -49,7 +49,7 @@ APP_LONG_NAME="I2P Service" + + # gettext - we look for it in the path + # fallback to echo is below, we can't set it to echo here. +-GETTEXT=$(which gettext > /dev/null 2>&1) ++GETTEXT=%gettext% + + # Where to install the systemd service + SYSTEMD_SERVICE="/etc/systemd/system/${APP_NAME}.service" +diff --git a/installer/resources/runplain.sh b/installer/resources/runplain.sh +index eb4995dfe..0186cede3 100644 +--- a/installer/resources/runplain.sh ++++ b/installer/resources/runplain.sh +@@ -25,7 +25,7 @@ CP= + + # Try using the Java binary that I2P was installed with. + # If it's not found, try looking in the system PATH. +-JAVA=$(which "%JAVA_HOME"/bin/java || which java) ++JAVA=%JAVA% + + if [ -z $JAVA ] || [ ! -x $JAVA ]; then + echo "Error: Cannot find java." >&2 +@@ -44,15 +44,4 @@ if [ $(uname -s) = "Darwin" ]; then + export JAVA_TOOL_OPTIONS="-Djava.awt.headless=true" + fi + JAVAOPTS="${MAXMEMOPT} -Djava.net.preferIPv4Stack=${PREFERv4} -Djava.library.path=${I2P}:${I2P}/lib -Di2p.dir.base=${I2P} -DloggerFilenameOverride=logs/log-router-@.txt" +-( +- nohup ${JAVA} -cp \"${CP}\" ${JAVAOPTS} net.i2p.router.RouterLaunch > /dev/null 2>&1 +-) & +-PID=$! +- +-if [ ! -z $PID ] && kill -0 $PID > /dev/null 2>&1 ; then +- echo "I2P started [$PID]" >&2 +- echo $PID > "${I2PTEMP}/router.pid" +-else +- echo "I2P failed to start." >&2 +- exit 1 +-fi ++exec ${JAVA} -cp \"${CP}\" ${JAVAOPTS} net.i2p.router.RouterLaunch diff --git a/nixpkgs/pkgs/tools/networking/i2pd/default.nix b/nixpkgs/pkgs/tools/networking/i2pd/default.nix new file mode 100644 index 000000000000..48ebf33c41bf --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/i2pd/default.nix @@ -0,0 +1,44 @@ +{ lib, stdenv, fetchFromGitHub +, boost, zlib, openssl +, upnpSupport ? true, miniupnpc ? null +, aesniSupport ? stdenv.hostPlatform.aesSupport +, avxSupport ? stdenv.hostPlatform.avxSupport +}: + +assert upnpSupport -> miniupnpc != null; + +stdenv.mkDerivation rec { + pname = "i2pd"; + version = "2.38.0"; + + src = fetchFromGitHub { + owner = "PurpleI2P"; + repo = pname; + rev = version; + sha256 = "sha256-8wy6Zdnw0JgnHFLa1U3qlzjpDIqi2gykbkkV7lh+Zag="; + }; + + buildInputs = with lib; [ boost zlib openssl ] + ++ optional upnpSupport miniupnpc; + + makeFlags = + let ynf = a: b: a + "=" + (if b then "yes" else "no"); in + [ (ynf "USE_AESNI" aesniSupport) + (ynf "USE_AVX" avxSupport) + (ynf "USE_UPNP" upnpSupport) + ]; + + enableParallelBuilding = true; + + installPhase = '' + install -D i2pd $out/bin/i2pd + ''; + + meta = with lib; { + homepage = "https://i2pd.website"; + description = "Minimal I2P router written in C++"; + license = licenses.bsd3; + maintainers = with maintainers; [ edwtjo ]; + platforms = platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/ifstat-legacy/default.nix b/nixpkgs/pkgs/tools/networking/ifstat-legacy/default.nix new file mode 100644 index 000000000000..8383f82fd93c --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/ifstat-legacy/default.nix @@ -0,0 +1,30 @@ +{ lib, stdenv, fetchurl, autoreconfHook, net-snmp }: + +stdenv.mkDerivation rec { + pname = "ifstat-legacy"; + version = "1.1"; + + src = fetchurl { + url = "http://gael.roualland.free.fr/ifstat/ifstat-${version}.tar.gz"; + sha256 = "01zmv6vk5kh5xmd563xws8a1qnxjb6b6kv59yzz9r3rrghxhd6c5"; + }; + + buildInputs = [ net-snmp ]; + + nativeBuildInputs = [ autoreconfHook ]; + + enableParallelBuilding = true; + + postInstall = '' + mv $out/bin/ifstat $out/bin/ifstat-legacy + mv $out/share/man/man1/ifstat.1 $out/share/man/man1/ifstat-legacy.1 + ''; + + meta = with lib; { + description = "Report network interfaces bandwith just like vmstat/iostat do for other system counters - legacy version"; + homepage = "http://gael.roualland.free.fr/ifstat/"; + maintainers = with maintainers; [ peterhoeg ]; + platforms = platforms.unix; + license = licenses.gpl2; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/iftop/default.nix b/nixpkgs/pkgs/tools/networking/iftop/default.nix new file mode 100644 index 000000000000..c3e71e6132de --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/iftop/default.nix @@ -0,0 +1,35 @@ +{ lib, stdenv, fetchurl, ncurses, libpcap, automake, nixosTests }: + +stdenv.mkDerivation { + name = "iftop-1.0pre4"; + + src = fetchurl { + url = "http://ex-parrot.com/pdw/iftop/download/iftop-1.0pre4.tar.gz"; + sha256 = "15sgkdyijb7vbxpxjavh5qm5nvyii3fqcg9mzvw7fx8s6zmfwczp"; + }; + + # Explicitly link against libgcc_s, to work around the infamous + # "libgcc_s.so.1 must be installed for pthread_cancel to work". + LDFLAGS = lib.optionalString stdenv.isLinux "-lgcc_s"; + + preConfigure = '' + cp ${automake}/share/automake*/config.{sub,guess} config + ''; + + buildInputs = [ncurses libpcap]; + + passthru.tests = { inherit (nixosTests) iftop; }; + + meta = with lib; { + description = "Display bandwidth usage on a network interface"; + longDescription = '' + iftop does for network usage what top(1) does for CPU usage. It listens + to network traffic on a named interface and displays a table of current + bandwidth usage by pairs of hosts. + ''; + license = licenses.gpl2Plus; + homepage = "http://ex-parrot.com/pdw/iftop/"; + platforms = platforms.unix; + maintainers = [ ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/igmpproxy/default.nix b/nixpkgs/pkgs/tools/networking/igmpproxy/default.nix new file mode 100644 index 000000000000..9f9249649078 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/igmpproxy/default.nix @@ -0,0 +1,26 @@ +{ lib, stdenv, fetchFromGitHub, autoreconfHook }: + +stdenv.mkDerivation rec { + pname = "igmpproxy"; + version = "0.3"; + + src = fetchFromGitHub { + owner = "pali"; + repo = "igmpproxy"; + rev = version; + sha256 = "sha256-B7mq+5pKWMO4dJeFPB7tiyjDQjj90g/kmYB2ApBE3Ic="; + }; + + nativeBuildInputs = [ autoreconfHook ]; + + meta = with lib; { + description = "A daemon that routes multicast using IGMP forwarding"; + homepage = "https://github.com/pali/igmpproxy/"; + changelog = "https://github.com/pali/igmpproxy/releases/tag/${version}"; + license = licenses.gpl2Plus; + maintainers = [ maintainers.sdier ]; + # The maintainer is using this on linux, but if you test it on other platforms + # please add them here! + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/imapproxy/default.nix b/nixpkgs/pkgs/tools/networking/imapproxy/default.nix new file mode 100644 index 000000000000..dd149f57432b --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/imapproxy/default.nix @@ -0,0 +1,22 @@ +{lib, stdenv, fetchurl, openssl, ncurses}: + +stdenv.mkDerivation { + name = "imapproxy-1.2.7"; + src = fetchurl { + url = "mirror://sourceforge/squirrelmail/squirrelmail-imap_proxy-1.2.7.tar.bz2"; + sha256 = "0j5fq755sxiz338ia93jrkiy64crv30g37pir5pxfys57q7d92nx"; + }; + + buildInputs = [ openssl ncurses ]; + + patchPhase = '' + sed -i -e 's/-o \(root\|bin\) -g \(sys\|bin\)//' Makefile.in + ''; + + meta = { + homepage = "http://imapproxy.org/"; + description = "It proxies IMAP transactions caching server connections"; + license = lib.licenses.gpl2Plus; + platforms = lib.platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/imapsync/default.nix b/nixpkgs/pkgs/tools/networking/imapsync/default.nix new file mode 100644 index 000000000000..bec0b197c184 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/imapsync/default.nix @@ -0,0 +1,34 @@ +{lib, stdenv, makeWrapper, fetchurl, perl, openssl, perlPackages }: + +stdenv.mkDerivation rec { + name = "imapsync-1.727"; + src = fetchurl { + url = "https://releases.pagure.org/imapsync/${name}.tgz"; + sha256 = "1axacjw2wyaphczfw3kfmi5cl83fyr8nb207nks40fxkbs8q5dlr"; + }; + + patchPhase = '' + sed -i -e s@/usr@$out@ Makefile + ''; + + postInstall = '' + wrapProgram $out/bin/imapsync --set PERL5LIB $PERL5LIB + ''; + + nativeBuildInputs = [ makeWrapper ]; + + buildInputs = with perlPackages; [ perl openssl MailIMAPClient TermReadKey + IOSocketSSL DigestHMAC URI FileCopyRecursive IOTee UnicodeString + DataUniqid JSONWebToken TestMockGuard LWP CryptOpenSSLRSA + LWPProtocolHttps Readonly TestPod TestMockObject ParseRecDescent + IOSocketInet6 NTLM + ]; + + meta = with lib; { + homepage = "http://www.linux-france.org/prj/imapsync/"; + description = "Mail folder synchronizer between IMAP servers"; + license = licenses.gpl2Plus; + platforms = platforms.linux; + maintainers = with maintainers; [ pSub ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/inadyn/default.nix b/nixpkgs/pkgs/tools/networking/inadyn/default.nix new file mode 100644 index 000000000000..47d866150266 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/inadyn/default.nix @@ -0,0 +1,28 @@ +{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config +, gnutls, libite, libconfuse }: + +stdenv.mkDerivation rec { + pname = "inadyn"; + version = "2.7"; + + src = fetchFromGitHub { + owner = "troglobit"; + repo = "inadyn"; + rev = "v${version}"; + sha256 = "00jhayx0hfl9dw78d58bdxa5390bvxq73lz26q9h1gg1xw76adan"; + }; + + nativeBuildInputs = [ autoreconfHook pkg-config ]; + + buildInputs = [ gnutls libite libconfuse ]; + + enableParallelBuilding = true; + + meta = with lib; { + homepage = "https://troglobit.com/project/inadyn/"; + description = "Free dynamic DNS client"; + license = licenses.gpl2Plus; + maintainers = with maintainers; [ ]; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/inetutils/default.nix b/nixpkgs/pkgs/tools/networking/inetutils/default.nix new file mode 100644 index 000000000000..285031aaca52 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/inetutils/default.nix @@ -0,0 +1,81 @@ +{ stdenv, lib, fetchurl, ncurses, perl, help2man +, apparmorRulesFromClosure +}: + +stdenv.mkDerivation rec { + name = "inetutils-1.9.4"; + + src = fetchurl { + url = "mirror://gnu/inetutils/${name}.tar.gz"; + sha256 = "05n65k4ixl85dc6rxc51b1b732gnmm8xnqi424dy9f1nz7ppb3xy"; + }; + + outputs = ["out" "apparmor"]; + + patches = [ + ./whois-Update-Canadian-TLD-server.patch + ./service-name.patch + # https://git.congatec.com/yocto/meta-openembedded/commit/3402bfac6b595c622e4590a8ff5eaaa854e2a2a3 + ./inetutils-1_9-PATH_PROCNET_DEV.patch + ]; + + nativeBuildInputs = [ help2man perl /* for `whois' */ ]; + buildInputs = [ ncurses /* for `talk' */ ]; + + # Don't use help2man if cross-compiling + # https://lists.gnu.org/archive/html/bug-sed/2017-01/msg00001.html + # https://git.congatec.com/yocto/meta-openembedded/blob/3402bfac6b595c622e4590a8ff5eaaa854e2a2a3/meta-networking/recipes-connectivity/inetutils/inetutils_1.9.1.bb#L44 + preConfigure = let + isCross = stdenv.hostPlatform != stdenv.buildPlatform; + in lib.optionalString isCross '' + export HELP2MAN=true + ''; + + configureFlags = [ "--with-ncurses-include-dir=${ncurses.dev}/include" ] + ++ lib.optionals stdenv.hostPlatform.isMusl [ # Musl doesn't define rcmd + "--disable-rcp" + "--disable-rsh" + "--disable-rlogin" + "--disable-rexec" + ] ++ lib.optional stdenv.isDarwin "--disable-servers"; + + # Test fails with "UNIX socket name too long", probably because our + # $TMPDIR is too long. + doCheck = false; + + installFlags = [ "SUIDMODE=" ]; + + postInstall = '' + mkdir $apparmor + cat >$apparmor/bin.ping <<EOF + $out/bin/ping { + include <abstractions/base> + include <abstractions/consoles> + include <abstractions/nameservice> + include "${apparmorRulesFromClosure { name = "ping"; } [stdenv.cc.libc]}" + include <local/bin.ping> + capability net_raw, + network inet raw, + network inet6 raw, + mr $out/bin/ping, + } + EOF + ''; + + meta = with lib; { + description = "Collection of common network programs"; + + longDescription = + '' The GNU network utilities suite provides the + following tools: ftp(d), hostname, ifconfig, inetd, logger, ping, rcp, + rexec(d), rlogin(d), rsh(d), syslogd, talk(d), telnet(d), tftp(d), + traceroute, uucpd, and whois. + ''; + + homepage = "https://www.gnu.org/software/inetutils/"; + license = licenses.gpl3Plus; + + maintainers = with maintainers; [ matthewbauer ]; + platforms = platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/inetutils/inetutils-1_9-PATH_PROCNET_DEV.patch b/nixpkgs/pkgs/tools/networking/inetutils/inetutils-1_9-PATH_PROCNET_DEV.patch new file mode 100644 index 000000000000..2592989a90a3 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/inetutils/inetutils-1_9-PATH_PROCNET_DEV.patch @@ -0,0 +1,26 @@ +inetutils: define PATH_PROCNET_DEV if not already defined + +this prevents the following compilation error : +system/linux.c:401:15: error: 'PATH_PROCNET_DEV' undeclared (first use in this function) + +this patch comes from : + http://repository.timesys.com/buildsources/i/inetutils/inetutils-1.9/ + +Upstream-Status: Inappropriate [not author] + +Signed-of-by: Eric Bénard <eric@eukrea.com> +--- +diff -Naur inetutils-1.9.orig/ifconfig/system/linux.c inetutils-1.9/ifconfig/system/linux.c +--- inetutils-1.9.orig/ifconfig/system/linux.c 2012-01-04 16:31:36.000000000 -0500 ++++ inetutils-1.9/ifconfig/system/linux.c 2012-01-04 16:40:53.000000000 -0500 +@@ -49,6 +49,10 @@ + #include "../ifconfig.h" + + ++#ifndef PATH_PROCNET_DEV ++ #define PATH_PROCNET_DEV "/proc/net/dev" ++#endif ++ + /* ARPHRD stuff. */ + + static void diff --git a/nixpkgs/pkgs/tools/networking/inetutils/service-name.patch b/nixpkgs/pkgs/tools/networking/inetutils/service-name.patch new file mode 100644 index 000000000000..e34516313c57 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/inetutils/service-name.patch @@ -0,0 +1,11 @@ +--- inetutils-1.9.4.org/whois/whois.c 2015-03-31 17:40:50.000000000 +0200 ++++ inetutils-1.9.4/whois/whois.c 2017-04-20 10:23:38.487358708 +0200 +@@ -576,7 +576,7 @@ + hints.ai_family = AF_UNSPEC; + hints.ai_socktype = SOCK_STREAM; + +- if ((i = getaddrinfo (server, port ? port : "whois", &hints, &res)) != 0) ++ if ((i = getaddrinfo (server, port ? port : "nicname", &hints, &res)) != 0) + err_quit ("getaddrinfo: %s", gai_strerror (i)); + + for (ressave = res; res; res = res->ai_next) diff --git a/nixpkgs/pkgs/tools/networking/inetutils/whois-Update-Canadian-TLD-server.patch b/nixpkgs/pkgs/tools/networking/inetutils/whois-Update-Canadian-TLD-server.patch new file mode 100644 index 000000000000..d63d4e29daf0 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/inetutils/whois-Update-Canadian-TLD-server.patch @@ -0,0 +1,27 @@ +From 73e2811a0512556fd5359acc4387f46c79a9884a Mon Sep 17 00:00:00 2001 +From: Mats Erik Andersson <gnu@gisladisker.se> +Date: Thu, 2 Mar 2017 15:38:38 +0100 +Subject: [PATCH] whois: Update Canadian TLD server. +Content-Type: text/plain; charset=utf-8 + +--- + ChangeLog | 8 ++++++++ (OMITTED) + whois/tld_serv_list | 2 +- + 2 files changed, 9 insertions(+), 1 deletion(-) + +diff --git a/whois/tld_serv_list b/whois/tld_serv_list +index 056efcf..91697b8 100644 +--- a/whois/tld_serv_list ++++ b/whois/tld_serv_list +@@ -81,7 +81,7 @@ + #.bw # NIC? www.botsnet.bw + #.by NONE # NIC? http://unibel.by www.open.by + .bz NONE # http://www.psg.com/dns/bz/ +-.ca whois.cdnnet.ca ++.ca whois.cira.ca + .cc whois.nic.cc + .cd WEB http://www.nic.cd/database/cd/ + #.cf NONE # NIC? http://www.socatel.intnet.cf +-- +2.10.0 + diff --git a/nixpkgs/pkgs/tools/networking/innernet/default.nix b/nixpkgs/pkgs/tools/networking/innernet/default.nix new file mode 100644 index 000000000000..cee4956269e1 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/innernet/default.nix @@ -0,0 +1,53 @@ +{ lib, stdenv, rustPlatform, fetchFromGitHub, llvmPackages, sqlite, installShellFiles, Security, libiconv }: + +rustPlatform.buildRustPackage rec { + pname = "innernet"; + version = "1.3.1"; + + src = fetchFromGitHub { + owner = "tonarino"; + repo = pname; + rev = "v${version}"; + sha256 = "sha256-Tnwq86gAbi24O8/26134gJCf9+wol1zma980t9iHEKY="; + }; + cargoSha256 = "sha256-Wy+i1lmXpsy0Sy0GF5XUfXsLQHeV7cQo9nUxUEFnHOU="; + + nativeBuildInputs = with llvmPackages; [ + llvm + clang + installShellFiles + ]; + buildInputs = [ sqlite ] ++ lib.optionals stdenv.isDarwin [ Security libiconv ]; + + LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib"; + + postInstall = '' + installManPage doc/innernet-server.8.gz + installManPage doc/innernet.8.gz + installShellCompletion doc/innernet.completions.{bash,fish,zsh} + installShellCompletion doc/innernet-server.completions.{bash,fish,zsh} + ''; + + doInstallCheck = true; + installCheckPhase = '' + if [[ "$("$out/bin/${pname}"-server --version)" == "${pname}-server ${version}" ]]; then + echo '${pname}-server smoke check passed' + else + echo '${pname}-server smoke check failed' + return 1 + fi + if [[ "$("$out/bin/${pname}" --version)" == "${pname} ${version}" ]]; then + echo '${pname} smoke check passed' + else + echo '${pname} smoke check failed' + return 1 + fi + ''; + + meta = with lib; { + description = "A private network system that uses WireGuard under the hood"; + homepage = "https://github.com/tonarino/innernet"; + license = licenses.mit; + maintainers = with maintainers; [ tomberek _0x4A6F ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/iodine/default.nix b/nixpkgs/pkgs/tools/networking/iodine/default.nix new file mode 100644 index 000000000000..226cfb9ce8ef --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/iodine/default.nix @@ -0,0 +1,32 @@ +{ lib, stdenv, fetchFromGitHub, zlib, nettools, nixosTests }: + +stdenv.mkDerivation rec { + pname = "iodine"; + version = "unstable-2019-09-27"; + + src = fetchFromGitHub { + owner = "yarrick"; + repo = "iodine"; + rev = "8e14f18"; + sha256 = "0k8m99qfjd5n6n56jnq85y7q8h2i2b8yw6ba0kxsz4jyx97lavg3"; + }; + + buildInputs = [ zlib ]; + + patchPhase = ''sed -i "s,/sbin/route,${nettools}/bin/route," src/tun.c''; + + NIX_CFLAGS_COMPILE = "-DIFCONFIGPATH=\"${nettools}/bin/\""; + + installFlags = [ "prefix=\${out}" ]; + + passthru.tests = { + inherit (nixosTests) iodine; + }; + + meta = { + homepage = "http://code.kryo.se/iodine/"; + description = "Tool to tunnel IPv4 data through a DNS server"; + license = lib.licenses.isc; + platforms = lib.platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/iouyap/default.nix b/nixpkgs/pkgs/tools/networking/iouyap/default.nix new file mode 100644 index 000000000000..2367261b5223 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/iouyap/default.nix @@ -0,0 +1,27 @@ +{ lib, stdenv, fetchFromGitHub, bison, flex }: + +stdenv.mkDerivation rec { + pname = "iouyap"; + version = "0.97"; + + src = fetchFromGitHub { + owner = "GNS3"; + repo = pname; + rev = "v${version}"; + sha256 = "028s9kx67b9x7gwzg0fhc6546diw4n0x4kk1xhl3v7hbsz3wdh6s"; + }; + + buildInputs = [ bison flex ]; + + installPhase = '' + install -D -m555 iouyap $out/bin/iouyap; + ''; + + meta = with lib; { + description = "Bridge IOU to UDP, TAP and Ethernet"; + inherit (src.meta) homepage; + license = licenses.gpl3Plus; + platforms = platforms.linux; + maintainers = with maintainers; [ primeos ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/ip2location/default.nix b/nixpkgs/pkgs/tools/networking/ip2location/default.nix new file mode 100644 index 000000000000..df5d26b4f5db --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/ip2location/default.nix @@ -0,0 +1,28 @@ +{ lib, stdenv, fetchurl }: + +stdenv.mkDerivation rec { + pname = "ip2location"; + version = "7.0.0"; + + src = fetchurl { + sha256 = "05zbc02z7vm19byafi05i1rnkxc6yrfkhnm30ly68zzyipkmzx1l"; + url = "https://www.ip2location.com/downloads/ip2location-${version}.tar.gz"; + }; + + enableParallelBuilding = true; + + doCheck = true; + + meta = with lib; { + description = "Look up locations of host names and IP addresses"; + longDescription = '' + A command-line tool to find the country, region, city,coordinates, + zip code, time zone, ISP, domain name, connection type, area code, + weather, MCC, MNC, mobile brand name, elevation and usage type of + any IP address or host name in the IP2Location databases. + ''; + homepage = "https://www.ip2location.com/free/applications"; + license = with licenses; [ gpl3Plus lgpl3Plus ]; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/ip2unix/default.nix b/nixpkgs/pkgs/tools/networking/ip2unix/default.nix new file mode 100644 index 000000000000..992ee324cc50 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/ip2unix/default.nix @@ -0,0 +1,46 @@ +{ lib, stdenv, fetchFromGitHub, meson, ninja, pkg-config, libyamlcpp, systemd +, python3Packages, asciidoc, libxslt, docbook_xml_dtd_45, docbook_xsl +, libxml2, docbook5 +}: + +stdenv.mkDerivation rec { + pname = "ip2unix"; + version = "2.1.3"; + + src = fetchFromGitHub { + owner = "nixcloud"; + repo = "ip2unix"; + rev = "v${version}"; + sha256 = "19c449h60b2m1d8kawnhpi4y9y4ddm24jmlh8kilqmx8m5l2khr6"; + }; + + nativeBuildInputs = [ + meson ninja pkg-config asciidoc libxslt.bin docbook_xml_dtd_45 docbook_xsl + libxml2.bin docbook5 python3Packages.pytest python3Packages.pytest-timeout + systemd + ]; + + buildInputs = [ libyamlcpp ]; + + doCheck = true; + + doInstallCheck = true; + installCheckPhase = '' + found=0 + for man in "$out/share/man/man1"/ip2unix.1*; do + test -s "$man" && found=1 + done + if [ $found -ne 1 ]; then + echo "ERROR: Manual page hasn't been generated." >&2 + exit 1 + fi + ''; + + meta = { + homepage = "https://github.com/nixcloud/ip2unix"; + description = "Turn IP sockets into Unix domain sockets"; + platforms = lib.platforms.linux; + license = lib.licenses.lgpl3; + maintainers = [ lib.maintainers.aszlig ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/ipcalc/default.nix b/nixpkgs/pkgs/tools/networking/ipcalc/default.nix new file mode 100644 index 000000000000..5fec55899e46 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/ipcalc/default.nix @@ -0,0 +1,20 @@ +{lib, stdenv, fetchurl, perl}: +stdenv.mkDerivation rec { + pname = "ipcalc"; + version = "0.41"; + src = fetchurl { + url = "http://jodies.de/ipcalc-archive/${pname}-${version}.tar.gz"; + sha256 = "dda9c571ce3369e5b6b06e92790434b54bec1f2b03f1c9df054c0988aa4e2e8a"; + }; + buildInputs = [perl]; + installPhase = '' + mkdir -p $out/bin + cp ipcalc $out/bin + ''; + meta = { + description = "Simple IP network calculator"; + homepage = "http://jodies.de/ipcalc"; + license = lib.licenses.gpl2Plus; + platforms = lib.platforms.all; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/iperf/2.nix b/nixpkgs/pkgs/tools/networking/iperf/2.nix new file mode 100644 index 000000000000..3270a25e67b2 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/iperf/2.nix @@ -0,0 +1,28 @@ +{ lib, stdenv, fetchurl }: + +stdenv.mkDerivation rec { + name = "iperf-2.0.13"; + + src = fetchurl { + url = "mirror://sourceforge/iperf2/files/${name}.tar.gz"; + sha256 = "1bbq6xr0vrd88zssfiadvw3awyn236yv94fsdl9q2sh9cv4xx2n8"; + }; + + hardeningDisable = [ "format" ]; + configureFlags = [ "--enable-fastsampling" ]; + + postInstall = '' + mv $out/bin/iperf $out/bin/iperf2 + ln -s $out/bin/iperf2 $out/bin/iperf + ''; + + meta = with lib; { + homepage = "https://sourceforge.net/projects/iperf/"; + description = "Tool to measure IP bandwidth using UDP or TCP"; + platforms = platforms.unix; + license = licenses.mit; + + # prioritize iperf3 + priority = 10; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/iperf/3.nix b/nixpkgs/pkgs/tools/networking/iperf/3.nix new file mode 100644 index 000000000000..5ab3f7f30fbd --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/iperf/3.nix @@ -0,0 +1,39 @@ +{ lib, stdenv, fetchurl, openssl, fetchpatch }: + +stdenv.mkDerivation rec { + pname = "iperf"; + version = "3.9"; + + src = fetchurl { + url = "https://downloads.es.net/pub/iperf/iperf-${version}.tar.gz"; + sha256 = "0f601avdmzpwsa3lbi0ppjhkrdipm5wifhhxy5czf99370k3mdi4"; + }; + + buildInputs = [ openssl ]; + configureFlags = [ + "--with-openssl=${openssl.dev}" + ]; + + outputs = [ "out" "man" ]; + + patches = lib.optionals stdenv.hostPlatform.isMusl [ + (fetchpatch { + url = "https://git.alpinelinux.org/aports/plain/main/iperf3/remove-pg-flags.patch?id=7f979fc51ae31d5c695d8481ba84a4afc5080efb"; + name = "remove-pg-flags.patch"; + sha256 = "0z3zsmf7ln08rg1mmzl8s8jm5gp8x62f5cxiqcmi8dcs2nsxwgbi"; + }) + ]; + + postInstall = '' + ln -s $out/bin/iperf3 $out/bin/iperf + ln -s $man/share/man/man1/iperf3.1 $man/share/man/man1/iperf.1 + ''; + + meta = with lib; { + homepage = "http://software.es.net/iperf/"; + description = "Tool to measure IP bandwidth using UDP or TCP"; + platforms = platforms.unix; + license = licenses.bsd3; + maintainers = with maintainers; [ fpletz ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/ipgrep/default.nix b/nixpkgs/pkgs/tools/networking/ipgrep/default.nix new file mode 100644 index 000000000000..d1f5316c27b4 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/ipgrep/default.nix @@ -0,0 +1,38 @@ +{ lib, fetchFromGitHub, python3Packages }: + +python3Packages.buildPythonApplication rec { + version = "1.0.1"; + pname = "ipgrep"; + + disabled = python3Packages.isPy27; + + src = fetchFromGitHub { + owner = "jedisct1"; + repo = pname; + rev = version; + hash = "sha256-NrhcUFQM+L66KaDRRpAoC+z5s54a+1fqEepTRXVZ5Qs="; + }; + + patchPhase = '' + mkdir -p ${pname} + substituteInPlace setup.py \ + --replace "'scripts': []" "'scripts': { '${pname}.py' }" + ''; + + propagatedBuildInputs = with python3Packages; [ + pycares + urllib3 + requests + ]; + + meta = with lib; { + description = "Extract, defang, resolve names and IPs from text"; + longDescription = '' + ipgrep extracts possibly obfuscated host names and IP addresses + from text, resolves host names, and prints them, sorted by ASN. + ''; + license = licenses.mit; + maintainers = with maintainers; [ leenaars ]; + platforms = platforms.all; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/ipinfo/default.nix b/nixpkgs/pkgs/tools/networking/ipinfo/default.nix new file mode 100644 index 000000000000..32f897bbe8e4 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/ipinfo/default.nix @@ -0,0 +1,25 @@ +{ lib +, buildGoModule +, fetchFromGitHub +}: + +buildGoModule rec { + pname = "ipinfo"; + version = "1.1.5"; + + src = fetchFromGitHub { + owner = pname; + repo = "cli"; + rev = "${pname}-${version}"; + sha256 = "16i5vmx39j7l5mhs28niapki9530nsbw6xik8rsky55v9i5pr72d"; + }; + + vendorSha256 = null; + + meta = with lib; { + description = "Command Line Interface for the IPinfo API"; + homepage = "https://github.com/ipinfo/cli"; + license = with licenses; [ asl20 ]; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/ipv6calc/default.nix b/nixpkgs/pkgs/tools/networking/ipv6calc/default.nix new file mode 100644 index 000000000000..158a979fb40c --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/ipv6calc/default.nix @@ -0,0 +1,53 @@ +{ lib, stdenv, fetchurl, getopt, ip2location-c, openssl, perl +, libmaxminddb ? null, geolite-legacy ? null }: + +stdenv.mkDerivation rec { + pname = "ipv6calc"; + version = "2.2.0"; + + src = fetchurl { + urls = [ + "https://www.deepspace6.net/ftp/pub/ds6/sources/ipv6calc/${pname}-${version}.tar.gz" + "ftp://ftp.deepspace6.net/pub/ds6/sources/ipv6calc/${pname}-${version}.tar.gz" + "ftp://ftp.bieringer.de/pub/linux/IPv6/ipv6calc/${pname}-${version}.tar.gz" + ]; + sha256 = "18acy0sy3n6jcjjwpxskysinw06czyayx1q4rqc7zc3ic4pkad8r"; + }; + + buildInputs = [ libmaxminddb geolite-legacy getopt ip2location-c openssl perl ]; + + postPatch = '' + patchShebangs *.sh */*.sh + for i in {,databases/}lib/Makefile.in; do + substituteInPlace $i --replace "/sbin/ldconfig" "ldconfig" + done + ''; + + configureFlags = [ + "--prefix=${placeholder "out"}" + "--libdir=${placeholder "out"}/lib" + "--disable-bundled-getopt" + "--disable-bundled-md5" + "--disable-dynamic-load" + "--enable-shared" + ] ++ lib.optional (libmaxminddb != null) "--enable-mmdb" + ++ lib.optional (geolite-legacy != null) "--with-geoip-db=${geolite-legacy}/share/GeoIP" + ++ lib.optional (ip2location-c != null) "--enable-ip2location"; + + enableParallelBuilding = true; + + meta = with lib; { + description = "Calculate/manipulate (not only) IPv6 addresses"; + longDescription = '' + ipv6calc is a small utility to manipulate (not only) IPv6 addresses and + is able to do other tricky things. Intentions were convering a given + IPv6 address into compressed format, convering a given IPv6 address into + the same format like shown in /proc/net/if_inet6 and (because it was not + difficult) migrating the Perl program ip6_int into. + Now only one utiltity is needed to do a lot. + ''; + homepage = "http://www.deepspace6.net/projects/ipv6calc.html"; + license = licenses.gpl2; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/isync/default.nix b/nixpkgs/pkgs/tools/networking/isync/default.nix new file mode 100644 index 000000000000..666e19ca81ae --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/isync/default.nix @@ -0,0 +1,33 @@ +{ lib, stdenv, fetchurl, pkg-config, perl +, openssl, db, cyrus_sasl, zlib +, Security +}: + +stdenv.mkDerivation rec { + pname = "isync"; + version = "1.4.2"; + + src = fetchurl { + url = "mirror://sourceforge/isync/${pname}-${version}.tar.gz"; + sha256 = "0hskfpj4r4q3959k3npyqli353daj3r5d9mfia9bbmig87nyfd8r"; + }; + + nativeBuildInputs = [ pkg-config perl ]; + buildInputs = [ openssl db cyrus_sasl zlib ] + ++ lib.optionals stdenv.isDarwin [ Security ]; + + meta = with lib; { + homepage = "http://isync.sourceforge.net/"; + # https://sourceforge.net/projects/isync/ + changelog = "https://sourceforge.net/p/isync/isync/ci/v${version}/tree/NEWS"; + description = "Free IMAP and MailDir mailbox synchronizer"; + longDescription = '' + mbsync (formerly isync) is a command line application which synchronizes + mailboxes. Currently Maildir and IMAP4 mailboxes are supported. New + messages, message deletions and flag changes can be propagated both ways. + ''; + license = licenses.gpl2Plus; + platforms = platforms.unix; + maintainers = with maintainers; [ primeos lheckemann ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/jnettop/default.nix b/nixpkgs/pkgs/tools/networking/jnettop/default.nix new file mode 100644 index 000000000000..bd31235b6f94 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/jnettop/default.nix @@ -0,0 +1,37 @@ +{ fetchurl, fetchpatch, lib, stdenv, autoconf, libpcap, ncurses, pkg-config, glib }: + +stdenv.mkDerivation { + name = "jnettop-0.13.0"; + + src = fetchurl { + url = "http://jnettop.kubs.info/dist/jnettop-0.13.0.tar.gz"; + sha256 = "1855np7c4b0bqzhf1l1dyzxb90fpnvrirdisajhci5am6als31z9"; + }; + + nativeBuildInputs = [ pkg-config autoconf ]; + buildInputs = [ libpcap ncurses glib ]; + + patches = [ + ./no-dns-resolution.patch + (fetchpatch { + url = "https://sources.debian.net/data/main/j/jnettop/0.13.0-1/debian/patches/0001-Use-64-bit-integers-for-byte-totals-support-bigger-u.patch"; + sha256 = "1b0alc12sj8pzcb66f8xslbqlbsvq28kz34v6jfhbb1q25hyr7jg"; + }) + ]; + + preConfigure = "autoconf "; + + meta = { + description = "Network traffic visualizer"; + + longDescription = '' + Jnettop is a traffic visualiser, which captures traffic going + through the host it is running from and displays streams sorted + by bandwidth they use. + ''; + + homepage = "http://jnettop.kubs.info/"; + license = lib.licenses.gpl2Plus; + platforms = lib.platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/jnettop/no-dns-resolution.patch b/nixpkgs/pkgs/tools/networking/jnettop/no-dns-resolution.patch new file mode 100644 index 000000000000..65928a373009 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/jnettop/no-dns-resolution.patch @@ -0,0 +1,13 @@ +When built in a chroot, `configure' fails to resolve `localhost'. +Furthermore that test appears to be useless. + +--- jnettop-0.13.0/configure.ac 2006-04-29 15:34:09.000000000 +0200 ++++ jnettop-0.13.0/configure.ac 2008-12-03 15:11:28.000000000 +0100 +@@ -63,7 +63,6 @@ AC_NETTOP_CHECK_IN6_ADDR + + LDFLAGS="$LDFLAGS $NSL_LIBS $SOCKET_LIBS" + +-AC_NETTOP_CHECK_WORKING_RESOLVER + AC_NETTOP_CHECK_GETHOSTBYADDR_R + + AM_PATH_GLIB_2_0(2.0.1,, AC_MSG_ERROR("glib >= 2.0.1 library required"), gthread) diff --git a/nixpkgs/pkgs/tools/networking/junkie/default.nix b/nixpkgs/pkgs/tools/networking/junkie/default.nix new file mode 100644 index 000000000000..58b35f2f53fa --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/junkie/default.nix @@ -0,0 +1,36 @@ +{ lib, stdenv, fetchFromGitHub, pkg-config, libpcap, guile, openssl }: + +stdenv.mkDerivation rec { + pname = "junkie"; + version = "2.8.0"; + + src = fetchFromGitHub { + owner = "rixed"; + repo = "junkie"; + rev = "v${version}"; + sha256 = "0kfdjgch667gfb3qpiadd2dj3fxc7r19nr620gffb1ahca02wq31"; + }; + buildInputs = [ libpcap guile openssl ]; + nativeBuildInputs = [ pkg-config ]; + configureFlags = [ + "GUILELIBDIR=\${out}/share/guile/site" + "GUILECACHEDIR=\${out}/lib/guile/ccache" + ]; + + meta = { + description = "Deep packet inspection swiss-army knife"; + homepage = "https://github.com/rixed/junkie"; + license = lib.licenses.agpl3Plus; + maintainers = [ lib.maintainers.rixed ]; + platforms = lib.platforms.unix; + longDescription = '' + Junkie is a network sniffer like Tcpdump or Wireshark, but designed to + be easy to program and extend. + + It comes with several command line tools to demonstrate this: + - a packet dumper; + - a nettop tool; + - a tool listing TLS certificates... + ''; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/jwhois/connect.patch b/nixpkgs/pkgs/tools/networking/jwhois/connect.patch new file mode 100644 index 000000000000..c26025a82392 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/jwhois/connect.patch @@ -0,0 +1,60 @@ +https://bugzilla.redhat.com/attachment.cgi?id=265091 + +This fixes somewhat reversed logic of trying to connect to WHOIS server. +Tue Nov 20 2007, Lubomir Kundrak <lkundrak@redhat.com> + +--- jwhois-4.0/src/utils.c.connect 2007-06-26 09:00:20.000000000 +0200 ++++ jwhois-4.0/src/utils.c 2007-11-20 17:05:33.000000000 +0100 +@@ -247,7 +247,7 @@ make_connect(const char *host, int port) + { + return -1; + } +- while (res) ++ for (; res; res = res->ai_next) + { + sa = res->ai_addr; + sockfd = socket(res->ai_family, res->ai_socktype, res->ai_protocol); +@@ -266,15 +266,15 @@ make_connect(const char *host, int port) + flags = fcntl(sockfd, F_GETFL, 0); + if (fcntl(sockfd, F_SETFL, flags|O_NONBLOCK) == -1) + { ++ close (sockfd); + return -1; + } + +- + error = connect(sockfd, res->ai_addr, res->ai_addrlen); +- + if (error < 0 && errno != EINPROGRESS) + { +- break; ++ close (sockfd); ++ continue; + } + + FD_ZERO(&fdset); +@@ -283,18 +283,20 @@ make_connect(const char *host, int port) + error = select(FD_SETSIZE, NULL, &fdset, NULL, &timeout); + if (error == 0) + { +- break; ++ close (sockfd); ++ return -1; + } + + retlen = sizeof(retval); + error = getsockopt(sockfd, SOL_SOCKET, SO_ERROR, &retval, &retlen); + if (error < 0 || retval) + { +- break; ++ close (sockfd); ++ return -1; + } +- res = res->ai_next; ++ ++ break; + } +- if (error < 0 || retval) return -1; + #endif + + return sockfd; diff --git a/nixpkgs/pkgs/tools/networking/jwhois/default.nix b/nixpkgs/pkgs/tools/networking/jwhois/default.nix new file mode 100644 index 000000000000..6eb26de82fc9 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/jwhois/default.nix @@ -0,0 +1,26 @@ +{lib, stdenv, lynx, fetchurl}: + +stdenv.mkDerivation { + name = "jwhois-4.0"; + + src = fetchurl { + url = "mirror://gnu/jwhois/jwhois-4.0.tar.gz"; + sha256 = "0knn7iaj5v0n6jpmldyv2yk4bcy9dn3kywmv63bwc5drh9kvi6zs"; + }; + + postInstall = '' + ln -s jwhois $out/bin/whois + sed -i -e "s|/usr/bin/lynx|${lynx}/bin/lynx|g" $out/etc/jwhois.conf + ''; + + patches = [ ./connect.patch ./service-name.patch ]; + + makeFlags = [ "AR=${stdenv.cc.bintools.targetPrefix}ar" ]; + + meta = { + description = "A client for the WHOIS protocol allowing you to query the owner of a domain name"; + homepage = "https://www.gnu.org/software/jwhois/"; + license = lib.licenses.gpl3; + platforms = lib.platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/jwhois/service-name.patch b/nixpkgs/pkgs/tools/networking/jwhois/service-name.patch new file mode 100644 index 000000000000..170eddbad794 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/jwhois/service-name.patch @@ -0,0 +1,17 @@ +--- a/src/dns.c 2007-06-25 23:58:38.000000000 -0700 ++++ b/src/dns.c 2016-06-04 16:20:19.644865127 -0700 +@@ -113,12 +113,13 @@ + lookup_host_addrinfo(struct addrinfo **res, const char *host, int port) + { + struct addrinfo hints; +- char ascport[10] = "whois"; ++ char ascport[10] = "nicname"; + int error; + + memset(&hints, 0, sizeof(hints)); + hints.ai_family = PF_UNSPEC; + ++ hints.ai_flags = AI_ADDRCONFIG; + hints.ai_socktype = SOCK_STREAM; + if (port) + sprintf(ascport, "%9.9d", port); diff --git a/nixpkgs/pkgs/tools/networking/kail/default.nix b/nixpkgs/pkgs/tools/networking/kail/default.nix new file mode 100644 index 000000000000..ae431b329eaf --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/kail/default.nix @@ -0,0 +1,32 @@ +{ lib, buildGoPackage, fetchFromGitHub }: + +buildGoPackage rec { + pname = "kail"; + version = "0.8.0"; + + goPackagePath = "github.com/boz/kail"; + + src = fetchFromGitHub { + owner = "boz"; + repo = "kail"; + rev = "v${version}"; + sha256 = "0ibk7j40pj6f2086qcnwp998wld61d2gvrv7yiy6hlkalhww2pq7"; + }; + + # regenerate deps.nix using following steps: + # + # go get -u github.com/boz/kail + # cd $GOPATH/src/github.com/boz/kail + # git checkout <version> + # dep init + # dep2nix + deleteVendor = true; + goDeps = ./deps.nix; + + meta = with lib; { + description = "Kubernetes log viewer"; + homepage = "https://github.com/boz/kail"; + license = licenses.mit; + maintainers = with maintainers; [ offline vdemeester ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/kail/deps.nix b/nixpkgs/pkgs/tools/networking/kail/deps.nix new file mode 100644 index 000000000000..b6d9c3e9cf34 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/kail/deps.nix @@ -0,0 +1,408 @@ +# file generated from Gopkg.lock using dep2nix (https://github.com/nixcloud/dep2nix) +[ + { + goPackagePath = "cloud.google.com/go"; + fetch = { + type = "git"; + url = "https://code.googlesource.com/gocloud"; + rev = "06f11fffc537c4aef126d9fd3a92e2d7968f118f"; + sha256 = "1zhr1pyzk44zb95r2bcs4kkngvmzdr5bac55315nnzl3adx4y4dn"; + }; + } + { + goPackagePath = "github.com/Azure/go-autorest"; + fetch = { + type = "git"; + url = "https://github.com/Azure/go-autorest"; + rev = "1ff28809256a84bb6966640ff3d0371af82ccba4"; + sha256 = "0sxvj2j1833bqwxvhq3wq3jgq73rnb81pnzvl0x3y1m0hzpaf2zv"; + }; + } + { + goPackagePath = "github.com/alecthomas/template"; + fetch = { + type = "git"; + url = "https://github.com/alecthomas/template"; + rev = "a0175ee3bccc567396460bf5acd36800cb10c49c"; + sha256 = "0qjgvvh26vk1cyfq9fadyhfgdj36f1iapbmr5xp6zqipldz8ffxj"; + }; + } + { + goPackagePath = "github.com/alecthomas/units"; + fetch = { + type = "git"; + url = "https://github.com/alecthomas/units"; + rev = "2efee857e7cfd4f3d0138cc3cbb1b4966962b93a"; + sha256 = "1j65b91qb9sbrml9cpabfrcf07wmgzzghrl7809hjjhrmbzri5bl"; + }; + } + { + goPackagePath = "github.com/boz/go-lifecycle"; + fetch = { + type = "git"; + url = "https://github.com/boz/go-lifecycle"; + rev = "c39961a5a0ce6b046f15d62bcbed79701666a9e0"; + sha256 = "12xzjzgi0pspb28xrcmp4v33jij2bbg609z1kpq1pql9mxs6h31k"; + }; + } + { + goPackagePath = "github.com/boz/go-logutil"; + fetch = { + type = "git"; + url = "https://github.com/boz/go-logutil"; + rev = "9d21a9e4757dbc497f947fe5253f9570c34562fa"; + sha256 = "0rhhyvvz1lvjalv3hx4yvyh90jqfia27nzx9m54m0i7d0znrwpbj"; + }; + } + { + goPackagePath = "github.com/boz/kcache"; + fetch = { + type = "git"; + url = "https://github.com/boz/kcache"; + rev = "a012826955254d3f31548911e75a9dbd817f9470"; + sha256 = "0xqw4mgz0scjrcfsyfwfdhggq1q80dv4mdqgdaryy5ir18srg15l"; + }; + } + { + goPackagePath = "github.com/davecgh/go-spew"; + fetch = { + type = "git"; + url = "https://github.com/davecgh/go-spew"; + rev = "adab96458c51a58dc1783b3335dcce5461522e75"; + sha256 = "1y743w875aqqwggrh4lwlmqyx7ls5m1bnw5y4vr3zps4ib3gb4n5"; + }; + } + { + goPackagePath = "github.com/dgrijalva/jwt-go"; + fetch = { + type = "git"; + url = "https://github.com/dgrijalva/jwt-go"; + rev = "06ea1031745cb8b3dab3f6a236daf2b0aa468b7e"; + sha256 = "08m27vlms74pfy5z79w67f9lk9zkx6a9jd68k3c4msxy75ry36mp"; + }; + } + { + goPackagePath = "github.com/fatih/color"; + fetch = { + type = "git"; + url = "https://github.com/fatih/color"; + rev = "67c513e5729f918f5e69786686770c27141a4490"; + sha256 = "045i2y2h1a6ml7fm1b3if4692320kjgg3cpxn7chlmpq7z1bmrrn"; + }; + } + { + goPackagePath = "github.com/ghodss/yaml"; + fetch = { + type = "git"; + url = "https://github.com/ghodss/yaml"; + rev = "0ca9ea5df5451ffdf184b4428c902747c2c11cd7"; + sha256 = "0skwmimpy7hlh7pva2slpcplnm912rp3igs98xnqmn859kwa5v8g"; + }; + } + { + goPackagePath = "github.com/gogo/protobuf"; + fetch = { + type = "git"; + url = "https://github.com/gogo/protobuf"; + rev = "1c2b16bc280d6635de6c52fc1471ab962dc36ec9"; + sha256 = "0h9vkfy3ydz0d6x72853yg49r9k54cgjnlv6a7v12gzqw47p941i"; + }; + } + { + goPackagePath = "github.com/golang/glog"; + fetch = { + type = "git"; + url = "https://github.com/golang/glog"; + rev = "23def4e6c14b4da8ac2ed8007337bc5eb5007998"; + sha256 = "0jb2834rw5sykfr937fxi8hxi2zy80sj2bdn9b3jb4b26ksqng30"; + }; + } + { + goPackagePath = "github.com/golang/protobuf"; + fetch = { + type = "git"; + url = "https://github.com/golang/protobuf"; + rev = "1909bc2f63dc92bb931deace8b8312c4db72d12f"; + sha256 = "0d4pknkgp5qlbfpw8xp81dqgrfm0na1pfi2ll559nwvjz5vc90g5"; + }; + } + { + goPackagePath = "github.com/google/btree"; + fetch = { + type = "git"; + url = "https://github.com/google/btree"; + rev = "316fb6d3f031ae8f4d457c6c5186b9e3ded70435"; + sha256 = "1fyj10cy2d37mpfk73hjfjwpsgpnmdzf2mrkkvzyx0d41sf46xfd"; + }; + } + { + goPackagePath = "github.com/google/gofuzz"; + fetch = { + type = "git"; + url = "https://github.com/google/gofuzz"; + rev = "24818f796faf91cd76ec7bddd72458fbced7a6c1"; + sha256 = "0cq90m2lgalrdfrwwyycrrmn785rgnxa3l3vp9yxkvnv88bymmlm"; + }; + } + { + goPackagePath = "github.com/googleapis/gnostic"; + fetch = { + type = "git"; + url = "https://github.com/googleapis/gnostic"; + rev = "57b0290873708074edf87ad921eccec8bef5f8ec"; + sha256 = "14raxxsx2bww4f0am0yygv64h950avkswm7bdvq6k4d4lry6dgg8"; + }; + } + { + goPackagePath = "github.com/gophercloud/gophercloud"; + fetch = { + type = "git"; + url = "https://github.com/gophercloud/gophercloud"; + rev = "b4c2377fa77951a0e08163f52dc9b3e206355194"; + sha256 = "00j9ny59zlf3ajwydf2k41n3l92kl2hf0ljx9x73jcfkdkn2xv5k"; + }; + } + { + goPackagePath = "github.com/gregjones/httpcache"; + fetch = { + type = "git"; + url = "https://github.com/gregjones/httpcache"; + rev = "c1f8028e62adb3d518b823a2f8e6a95c38bdd3aa"; + sha256 = "1v7fb4ix2xg0plx5p1f7xd1srvimyss7v7ppn3j7py9ycl560qhr"; + }; + } + { + goPackagePath = "github.com/imdario/mergo"; + fetch = { + type = "git"; + url = "https://github.com/imdario/mergo"; + rev = "e3000cb3d28c72b837601cac94debd91032d19fe"; + sha256 = "1bsz1aj0h266x7g08jj7f3nd3d5islbad0cygb5vh37hjgzirg4d"; + }; + } + { + goPackagePath = "github.com/json-iterator/go"; + fetch = { + type = "git"; + url = "https://github.com/json-iterator/go"; + rev = "ab8a2e0c74be9d3be70b3184d9acc634935ded82"; + sha256 = "1x3wz44p1238gpyzkiiilvvrq9q8dwjdm9kdidq65yjq0zcn0sq4"; + }; + } + { + goPackagePath = "github.com/mattn/go-colorable"; + fetch = { + type = "git"; + url = "https://github.com/mattn/go-colorable"; + rev = "6df6d4d004b64986bbb0d1b25945f42b44787e90"; + sha256 = "0ha2biq708is9i3hqc30vihcpajak3qawn0rnacb9k1gyxsxwb60"; + }; + } + { + goPackagePath = "github.com/mattn/go-isatty"; + fetch = { + type = "git"; + url = "https://github.com/mattn/go-isatty"; + rev = "fc9e8d8ef48496124e79ae0df75490096eccf6fe"; + sha256 = "1r5f9gkavkb1w6sr0qs5kj16706xirl3qnlq3hqpszkw9w27x65a"; + }; + } + { + goPackagePath = "github.com/modern-go/concurrent"; + fetch = { + type = "git"; + url = "https://github.com/modern-go/concurrent"; + rev = "bacd9c7ef1dd9b15be4a9909b8ac7a4e313eec94"; + sha256 = "0s0fxccsyb8icjmiym5k7prcqx36hvgdwl588y0491gi18k5i4zs"; + }; + } + { + goPackagePath = "github.com/modern-go/reflect2"; + fetch = { + type = "git"; + url = "https://github.com/modern-go/reflect2"; + rev = "94122c33edd36123c84d5368cfb2b69df93a0ec8"; + sha256 = "06a3sablw53n1dqqbr2f53jyksbxdmmk8axaas4yvnhyfi55k4lf"; + }; + } + { + goPackagePath = "github.com/petar/GoLLRB"; + fetch = { + type = "git"; + url = "https://github.com/petar/GoLLRB"; + rev = "53be0d36a84c2a886ca057d34b6aa4468df9ccb4"; + sha256 = "01xp3lcamqkvl91jg6ly202gdsgf64j39rkrcqxi6v4pbrcv7hz0"; + }; + } + { + goPackagePath = "github.com/peterbourgon/diskv"; + fetch = { + type = "git"; + url = "https://github.com/peterbourgon/diskv"; + rev = "5f041e8faa004a95c88a202771f4cc3e991971e6"; + sha256 = "1mxpa5aad08x30qcbffzk80g9540wvbca4blc1r2qyzl65b8929b"; + }; + } + { + goPackagePath = "github.com/pkg/errors"; + fetch = { + type = "git"; + url = "https://github.com/pkg/errors"; + rev = "2b3a18b5f0fb6b4f9190549597d3f962c02bc5eb"; + sha256 = "07fd392kqyaj7fnl4sgzy7fcs0sw4jx3mx2khhgk64n9j9i37l59"; + }; + } + { + goPackagePath = "github.com/pmezard/go-difflib"; + fetch = { + type = "git"; + url = "https://github.com/pmezard/go-difflib"; + rev = "792786c7400a136282c1664665ae0a8db921c6c2"; + sha256 = "0c1cn55m4rypmscgf0rrb88pn58j3ysvc2d0432dp3c6fqg6cnzw"; + }; + } + { + goPackagePath = "github.com/sirupsen/logrus"; + fetch = { + type = "git"; + url = "https://github.com/sirupsen/logrus"; + rev = "181d419aa9e2223811b824e8f0b4af96f9ba9302"; + sha256 = "08ff47w4clnkym3l0v4hhhfq21zvvwzpljvs0qvki5k0azv7siyc"; + }; + } + { + goPackagePath = "github.com/spf13/pflag"; + fetch = { + type = "git"; + url = "https://github.com/spf13/pflag"; + rev = "e57e3eeb33f795204c1ca35f56c44f83227c6e66"; + sha256 = "13mhx4i913jil32j295m3a36jzvq1y64xig0naadiz7q9ja011r2"; + }; + } + { + goPackagePath = "github.com/stretchr/testify"; + fetch = { + type = "git"; + url = "https://github.com/stretchr/testify"; + rev = "2aa2c176b9dab406a6970f6a55f513e8a8c8b18f"; + sha256 = "1j92x4291flz3i4pk6bi3y59nnsi6lj34zmyfp7axf68fd8vm5ml"; + }; + } + { + goPackagePath = "golang.org/x/crypto"; + fetch = { + type = "git"; + url = "https://go.googlesource.com/crypto"; + rev = "b176d7def5d71bdd214203491f89843ed217f420"; + sha256 = "1ayi4iagsxhf193rx93j6y2rb48730hgm2qbahiq9lawm5g3vc14"; + }; + } + { + goPackagePath = "golang.org/x/net"; + fetch = { + type = "git"; + url = "https://go.googlesource.com/net"; + rev = "1c05540f6879653db88113bc4a2b70aec4bd491f"; + sha256 = "0h8yqb0vcqgllgydrf9d3rzp83w8wlr8f0nm6r1rwf2qg30pq1pd"; + }; + } + { + goPackagePath = "golang.org/x/oauth2"; + fetch = { + type = "git"; + url = "https://go.googlesource.com/oauth2"; + rev = "9a379c6b3e95a790ffc43293c2a78dee0d7b6e20"; + sha256 = "156wff8s9g3sxni2z80wky4v688pvdgfzxbpfp5rmqjvgqnifxkf"; + }; + } + { + goPackagePath = "golang.org/x/sys"; + fetch = { + type = "git"; + url = "https://go.googlesource.com/sys"; + rev = "2d3e384235de683634e9080b58f757466840aa48"; + sha256 = "1w8zrcjv4sfi3skchdbvbixgwzp5n1g0vny8r20dlapnqbazah0x"; + }; + } + { + goPackagePath = "golang.org/x/text"; + fetch = { + type = "git"; + url = "https://go.googlesource.com/text"; + rev = "b19bf474d317b857955b12035d2c5acb57ce8b01"; + sha256 = "0wc8csaafp0ps9jb2hdk8d6xpyw1axhk1np73h0z17x09zk3ylcr"; + }; + } + { + goPackagePath = "golang.org/x/time"; + fetch = { + type = "git"; + url = "https://go.googlesource.com/time"; + rev = "fbb02b2291d28baffd63558aa44b4b56f178d650"; + sha256 = "0jjqcv6rzihlgg4i797q80g1f6ch5diz2kxqh6488gwkb6nds4h4"; + }; + } + { + goPackagePath = "google.golang.org/appengine"; + fetch = { + type = "git"; + url = "https://github.com/golang/appengine"; + rev = "d9a072cfa7b9736e44311ef77b3e09d804bfa599"; + sha256 = "07x7s65q9pydpaniga6zf259kw7qs40q6554wb22inq423wcs0nb"; + }; + } + { + goPackagePath = "gopkg.in/alecthomas/kingpin.v2"; + fetch = { + type = "git"; + url = "https://github.com/alecthomas/kingpin"; + rev = "1087e65c9441605df944fb12c33f0fe7072d18ca"; + sha256 = "18llqzkdqf62qbqcv2fd3j0igl6cwwn4dissf5skkvxrcxjcmmj0"; + }; + } + { + goPackagePath = "gopkg.in/inf.v0"; + fetch = { + type = "git"; + url = "https://github.com/go-inf/inf"; + rev = "3887ee99ecf07df5b447e9b00d9c0b2adaa9f3e4"; + sha256 = "0rf3vwyb8aqnac9x9d6ax7z5526c45a16yjm2pvkijr6qgqz8b82"; + }; + } + { + goPackagePath = "gopkg.in/yaml.v2"; + fetch = { + type = "git"; + url = "https://github.com/go-yaml/yaml"; + rev = "eb3733d160e74a9c7e442f435eb3bea458e1d19f"; + sha256 = "1srhvcaa9db3a6xj29mkjr5kg33y71pclrlx4vcwz5m1lgb5c7q6"; + }; + } + { + goPackagePath = "k8s.io/api"; + fetch = { + type = "git"; + url = "https://github.com/kubernetes/api"; + rev = "2d6f90ab1293a1fb871cf149423ebb72aa7423aa"; + sha256 = "1cwrwdm104xd3608b1a5mw6a19w45532p647xdwnyn62rw2f08jx"; + }; + } + { + goPackagePath = "k8s.io/apimachinery"; + fetch = { + type = "git"; + url = "https://github.com/kubernetes/apimachinery"; + rev = "103fd098999dc9c0c88536f5c9ad2e5da39373ae"; + sha256 = "04navnpm59d75dhlz07rmay7m2izrf4m0i9xklxzqg7mlk9g20jc"; + }; + } + { + goPackagePath = "k8s.io/client-go"; + fetch = { + type = "git"; + url = "https://github.com/kubernetes/client-go"; + rev = "1f13a808da65775f22cbf47862c4e5898d8f4ca1"; + sha256 = "1vkcjg80l49hxiadqmkkd031kj6kc10m8mwcnla3k1ml8fv4qna9"; + }; + } +] diff --git a/nixpkgs/pkgs/tools/networking/kapp/default.nix b/nixpkgs/pkgs/tools/networking/kapp/default.nix new file mode 100644 index 000000000000..181a9d9b85ef --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/kapp/default.nix @@ -0,0 +1,32 @@ +{ lib, buildGoModule, fetchFromGitHub, installShellFiles }: +buildGoModule rec { + pname = "kapp"; + version = "0.37.0"; + + src = fetchFromGitHub { + owner = "vmware-tanzu"; + repo = "carvel-kapp"; + rev = "v${version}"; + sha256 = "sha256-SxS6KBiKc68PcRycdVDWWfXBKOJvo7GuG/0dUQGcHsg="; + }; + + vendorSha256 = null; + + subPackages = [ "cmd/kapp" ]; + + nativeBuildInputs = [ installShellFiles ]; + + postInstall = '' + for shell in bash fish zsh; do + $out/bin/kapp completion $shell > kapp.$shell + installShellCompletion kapp.$shell + done + ''; + + meta = with lib; { + description = "CLI tool that encourages Kubernetes users to manage bulk resources with an application abstraction for grouping"; + homepage = "https://get-kapp.io"; + license = licenses.asl20; + maintainers = with maintainers; [ brodes ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/kea/default.nix b/nixpkgs/pkgs/tools/networking/kea/default.nix new file mode 100644 index 000000000000..8daa2f10d7e1 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/kea/default.nix @@ -0,0 +1,65 @@ +{ stdenv +, lib +, fetchurl +, autoreconfHook +, pkg-config +, boost +, botan2 +, libmysqlclient +, log4cplus +, postgresql +, python3 }: + +stdenv.mkDerivation rec { + pname = "kea"; + version = "1.9.8"; + + src = fetchurl { + url = "https://ftp.isc.org/isc/${pname}/${version}/${pname}-${version}.tar.gz"; + sha256 = "sha256-EAi1Ic3YEF0or37At48saKwmAczTwf5GtbEsQNopbl0="; + }; + + patches = [ ./dont-create-var.patch ]; + + postPatch = '' + substituteInPlace ./src/bin/keactrl/Makefile.am --replace '@sysconfdir@' "$out/etc" + ''; + + configureFlags = [ + "--enable-perfdhcp" + "--enable-shell" + "--localstatedir=/var" + "--with-mysql=${lib.getDev libmysqlclient}/bin/mysql_config" + "--with-pgsql=${postgresql}/bin/pg_config" + ]; + + nativeBuildInputs = [ + autoreconfHook + pkg-config + ]; + + buildInputs = [ + boost + botan2 + libmysqlclient + log4cplus + python3 + ]; + + enableParallelBuilding = true; + + meta = with lib; { + homepage = "https://kea.isc.org/"; + description = "High-performance, extensible DHCP server by ISC"; + longDescription = '' + KEA is a new open source DHCPv4/DHCPv6 server being developed by + Internet Systems Consortium. The objective of this project is to + provide a very high-performance, extensible DHCP server engine for + use by enterprises and service providers, either as is or with + extensions and modifications. + ''; + license = licenses.mpl20; + platforms = platforms.unix; + maintainers = with maintainers; [ fpletz ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/kea/dont-create-var.patch b/nixpkgs/pkgs/tools/networking/kea/dont-create-var.patch new file mode 100644 index 000000000000..53e05b5b62b8 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/kea/dont-create-var.patch @@ -0,0 +1,28 @@ +diff --git a/Makefile.am b/Makefile.am +index 10708e7..d4efd73 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -150,13 +150,6 @@ cppcheck: + docs: + $(MAKE) -C doc/sphinx + +- +-# These steps are necessary during installation +-install-exec-hook: +- mkdir -p $(DESTDIR)${localstatedir}/log/ +- mkdir -p $(DESTDIR)${localstatedir}/lib/${PACKAGE_NAME} +- mkdir -p $(DESTDIR)${runstatedir}/${PACKAGE_NAME} +- + EXTRA_DIST = tools/path_replacer.sh + EXTRA_DIST += tools/mk_cfgrpt.sh + +diff --git a/src/lib/dhcpsrv/Makefile.am b/src/lib/dhcpsrv/Makefile.am +index a0a0289..ba42f8a 100644 +--- a/src/lib/dhcpsrv/Makefile.am ++++ b/src/lib/dhcpsrv/Makefile.am +@@ -408,5 +408,3 @@ libkea_dhcpsrv_parsers_include_HEADERS = \ + parsers/simple_parser4.h \ + parsers/simple_parser6.h + +-install-data-local: +- $(mkinstalldirs) $(DESTDIR)$(dhcp_data_dir) diff --git a/nixpkgs/pkgs/tools/networking/keepalived/default.nix b/nixpkgs/pkgs/tools/networking/keepalived/default.nix new file mode 100644 index 000000000000..48fe72d42967 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/keepalived/default.nix @@ -0,0 +1,38 @@ +{ lib, stdenv, fetchFromGitHub, nixosTests +, libnfnetlink, libnl, net-snmp, openssl +, pkg-config, autoreconfHook }: + +stdenv.mkDerivation rec { + pname = "keepalived"; + version = "2.2.2"; + + src = fetchFromGitHub { + owner = "acassen"; + repo = "keepalived"; + rev = "v${version}"; + sha256 = "sha256-qugEEbOQ4bemzelIOaNFvo3piMZpKUZGjR+4XF8aLHw="; + }; + + buildInputs = [ + libnfnetlink + libnl + net-snmp + openssl + ]; + + passthru.tests.keepalived = nixosTests.keepalived; + + nativeBuildInputs = [ pkg-config autoreconfHook ]; + + configureFlags = [ + "--enable-sha1" + "--enable-snmp" + ]; + + meta = with lib; { + homepage = "https://keepalived.org"; + description = "Routing software written in C"; + license = licenses.gpl2; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/lftp/default.nix b/nixpkgs/pkgs/tools/networking/lftp/default.nix new file mode 100644 index 000000000000..f51c6f034dd0 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/lftp/default.nix @@ -0,0 +1,39 @@ +{ lib, stdenv, fetchurl, gnutls, pkg-config, readline, zlib, libidn2, gmp, libiconv, libunistring, gettext }: + +stdenv.mkDerivation rec { + pname = "lftp"; + version = "4.9.2"; + + src = fetchurl { + urls = [ + "https://lftp.tech/ftp/${pname}-${version}.tar.xz" + "https://ftp.st.ryukoku.ac.jp/pub/network/ftp/lftp/${pname}-${version}.tar.xz" + "https://lftp.yar.ru/ftp/${pname}-${version}.tar.xz" + ]; + sha256 = "03b7y0h3mf4jfq5y8zw6hv9v44z3n6i8hc1iswax96y3z7sc85y5"; + }; + + nativeBuildInputs = [ pkg-config ]; + + buildInputs = [ gnutls readline zlib libidn2 gmp libiconv libunistring gettext ]; + + hardeningDisable = lib.optional stdenv.isDarwin "format"; + + configureFlags = [ + "--with-readline=${readline.dev}" + "--with-zlib=${zlib.dev}" + "--without-expat" + ]; + + installFlags = [ "PREFIX=$(out)" ]; + + enableParallelBuilding = true; + + meta = with lib; { + description = "A file transfer program supporting a number of network protocols"; + homepage = "https://lftp.tech/"; + license = licenses.gpl3; + platforms = platforms.unix; + maintainers = [ maintainers.bjornfor ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/libnids/default.nix b/nixpkgs/pkgs/tools/networking/libnids/default.nix new file mode 100644 index 000000000000..a2cf239b56ba --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/libnids/default.nix @@ -0,0 +1,31 @@ +{ lib, stdenv, fetchzip, libpcap, glib, pkg-config, libnet }: +stdenv.mkDerivation { + pname = "libnids"; + version = "1.24"; + src = fetchzip { + url = "mirror://sourceforge/libnids/libnids-1.24.tar.gz"; + sha256 = "1cblklfdfxcmy0an6xyyzx4l877xdawhjd28daqfsvrh81mb07k1"; + }; + nativeBuildInputs = [ pkg-config ]; + buildInputs = [ libpcap glib libnet ]; + + /* + Quoting the documentation of glib: g_thread_init has been deprecated since + version 2.32 and should not be used in newly-written code. This function is + no longer necessary. The GLib threading system is automatically initialized + at the start of your program. + + this is necessary for dsniff to compile; otherwise g_thread_init is a missing + symbol when linking (?!?) + */ + NIX_CFLAGS_COMPILE="-Dg_thread_init= "; + + meta = with lib; { + description = "An E-component of Network Intrusion Detection System which emulates the IP stack of Linux 2.0.x"; + homepage = "http://libnids.sourceforge.net/"; + license = licenses.gpl2; + maintainers = [ maintainers.symphorien ]; + # probably also bsd and solaris + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/libreswan/default.nix b/nixpkgs/pkgs/tools/networking/libreswan/default.nix new file mode 100644 index 000000000000..24b7176e82b5 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/libreswan/default.nix @@ -0,0 +1,149 @@ +{ lib +, stdenv +, fetchurl +, fetchpatch +, nixosTests +, pkg-config +, systemd +, gmp +, unbound +, bison +, flex +, pam +, libevent +, libcap_ng +, curl +, nspr +, bash +, iproute2 +, iptables +, procps +, coreutils +, gnused +, gawk +, nss +, which +, python3 +, libselinux +, ldns +, xmlto +, docbook_xml_dtd_412 +, docbook_xsl +, findXMLCatalogs +}: + +let + # Tools needed by ipsec scripts + binPath = lib.makeBinPath [ + iproute2 iptables procps + coreutils gnused gawk + nss.tools which + ]; +in + +stdenv.mkDerivation rec { + pname = "libreswan"; + version = "4.4"; + + src = fetchurl { + url = "https://download.libreswan.org/${pname}-${version}.tar.gz"; + sha256 = "0xj974yc0y1r7235zl4jhvxqz3bpb8js2fy9ic820zq9swh0lgsz"; + }; + + strictDeps = true; + + nativeBuildInputs = [ + bison + flex + pkg-config + xmlto + docbook_xml_dtd_412 + docbook_xsl + findXMLCatalogs + ]; + + buildInputs = [ + systemd coreutils + gnused gawk gmp unbound pam libevent + libcap_ng curl nspr nss ldns + # needed to patch shebangs + python3 bash + ] ++ lib.optional stdenv.isLinux libselinux; + + patches = [ + # Fix compilation on aarch64, remove on next update + (fetchpatch { + url = "https://github.com/libreswan/libreswan/commit/ea50d36d2886e44317ba5ba841de1d1bf91aee6c.patch"; + sha256 = "1jp89rm9jp55zmiyimyhg7yadj0fwwxaw7i5gyclrs38w3y1aacj"; + }) + ]; + + prePatch = '' + # Correct iproute2 path + sed -e 's|"/sbin/ip"|"${iproute2}/bin/ip"|' \ + -e 's|"/sbin/iptables"|"${iptables}/bin/iptables"|' \ + -i initsystems/systemd/ipsec.service.in \ + programs/verify/verify.in + + # Prevent the makefile from trying to + # reload the systemd daemon or create tmpfiles + sed -e 's|systemctl|true|g' \ + -e 's|systemd-tmpfiles|true|g' \ + -i initsystems/systemd/Makefile + + # Fix the ipsec program from crushing the PATH + sed -e 's|\(PATH=".*"\):.*$|\1:$PATH|' -i programs/ipsec/ipsec.in + + # Fix python script to use the correct python + sed -e 's/^\(\W*\)installstartcheck()/\1sscmd = "ss"\n\0/' \ + -i programs/verify/verify.in + + # Replace wget with curl to save a dependency + curlArgs='-s --remote-name-all --output-dir' + sed -e "s|wget -q -P|${curl}/bin/curl $curlArgs|g" \ + -i programs/letsencrypt/letsencrypt.in + + # Patch the Makefile: + # 1. correct the pam.d directory install path + # 2. do not create the /var/lib/ directory + sed -e 's|$(DESTDIR)/etc/pam.d|$(out)/etc/pam.d|' \ + -e '/test ! -d $(NSSDIR)/,+3d' \ + -i configs/Makefile + ''; + + # Set appropriate paths for build + preBuild = "export INC_USRLOCAL=\${out}"; + + makeFlags = [ + "INITSYSTEM=systemd" + "UNITDIR=$(out)/etc/systemd/system/" + "TMPFILESDIR=$(out)/lib/tmpfiles.d/" + ]; + + # Hack to make install work + installFlags = [ + "FINALVARDIR=\${out}/var" + "FINALSYSCONFDIR=\${out}/etc" + ]; + + postInstall = '' + # Install examples directory (needed for letsencrypt) + cp -r docs/examples $out/share/doc/libreswan/examples + ''; + + postFixup = '' + # Add a PATH to the main "ipsec" script + sed -e '0,/^$/{s||export PATH=${binPath}:$PATH|}' \ + -i $out/bin/ipsec + ''; + + passthru.tests.libreswan = nixosTests.libreswan; + + meta = with lib; { + homepage = "https://libreswan.org"; + description = "A free software implementation of the VPN protocol based on IPSec and the Internet Key Exchange"; + platforms = platforms.linux ++ platforms.freebsd; + license = with licenses; [ gpl2Plus mpl20 ] ; + maintainers = with maintainers; [ afranchuk rnhmjoj ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/linkchecker/default.nix b/nixpkgs/pkgs/tools/networking/linkchecker/default.nix new file mode 100644 index 000000000000..05da924c47e4 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/linkchecker/default.nix @@ -0,0 +1,54 @@ +{ stdenv, lib, fetchFromGitHub, python3Packages, gettext }: + +with python3Packages; + +buildPythonApplication rec { + pname = "linkchecker"; + version = "10.0.0"; + + src = fetchFromGitHub { + owner = pname; + repo = pname; + rev = "v" + version; + sha256 = "sha256-gcaamRxGn124LZ8rU+WzjRookU3akDO0ZyzI7/S6kFA="; + }; + + nativeBuildInputs = [ gettext ]; + + propagatedBuildInputs = [ + ConfigArgParse + argcomplete + beautifulsoup4 + pyopenssl + dnspython + pyxdg + requests + ]; + + checkInputs = [ + parameterized + pytest + ]; + + postPatch = '' + sed -i 's/^requests.*$/requests>=2.2/' requirements.txt + sed -i "s/'request.*'/'requests >= 2.2'/" setup.py + ''; + + # test_timeit2 is flakey, and depends sleep being precise to the milisecond + checkPhase = '' + ${lib.optionalString stdenv.isDarwin '' + # network tests fails on darwin + rm tests/test_network.py tests/checker/test_http*.py tests/checker/test_content_allows_robots.py tests/checker/test_noproxy.py + ''} + pytest --ignore=tests/checker/{test_telnet,telnetserver}.py \ + -k 'not TestLoginUrl and not test_timeit2' + ''; + + meta = { + description = "Check websites for broken links"; + homepage = "https://linkcheck.github.io/linkchecker/"; + license = lib.licenses.gpl2; + maintainers = with lib.maintainers; [ peterhoeg tweber ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/lldpd/default.nix b/nixpkgs/pkgs/tools/networking/lldpd/default.nix new file mode 100644 index 000000000000..a4e5d565756b --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/lldpd/default.nix @@ -0,0 +1,39 @@ +{ stdenv, lib, fetchurl, pkg-config, removeReferencesTo +, libevent, readline, net-snmp, openssl +}: + +stdenv.mkDerivation rec { + pname = "lldpd"; + version = "1.0.11"; + + src = fetchurl { + url = "https://media.luffy.cx/files/lldpd/${pname}-${version}.tar.gz"; + sha256 = "sha256-tR0VcA+678t/uFw1BrSdMxc6DxXXAPkz7wRAZ7QtRuQ="; + }; + + configureFlags = [ + "--localstatedir=/var" + "--enable-pie" + "--with-snmp" + "--with-systemdsystemunitdir=\${out}/lib/systemd/system" + ]; + + nativeBuildInputs = [ pkg-config removeReferencesTo ]; + buildInputs = [ libevent readline net-snmp openssl ]; + + enableParallelBuilding = true; + + outputs = [ "out" "dev" "man" "doc" ]; + + preFixup = '' + find $out -type f -exec remove-references-to -t ${stdenv.cc} '{}' + + ''; + + meta = with lib; { + description = "802.1ab implementation (LLDP) to help you locate neighbors of all your equipments"; + homepage = "https://vincentbernat.github.io/lldpd/"; + license = licenses.isc; + maintainers = with maintainers; [ fpletz ]; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/logmein-hamachi/default.nix b/nixpkgs/pkgs/tools/networking/logmein-hamachi/default.nix new file mode 100644 index 000000000000..4512e1dc6254 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/logmein-hamachi/default.nix @@ -0,0 +1,45 @@ +{ lib, stdenv, fetchurl }: + +with lib; + +let + arch = + if stdenv.hostPlatform.system == "x86_64-linux" then "x64" + else if stdenv.hostPlatform.system == "i686-linux" then "x86" + else throwSystem; + throwSystem = throw "Unsupported system: ${stdenv.hostPlatform.system}"; + sha256 = + if stdenv.hostPlatform.system == "x86_64-linux" then "0zy0jzvdqccfsg42m2lq1rj8r2c4iypd1h9vxl9824cbl92yim37" + else if stdenv.hostPlatform.system == "i686-linux" then "03ml9xv19km99f0z7fpr21b1zkxvw7q39kjzd8wpb2pds51wnc62" + else throwSystem; + libraries = lib.makeLibraryPath [ stdenv.cc.cc ]; + +in stdenv.mkDerivation rec { + pname = "logmein-hamachi"; + version = "2.1.0.203"; + + src = fetchurl { + url = "https://www.vpn.net/installers/${pname}-${version}-${arch}.tgz"; + inherit sha256; + }; + + installPhase = '' + patchelf \ + --set-interpreter $(cat ${stdenv.cc}/nix-support/dynamic-linker) \ + --set-rpath ${libraries} \ + hamachid + install -D -m755 hamachid $out/bin/hamachid + ln -s $out/bin/hamachid $out/bin/hamachi + ''; + + dontStrip = true; + dontPatchELF = true; + + meta = with lib; { + description = "A hosted VPN service that lets you securely extend LAN-like networks to distributed teams"; + homepage = "https://secure.logmein.com/products/hamachi/"; + license = licenses.unfreeRedistributable; + maintainers = with maintainers; [ abbradar ]; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/lsh/default.nix b/nixpkgs/pkgs/tools/networking/lsh/default.nix new file mode 100644 index 000000000000..b03098d540a3 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/lsh/default.nix @@ -0,0 +1,51 @@ +{ lib, stdenv, fetchurl, gperf, guile, gmp, zlib, liboop, readline, gnum4, pam +, nettools, lsof, procps }: + +stdenv.mkDerivation rec { + name = "lsh-2.0.4"; + src = fetchurl { + url = "mirror://gnu/lsh/${name}.tar.gz"; + sha256 = "614b9d63e13ad3e162c82b6405d1f67713fc622a8bc11337e72949d613713091"; + }; + + patches = [ ./pam-service-name.patch ./lshd-no-root-login.patch ]; + + preConfigure = '' + # Patch `lsh-make-seed' so that it can gather enough entropy. + sed -i "src/lsh-make-seed.c" \ + -e "s|/usr/sbin/arp|${nettools}/sbin/arp|g ; + s|/usr/bin/netstat|${nettools}/bin/netstat|g ; + s|/usr/local/bin/lsof|${lsof}/bin/lsof|g ; + s|/bin/vmstat|${procps}/bin/vmstat|g ; + s|/bin/ps|${procps}/bin/sp|g ; + s|/usr/bin/w|${procps}/bin/w|g ; + s|/usr/bin/df|$(type -P df)|g ; + s|/usr/bin/ipcs|$(type -P ipcs)|g ; + s|/usr/bin/uptime|$(type -P uptime)|g" + + # Skip the `configure' script that checks whether /dev/ptmx & co. work as + # expected, because it relies on impurities (for instance, /dev/pts may + # be unavailable in chroots.) + export lsh_cv_sys_unix98_ptys=yes + ''; + + NIX_CFLAGS_COMPILE = "-std=gnu90"; + + buildInputs = [ gperf guile gmp zlib liboop readline gnum4 pam ]; + + meta = { + description = "GPL'd implementation of the SSH protocol"; + + longDescription = '' + lsh is a free implementation (in the GNU sense) of the ssh + version 2 protocol, currently being standardised by the IETF + SECSH working group. + ''; + + homepage = "http://www.lysator.liu.se/~nisse/lsh/"; + license = lib.licenses.gpl2Plus; + + maintainers = [ ]; + platforms = [ "x86_64-linux" ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/lsh/lshd-no-root-login.patch b/nixpkgs/pkgs/tools/networking/lsh/lshd-no-root-login.patch new file mode 100644 index 000000000000..9dd81de3fbc1 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/lsh/lshd-no-root-login.patch @@ -0,0 +1,16 @@ +Correctly handle the `--no-root-login' option. + +--- lsh-2.0.4/src/lshd.c 2006-05-01 13:47:44.000000000 +0200 ++++ lsh-2.0.4/src/lshd.c 2009-09-08 12:20:36.000000000 +0200 +@@ -758,6 +758,10 @@ main_argp_parser(int key, char *arg, str + self->allow_root = 1; + break; + ++ case OPT_NO_ROOT_LOGIN: ++ self->allow_root = 0; ++ break; ++ + case OPT_KERBEROS_PASSWD: + self->pw_helper = PATH_KERBEROS_HELPER; + break; + diff --git a/nixpkgs/pkgs/tools/networking/lsh/pam-service-name.patch b/nixpkgs/pkgs/tools/networking/lsh/pam-service-name.patch new file mode 100644 index 000000000000..6a6156855c51 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/lsh/pam-service-name.patch @@ -0,0 +1,14 @@ +Tell `lsh-pam-checkpw', the PAM password helper program, to use a more +descriptive service name. + +--- lsh-2.0.4/src/lsh-pam-checkpw.c 2003-02-16 22:30:10.000000000 +0100 ++++ lsh-2.0.4/src/lsh-pam-checkpw.c 2008-11-28 16:16:58.000000000 +0100 +@@ -38,7 +38,7 @@ + #include <security/pam_appl.h> + + #define PWD_MAXLEN 1024 +-#define SERVICE_NAME "other" ++#define SERVICE_NAME "lshd" + #define TIMEOUT 600 + + static int diff --git a/nixpkgs/pkgs/tools/networking/lxi-tools/default.nix b/nixpkgs/pkgs/tools/networking/lxi-tools/default.nix new file mode 100644 index 000000000000..92ef7f688a5a --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/lxi-tools/default.nix @@ -0,0 +1,34 @@ +{ lib, stdenv, fetchFromGitHub +, autoreconfHook, pkg-config +, liblxi, readline, lua +}: + +stdenv.mkDerivation rec { + pname = "lxi-tools"; + version = "1.21"; + + src = fetchFromGitHub { + owner = "lxi-tools"; + repo = "lxi-tools"; + rev = "v${version}"; + sha256 = "0rkp6ywsw2zv7hpbr12kba79wkcwqin7xagxxhd968rbfkfdxlwc"; + }; + + nativeBuildInputs = [ autoreconfHook pkg-config ]; + + buildInputs = [ liblxi readline lua ]; + + meta = with lib; { + description = "Tool for communicating with LXI compatible instruments"; + longDescription = '' + lxi-tools is a collection of open source software tools + that enables control of LXI compatible instruments such + as modern oscilloscopes, power supplies, + spectrum analyzers etc. + ''; + homepage = "https://lxi-tools.github.io/"; + license = licenses.bsd3; + platforms = platforms.linux; + maintainers = [ maintainers.vq ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/lychee/default.nix b/nixpkgs/pkgs/tools/networking/lychee/default.nix new file mode 100644 index 000000000000..72f5b6f57fd2 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/lychee/default.nix @@ -0,0 +1,35 @@ +{ lib +, rustPlatform +, fetchFromGitHub +, pkg-config +, openssl +}: + +rustPlatform.buildRustPackage rec { + pname = "lychee"; + version = "0.7.0"; + + src = fetchFromGitHub { + owner = "lycheeverse"; + repo = pname; + rev = version; + sha256 = "0kpwpbv0dqb0p4bxjlcjas6x1n91rdsvy2psrc1nyr1sh6gb1q5j"; + }; + + cargoSha256 = "1b915zkg41n3azk4hhg6fgc83n7iq8p7drvdyil2m2a4qdjvp9r3"; + + nativeBuildInputs = [ pkg-config ]; + + buildInputs = [ openssl ]; + + # Disabled because they currently fail + doCheck = false; + + meta = with lib; { + description = "A fast, async, resource-friendly link checker written in Rust."; + homepage = "https://github.com/lycheeverse/lychee"; + license = with licenses; [ asl20 mit ]; + maintainers = with maintainers; [ tuxinaut ]; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/maildrop/default.nix b/nixpkgs/pkgs/tools/networking/maildrop/default.nix new file mode 100644 index 000000000000..b258c638df52 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/maildrop/default.nix @@ -0,0 +1,24 @@ +{ fetchurl, lib, stdenv, pkg-config, pcre, perl }: + +stdenv.mkDerivation { + name = "maildrop-2.6.0"; + + src = fetchurl { + url = "mirror://sourceforge/courier/maildrop/2.6.0/maildrop-2.6.0.tar.bz2"; + sha256 = "1a94p2b41iy334cwfwmzi19557dn5j61abh0cp2rfc9dkc8ibhdg"; + }; + + nativeBuildInputs = [ pkg-config ]; + buildInputs = [ pcre perl ]; + + patches = [ ./maildrop.configure.hack.patch ]; # for building in chroot + + doCheck = false; # fails with "setlocale: LC_ALL: cannot change locale (en_US.UTF-8)" + + meta = with lib; { + homepage = "http://www.courier-mta.org/maildrop/"; + description = "Mail filter/mail delivery agent that is used by the Courier Mail Server"; + license = licenses.gpl3; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/maildrop/maildrop.configure.hack.patch b/nixpkgs/pkgs/tools/networking/maildrop/maildrop.configure.hack.patch new file mode 100644 index 000000000000..08988f6cde50 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/maildrop/maildrop.configure.hack.patch @@ -0,0 +1,13 @@ +--- a/maildrop/configure 2012-09-06 01:52:13.000000000 +0100 ++++ b/maildrop/configure 2013-01-04 03:00:57.095628327 +0000 +@@ -17562,8 +17562,8 @@ + check_spooldir() { + if test "$CHECKED_SPOOLDIR" != 1 + then +- get_spooldir +- MBOX_DIR="$SPOOLDIR" ++ MBOX_DIR="/var/spool/mail" ++ MBOX_RESET_GID=0 + CHECKED_SPOOLDIR=1 + fi + } diff --git a/nixpkgs/pkgs/tools/networking/mailsend/default.nix b/nixpkgs/pkgs/tools/networking/mailsend/default.nix new file mode 100644 index 000000000000..9856634116eb --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/mailsend/default.nix @@ -0,0 +1,41 @@ +{lib, stdenv, fetchurl, openssl}: +let + s = # Generated upstream information + rec { + baseName="mailsend"; + version="1.19"; + name="${baseName}-${version}"; + hash="1xwk6jvl5li8ddlik1lj88qswnyminp9wlf5cm8gg3n54szgcpjn"; + url="https://github.com/muquit/mailsend/archive/1.19.tar.gz"; + sha256="1xwk6jvl5li8ddlik1lj88qswnyminp9wlf5cm8gg3n54szgcpjn"; + }; + buildInputs = [ + openssl + ]; +in +stdenv.mkDerivation { + inherit (s) name version; + inherit buildInputs; + src = fetchurl { + inherit (s) url sha256; + }; + configureFlags = [ + "--with-openssl=${openssl.dev}" + ]; + + patches = [ + (fetchurl { + url = "https://github.com/muquit/mailsend/commit/960df6d7a11eef90128dc2ae660866b27f0e4336.patch"; + sha256 = "0vz373zcfl19inflybfjwshcq06rvhx0i5g0f4b021cxfhyb1sm0"; + }) + ]; + meta = { + inherit (s) version; + description = "CLI email sending tool"; + license = lib.licenses.bsd3 ; + maintainers = [lib.maintainers.raskin]; + platforms = lib.platforms.linux; + homepage = "https://github.com/muquit/mailsend"; + downloadPage = "https://github.com/muquit/mailsend/releases"; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/mailsend/default.upstream b/nixpkgs/pkgs/tools/networking/mailsend/default.upstream new file mode 100644 index 000000000000..3d9862a3de21 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/mailsend/default.upstream @@ -0,0 +1,3 @@ +url "https://github.com/muquit/mailsend/releases" +ensure_choice +version '.*/([0-9][0-9.a-z]*)[.]tar[.].*' '\1' diff --git a/nixpkgs/pkgs/tools/networking/mailutils/default.nix b/nixpkgs/pkgs/tools/networking/mailutils/default.nix new file mode 100644 index 000000000000..74d4b61064bd --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/mailutils/default.nix @@ -0,0 +1,120 @@ +{ lib, stdenv, fetchurl, fetchpatch, autoreconfHook, dejagnu, gettext, pkg-config +, gdbm, pam, readline, ncurses, gnutls, guile, texinfo, gnum4, sasl, fribidi, nettools +, python3, gss, libmysqlclient, system-sendmail }: + +stdenv.mkDerivation rec { + pname = "mailutils"; + version = "3.12"; + + src = fetchurl { + url = "mirror://gnu/${pname}/${pname}-${version}.tar.xz"; + sha256 = "0n51ng1f8yf5zfsnh8s0pj9bnw6icb2r0y78gl2kzijaghhzlhvd"; + }; + + postPatch = '' + sed -i -e '/chown root:mail/d' \ + -e 's/chmod [24]755/chmod 0755/' \ + */Makefile{.in,.am} + sed -i 's:/usr/lib/mysql:${libmysqlclient}/lib/mysql:' configure.ac + sed -i 's/0\.18/0.19/' configure.ac + ''; + + nativeBuildInputs = [ + autoreconfHook gettext pkg-config + ]; + + buildInputs = [ + gdbm pam readline ncurses gnutls guile texinfo gnum4 sasl fribidi + gss libmysqlclient python3 + ] ++ lib.optionals stdenv.isLinux [ nettools ]; + + patches = [ + ./fix-build-mb-len-max.patch + ./path-to-cat.patch + # Fix cross-compilation + # https://lists.gnu.org/archive/html/bug-mailutils/2020-11/msg00038.html + (fetchpatch { + url = "https://lists.gnu.org/archive/html/bug-mailutils/2020-11/txtiNjqcNpqOk.txt"; + sha256 = "0ghzqb8qx2q8cffbvqzw19mivv7r5f16whplzhm7hdj0j2i6xf6s"; + }) + ]; + + enableParallelBuilding = false; + hardeningDisable = [ "format" ]; + + configureFlags = [ + "--with-gssapi" + "--with-gsasl" + "--with-mysql" + "--with-path-sendmail=${system-sendmail}/bin/sendmail" + ]; + + readmsg-tests = let + p = "https://raw.githubusercontent.com/gentoo/gentoo/9c921e89d51876fd876f250324893fd90c019326/net-mail/mailutils/files"; + in [ + (fetchurl { url = "${p}/hdr.at"; sha256 = "0phpkqyhs26chn63wjns6ydx9468ng3ssbjbfhcvza8h78jlsd98"; }) + (fetchurl { url = "${p}/nohdr.at"; sha256 = "1vkbkfkbqj6ml62s1am8i286hxwnpsmbhbnq0i2i0j1i7iwkk4b7"; }) + (fetchurl { url = "${p}/twomsg.at"; sha256 = "15m29rg2xxa17xhx6jp4s2vwa9d4khw8092vpygqbwlhw68alk9g"; }) + (fetchurl { url = "${p}/weed.at"; sha256 = "1101xakhc99f5gb9cs3mmydn43ayli7b270pzbvh7f9rbvh0d0nh"; }) + ]; + + checkInputs = [ dejagnu ]; + doCheck = false; # fails 1 out of a bunch of tests, looks like a bug + doInstallCheck = false; # fails + + preCheck = '' + # Add missing test files + cp ${builtins.toString readmsg-tests} readmsg/tests/ + for f in hdr.at nohdr.at twomsg.at weed.at; do + mv readmsg/tests/*-$f readmsg/tests/$f + done + # Disable comsat tests that fail without tty in the sandbox. + tty -s || echo > comsat/tests/testsuite.at + # Disable lmtp tests that require root spool. + echo > maidag/tests/lmtp.at + # Disable mda tests that require /etc/passwd to contain root. + grep -qo '^root:' /etc/passwd || echo > maidag/tests/mda.at + # Provide libraries for mhn. + export LD_LIBRARY_PATH=$(pwd)/lib/.libs + ''; + + postCheck = '' + unset LD_LIBRARY_PATH + ''; + + meta = with lib; { + description = "Rich and powerful protocol-independent mail framework"; + + longDescription = '' + GNU Mailutils is a rich and powerful protocol-independent mail + framework. It contains a series of useful mail libraries, clients, and + servers. These are the primary mail utilities for the GNU system. The + central library is capable of handling electronic mail in various + mailbox formats and protocols, both local and remote. Specifically, + this project contains a POP3 server, an IMAP4 server, and a Sieve mail + filter. It also provides a POSIX `mailx' client, and a collection of + other handy tools. + + The GNU Mailutils libraries supply an ample set of primitives for + handling electronic mail in programs written in C, C++, Python or + Scheme. + + The utilities provided by Mailutils include imap4d and pop3d mail + servers, mail reporting utility comsatd, general-purpose mail delivery + agent maidag, mail filtering program sieve, and an implementation of MH + message handling system. + ''; + + license = with licenses; [ + lgpl3Plus /* libraries */ + gpl3Plus /* tools */ + ]; + + maintainers = with maintainers; [ orivej vrthra ]; + + homepage = "https://www.gnu.org/software/mailutils/"; + + # Some of the dependencies fail to build on {cyg,dar}win. + platforms = platforms.gnu ++ platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/mailutils/fix-build-mb-len-max.patch b/nixpkgs/pkgs/tools/networking/mailutils/fix-build-mb-len-max.patch new file mode 100644 index 000000000000..b28dfc5d99ca --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/mailutils/fix-build-mb-len-max.patch @@ -0,0 +1,14 @@ +diff --git a/frm/frm.h b/frm/frm.h +index 178b87d54..7931faada 100644 +--- a/frm/frm.h ++++ b/frm/frm.h +@@ -34,6 +34,9 @@ + #ifdef HAVE_ICONV_H + # include <iconv.h> + #endif ++#ifdef HAVE_LIMITS_H ++# include <limits.h> ++#endif + #ifndef MB_LEN_MAX + # define MB_LEN_MAX 4 + #endif diff --git a/nixpkgs/pkgs/tools/networking/mailutils/path-to-cat.patch b/nixpkgs/pkgs/tools/networking/mailutils/path-to-cat.patch new file mode 100644 index 000000000000..698ee08f340f --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/mailutils/path-to-cat.patch @@ -0,0 +1,52 @@ +diff --git a/mh/show.c b/mh/show.c +index a43afe10c..6985386ec 100644 +--- a/mh/show.c ++++ b/mh/show.c +@@ -254,7 +254,7 @@ main (int argc, char **argv) + */ + + if (!use_showproc) +- showproc = "/bin/cat"; ++ showproc = "cat"; + else + showproc = mh_global_profile_get ("showproc", NULL); + +diff --git a/mh/tests/mhparam.at b/mh/tests/mhparam.at +index 54b7fc06a..3abd5bf9b 100644 +--- a/mh/tests/mhparam.at ++++ b/mh/tests/mhparam.at +@@ -28,7 +28,7 @@ mhparam -all | tr '\t' ' ' | sed 's/^Path:.*/Path: Mail/;s/^mhetcdir:.*/mhetcdir + [0], + [Path: Mail + mhetcdir: dir +-moreproc: /bin/cat ++moreproc: cat + Sequence-Negation: not + Draft-Folder: Mail/drafts + Aliasfile: .mh_aliases +diff --git a/mh/tests/testsuite.at b/mh/tests/testsuite.at +index c6820843c..6675a4a9c 100644 +--- a/mh/tests/testsuite.at ++++ b/mh/tests/testsuite.at +@@ -25,7 +25,7 @@ export MH + cat > $MH <<EOT + Path: $HOME/Mail + mhetcdir: $abs_top_srcdir/mh/etc +-moreproc: /bin/cat ++moreproc: cat + EOT + MTSTAILOR=$HOME/mtstailor + export MTSTAILOR +diff --git a/testsuite/lib/mailutils.exp b/testsuite/lib/mailutils.exp +index d4691d922..c1b056933 100644 +--- a/testsuite/lib/mailutils.exp ++++ b/testsuite/lib/mailutils.exp +@@ -728,7 +728,7 @@ proc mu_test_file {args} { + set pattern [lrange $args 1 end] + } + +- set res [remote_spawn host "/bin/cat $filename"] ++ set res [remote_spawn host "cat $filename"] + if { $res < 0 || $res == "" } { + perror "Reading $filename failed." + return 1; diff --git a/nixpkgs/pkgs/tools/networking/maphosts/Gemfile b/nixpkgs/pkgs/tools/networking/maphosts/Gemfile new file mode 100644 index 000000000000..cf3ea24c436f --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/maphosts/Gemfile @@ -0,0 +1,2 @@ +source 'https://rubygems.org' +gem 'maphosts' diff --git a/nixpkgs/pkgs/tools/networking/maphosts/Gemfile.lock b/nixpkgs/pkgs/tools/networking/maphosts/Gemfile.lock new file mode 100644 index 000000000000..3e2332f75ccf --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/maphosts/Gemfile.lock @@ -0,0 +1,19 @@ +GEM + remote: https://rubygems.org/ + specs: + colorize (0.8.0) + hosts (0.1.1) + linebreak (~> 2.0.1) + linebreak (2.0.1) + maphosts (1.1.1) + colorize (~> 0.7) + hosts (~> 0.1) + +PLATFORMS + ruby + +DEPENDENCIES + maphosts + +BUNDLED WITH + 2.1.4 diff --git a/nixpkgs/pkgs/tools/networking/maphosts/default.nix b/nixpkgs/pkgs/tools/networking/maphosts/default.nix new file mode 100644 index 000000000000..8e3d0cf9160c --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/maphosts/default.nix @@ -0,0 +1,28 @@ +{ stdenv, lib, bundlerEnv, ruby, bundlerUpdateScript }: + +let + env = bundlerEnv { + name = "maphosts-gems"; + inherit ruby; + gemdir = ./.; + }; +in stdenv.mkDerivation { + name = "maphosts-${env.gems.maphosts.version}"; + + phases = ["installPhase"]; + + installPhase = '' + mkdir -p "$out/bin" + ln -s "${env}/bin/maphosts" "$out/bin/maphosts" + ''; + + passthru.updateScript = bundlerUpdateScript "maphosts"; + + meta = with lib; { + description = "Small command line application for keeping your project hostnames in sync with /etc/hosts"; + homepage = "https://github.com/mpscholten/maphosts"; + license = licenses.mit; + maintainers = with maintainers; [ mpscholten nicknovitski ]; + platforms = platforms.all; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/maphosts/gemset.nix b/nixpkgs/pkgs/tools/networking/maphosts/gemset.nix new file mode 100644 index 000000000000..b50653bc96d6 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/maphosts/gemset.nix @@ -0,0 +1,34 @@ +{ + colorize = { + source = { + remotes = ["https://rubygems.org"]; + sha256 = "1mmi9wr55gb84jfpyhpx975d2c8dhdsjjys88kc6f2r66brxmh23"; + type = "gem"; + }; + version = "0.8.0"; + }; + hosts = { + source = { + remotes = ["https://rubygems.org"]; + sha256 = "0s1mbn73ig5dy69dr8461574kq1ig6rdz89r1w5f8i7gvx9g9z9v"; + type = "gem"; + }; + version = "0.1.1"; + }; + linebreak = { + source = { + remotes = ["https://rubygems.org"]; + sha256 = "0362jhjhjcf0yr3k7bfqk4ai9yybm4985x7h1rwq4b7kvzk77pqj"; + type = "gem"; + }; + version = "2.0.1"; + }; + maphosts = { + source = { + remotes = ["https://rubygems.org"]; + sha256 = "0bb7wa4vr3lkaywh4hvl74j2w5n52870zh4ypwl9cr43fdrj4nkw"; + type = "gem"; + }; + version = "1.1.1"; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/maxscale/default.nix b/nixpkgs/pkgs/tools/networking/maxscale/default.nix new file mode 100644 index 000000000000..bef421a7ab4c --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/maxscale/default.nix @@ -0,0 +1,88 @@ +{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, glibc +, bison, curl, flex, gperftools, jansson, jemalloc, libkrb5, lua, libmysqlclient +, ncurses, openssl, pcre, pcre2, perl, rabbitmq-c, sqlite, tcl +, libaio, libedit, libtool, libui, libuuid, zlib +}: + +stdenv.mkDerivation rec { + pname = "maxscale"; + version = "2.1.17"; + + src = fetchFromGitHub { + owner = "mariadb-corporation"; + repo = "MaxScale"; + rev = "${pname}-${version}"; + sha256 = "161kc6aqqj3z509q4qwvsd86h06hlyzdask4gawn2ij0h3ca58q6"; + }; + + nativeBuildInputs = [ cmake pkg-config ]; + + buildInputs = [ + bison curl flex gperftools jansson jemalloc libkrb5 lua libmysqlclient + ncurses openssl pcre pcre2 perl rabbitmq-c sqlite tcl + libaio libedit libtool libui libuuid zlib + ]; + + patches = [ ./getopt.patch ]; + + preConfigure = '' + for i in `grep -l -R '#include <getopt.h>' .`; do + substituteInPlace $i --replace "#include <getopt.h>" "#include <${glibc.dev}/include/getopt.h>" + done + ''; + + cmakeFlags = [ + "-DUSE_C99=YES" + "-DDEFAULT_ADMIN_USER=root" + "-DWITH_MAXSCALE_CNF=YES" + "-DSTATIC_EMBEDDED=YES" + "-DBUILD_RABBITMQ=YES" + "-DBUILD_BINLOG=YES" + "-DBUILD_CDC=NO" + "-DBUILD_MMMON=YES" + "-DBUILD_LUAFILTER=YES" + "-DLUA_LIBRARIES=${lua}/lib" + "-DLUA_INCLUDE_DIR=${lua}/include" + "-DGCOV=NO" + "-DWITH_SCRIPTS=OFF" + "-DBUILD_TESTS=NO" + "-DBUILD_TOOLS=NO" + "-DPROFILE=NO" + "-DWITH_TCMALLOC=YES" + "-DWITH_JEMALLOC=YES" + "-DINSTALL_EXPERIMENTAL=YES" + "-DTARGET_COMPONENT=all" + ]; + + CFLAGS = "-std=gnu99"; + + enableParallelBuilding = false; + + dontStrip = true; + + postInstall = '' + find $out/bin -type f -perm -0100 | while read f1; do + patchelf \ + --set-rpath "$(patchelf --print-rpath $f1):${libmysqlclient}/lib/mariadb:$out/lib/maxscale" \ + --set-interpreter "$(cat ${stdenv.cc}/nix-support/dynamic-linker)" $f1 \ + && patchelf --shrink-rpath $f1 + done + + find $out/lib/maxscale -type f -perm -0100 | while read f2; do + patchelf \ + --set-rpath "$(patchelf --print-rpath $f2)":$out/lib/maxscale $f2 + done + + mv $out/share/maxscale/create_grants $out/bin + rm -rf $out/{etc,var} + ''; + + meta = with lib; { + description = "MaxScale database proxy extends MariaDB Server's high availability"; + homepage = "https://mariadb.com/products/technology/maxscale"; + license = licenses.bsl11; + platforms = platforms.linux; + maintainers = with maintainers; [ izorkin ]; + broken = true; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/maxscale/getopt.patch b/nixpkgs/pkgs/tools/networking/maxscale/getopt.patch new file mode 100644 index 000000000000..db09a8e8f1ec --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/maxscale/getopt.patch @@ -0,0 +1,11 @@ +--- a/server/core/maxpasswd.c 2018-01-12 05:06:49.000000000 -0500 ++++ b/server/core/maxpasswd.c 2018-01-12 06:50:18.518000000 -0500 +@@ -25,6 +25,7 @@ + + #include <maxscale/cdefs.h> + ++#include <getopt.h> + #include <stdio.h> + #include <errno.h> + #include <sys/stat.h> + diff --git a/nixpkgs/pkgs/tools/networking/mcrcon/default.nix b/nixpkgs/pkgs/tools/networking/mcrcon/default.nix new file mode 100644 index 000000000000..ed2596bc88ba --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/mcrcon/default.nix @@ -0,0 +1,33 @@ +{ lib, stdenv, fetchFromGitHub }: + +stdenv.mkDerivation rec { + pname = "mcrcon"; + version = "0.7.1"; + + src = fetchFromGitHub { + owner = "Tiiffi"; + repo = "mcrcon"; + rev = "v${version}"; + sha256 = "004h1glagyw1mic1k461bky0w2fxdfhrhcqjzr9wp6gvyy9s8bix"; + }; + + buildPhase = '' + $CC mcrcon.c -o mcrcon + ''; + + installPhase = '' + install -Dm 755 mcrcon $out/bin/mcrcon + ''; + + meta = { + homepage = "https://bukkit.org/threads/admin-rcon-mcrcon-remote-connection-client-for-minecraft-servers.70910/"; + description = "Minecraft console client with Bukkit coloring support"; + longDescription = '' + Mcrcon is a powerful Minecraft RCON terminal client with Bukkit coloring support. + It is well suited for remote administration and to be used as part of automated server maintenance scripts. + It does not trigger "IO: Broken pipe" or "IO: Connection reset" spam bugs on the server side. + ''; + maintainers = with lib.maintainers; [ dermetfan ]; + license = with lib.licenses; [ zlib libpng ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/mdk4/default.nix b/nixpkgs/pkgs/tools/networking/mdk4/default.nix new file mode 100644 index 000000000000..903504633ac8 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/mdk4/default.nix @@ -0,0 +1,33 @@ +{ lib, stdenv, fetchFromGitHub, libnl, libpcap, pkg-config }: + +stdenv.mkDerivation { + pname = "mdk4"; + version = "unstable-2021-04-27"; + + src = fetchFromGitHub { + owner = "aircrack-ng"; + repo = "mdk4"; + rev = "e94422ce8e4b8dcd132d658345814df7e63bfa41"; + sha256 = "sha256-pZS7HQBKlSZJGqoZlSyBUzXC3osswcB56cBzgm+Sbwg="; + }; + + preBuild = '' + mkdir -p $out/bin + mkdir -p $out/share/man + + substituteInPlace src/Makefile --replace '/usr/local/src/mdk4' '$out' + ''; + + nativeBuildInputs = [ pkg-config ]; + + buildInputs = [ libnl libpcap ]; + + makeFlags = [ "PREFIX=$(out)" "SBINDIR=$(PREFIX)/bin" ]; + + meta = with lib; { + description = "A tool that injects data into wireless networks"; + homepage = "https://github.com/aircrack-ng/mdk4"; + maintainers = with maintainers; [ fortuneteller2k ]; + license = licenses.gpl2Plus; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/megatools/default.nix b/nixpkgs/pkgs/tools/networking/megatools/default.nix new file mode 100644 index 000000000000..ac37e93c7360 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/megatools/default.nix @@ -0,0 +1,30 @@ +{ lib, stdenv, fetchgit, autoreconfHook, pkg-config, glib, fuse, curl, glib-networking +, asciidoc, libxml2, docbook_xsl, docbook_xml_dtd_45, libxslt, wrapGAppsNoGuiHook }: + +stdenv.mkDerivation rec { + pname = "megatools"; + version = "1.10.3"; + + src = fetchgit { + url = "https://megous.com/git/megatools"; + rev = "5581d06e447b84d0101d36dc96ab72920eec1017"; + sha256 = "1fh456kjsmdvpmvklkpi06h720yvhahd4rxa6cm5x818pl44p1r4"; + }; + + nativeBuildInputs = [ + autoreconfHook pkg-config wrapGAppsNoGuiHook asciidoc libxml2 + docbook_xsl docbook_xml_dtd_45 libxslt + ]; + buildInputs = [ glib glib-networking curl ] + ++ lib.optionals stdenv.isLinux [ fuse ]; + + enableParallelBuilding = true; + + meta = with lib; { + description = "Command line client for Mega.co.nz"; + homepage = "https://megatools.megous.com/"; + license = licenses.gpl2Plus; + maintainers = with maintainers; [ viric AndersonTorres zowoq ]; + platforms = platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/memtier-benchmark/default.nix b/nixpkgs/pkgs/tools/networking/memtier-benchmark/default.nix new file mode 100644 index 000000000000..0fe128ad13cb --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/memtier-benchmark/default.nix @@ -0,0 +1,31 @@ +{ lib, stdenv, fetchFromGitHub, autoreconfHook +, pkg-config, libevent, pcre, zlib, openssl +}: + +stdenv.mkDerivation rec { + pname = "memtier-benchmark"; + version = "1.3.0"; + + src = fetchFromGitHub { + owner = "redislabs"; + repo = "memtier_benchmark"; + rev = "refs/tags/${version}"; + sha256 = "0m2qnnc71qpdj8w421bxn0zxz6ddvzy7b0n19jvyncnzvk1ff0sq"; + }; + + patchPhase = '' + substituteInPlace ./configure.ac \ + --replace '1.2.8' '${version}' + ''; + + nativeBuildInputs = [ autoreconfHook pkg-config ]; + buildInputs = [ libevent pcre zlib openssl ]; + + meta = { + description = "Redis and Memcached traffic generation and benchmarking tool"; + homepage = "https://github.com/redislabs/memtier_benchmark"; + license = lib.licenses.gpl2; + platforms = lib.platforms.linux; + maintainers = with lib.maintainers; [ thoughtpolice ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/minidlna/default.nix b/nixpkgs/pkgs/tools/networking/minidlna/default.nix new file mode 100644 index 000000000000..c14b8c68479b --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/minidlna/default.nix @@ -0,0 +1,36 @@ +{ lib, stdenv, fetchurl, ffmpeg, flac, libvorbis, libogg, libid3tag, libexif, libjpeg, sqlite, gettext }: + +let version = "1.3.0"; in + +stdenv.mkDerivation { + pname = "minidlna"; + inherit version; + + src = fetchurl { + url = "mirror://sourceforge/project/minidlna/minidlna/${version}/minidlna-${version}.tar.gz"; + sha256 = "0qrw5ny82p5ybccw4pp9jma8nwl28z927v0j2561m0289imv1na7"; + }; + + preConfigure = '' + export makeFlags="INSTALLPREFIX=$out" + ''; + + buildInputs = [ ffmpeg flac libvorbis libogg libid3tag libexif libjpeg sqlite gettext ]; + + postInstall = '' + mkdir -p $out/share/man/man{5,8} + cp minidlna.conf.5 $out/share/man/man5 + cp minidlnad.8 $out/share/man/man8 + ''; + + meta = with lib; { + description = "Media server software"; + longDescription = '' + MiniDLNA (aka ReadyDLNA) is server software with the aim of being fully + compliant with DLNA/UPnP-AV clients. + ''; + homepage = "https://sourceforge.net/projects/minidlna/"; + license = licenses.gpl2; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/minio-client/default.nix b/nixpkgs/pkgs/tools/networking/minio-client/default.nix new file mode 100644 index 000000000000..70b663edded5 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/minio-client/default.nix @@ -0,0 +1,33 @@ +{ lib, buildGoModule, fetchFromGitHub }: + +buildGoModule rec { + pname = "minio-client"; + version = "2021-03-23T05-46-11Z"; + + src = fetchFromGitHub { + owner = "minio"; + repo = "mc"; + rev = "RELEASE.${version}"; + sha256 = "sha256-AtE9Zy8tRvcE+gYc0pqJDEFnXL4jSbJ4b6l3ZOe69Y4="; + }; + + vendorSha256 = "sha256-cIr8d5jz4EfBFuOBZG4Kz20wSXy1Cni77V+JR6vLHwQ="; + + doCheck = false; + + subPackages = [ "." ]; + + patchPhase = '' + sed -i "s/Version.*/Version = \"${version}\"/g" cmd/build-constants.go + sed -i "s/ReleaseTag.*/ReleaseTag = \"RELEASE.${version}\"/g" cmd/build-constants.go + sed -i "s/CommitID.*/CommitID = \"${src.rev}\"/g" cmd/build-constants.go + ''; + + meta = with lib; { + homepage = "https://github.com/minio/mc"; + description = "A replacement for ls, cp, mkdir, diff and rsync commands for filesystems and object storage"; + maintainers = with maintainers; [ eelco bachp ]; + platforms = platforms.unix; + license = licenses.asl20; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/minissdpd/default.nix b/nixpkgs/pkgs/tools/networking/minissdpd/default.nix new file mode 100644 index 000000000000..869abe92e5c2 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/minissdpd/default.nix @@ -0,0 +1,35 @@ +{ lib, stdenv, fetchurl, libnfnetlink }: + +stdenv.mkDerivation rec { + pname = "minissdpd"; + version = "1.5.20180223"; + + src = fetchurl { + sha256 = "1c47h1zil04jnbxiaaci2rm8jij47zp5156v48hb6m87nh4l5adv"; + url = "http://miniupnp.free.fr/files/download.php?file=${pname}-${version}.tar.gz"; + name = "${pname}-${version}.tar.gz"; + }; + + buildInputs = [ libnfnetlink ]; + + installFlags = [ "PREFIX=$(out)" "INSTALLPREFIX=$(out)" ]; + + enableParallelBuilding = true; + + doCheck = true; + + meta = with lib; { + description = "Small daemon to speed up UPnP device discoveries"; + longDescription = '' + MiniSSDPd receives NOTIFY packets and stores (caches) that information + for later use by UPnP Control Points on the machine. MiniSSDPd receives + M-SEARCH packets and answers on behalf of the UPnP devices running on + the machine. Software must be patched in order to take advantage of + MiniSSDPd, and MiniSSDPd must be started before any other UPnP program. + ''; + homepage = "http://miniupnp.free.fr/minissdpd.html"; + downloadPage = "http://miniupnp.free.fr/files/"; + license = licenses.bsd3; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/miniupnpc/default.nix b/nixpkgs/pkgs/tools/networking/miniupnpc/default.nix new file mode 100644 index 000000000000..9fe476906bc6 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/miniupnpc/default.nix @@ -0,0 +1,38 @@ +{ lib, stdenv, fetchurl, which, cctools }: + +let + generic = { version, sha256 }: + stdenv.mkDerivation rec { + pname = "miniupnpc"; + inherit version; + src = fetchurl { + name = "${pname}-${version}.tar.gz"; + url = "http://miniupnp.free.fr/files/download.php?file=${pname}-${version}.tar.gz"; + inherit sha256; + }; + + nativeBuildInputs = lib.optionals stdenv.isDarwin [ which cctools ]; + + patches = lib.optional stdenv.isFreeBSD ./freebsd.patch; + + doCheck = !stdenv.isFreeBSD; + + makeFlags = [ "PREFIX=$(out)" "INSTALLPREFIX=$(out)" ]; + + meta = with lib; { + homepage = "http://miniupnp.free.fr/"; + description = "A client that implements the UPnP Internet Gateway Device (IGD) specification"; + platforms = with platforms; linux ++ freebsd ++ darwin; + license = licenses.bsd3; + }; + }; +in { + miniupnpc_2 = generic { + version = "2.1.20190625"; + sha256 = "1yqp0d8x5ldjfma5x2vhpg1aaafdg0470ismccixww3rzpbza8w7"; + }; + miniupnpc_1 = generic { + version = "1.9.20160209"; + sha256 = "0vsbv6a8by67alx4rxfsrxxsnmq74rqlavvvwiy56whxrkm728ap"; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/miniupnpc/freebsd.patch b/nixpkgs/pkgs/tools/networking/miniupnpc/freebsd.patch new file mode 100644 index 000000000000..42ae85a8e6b1 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/miniupnpc/freebsd.patch @@ -0,0 +1,11 @@ +diff --git a/minihttptestserver.c b/minihttptestserver.c +index bbfdac3..a43999d 100644 +--- a/minihttptestserver.c ++++ b/minihttptestserver.c +@@ -1,3 +1,6 @@ ++#ifndef INADDR_LOOPBACK ++#define INADDR_LOOPBACK 0x7f000001 ++#endif + /* $Id: minihttptestserver.c,v 1.17 2015/02/06 10:31:19 nanard Exp $ */ + /* Project : miniUPnP + * Author : Thomas Bernard diff --git a/nixpkgs/pkgs/tools/networking/miniupnpd/default.nix b/nixpkgs/pkgs/tools/networking/miniupnpd/default.nix new file mode 100644 index 000000000000..aea0faddf5d7 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/miniupnpd/default.nix @@ -0,0 +1,44 @@ +{ stdenv, lib, fetchurl, iptables, libuuid, pkg-config +, which, iproute2, gnused, coreutils, gawk, makeWrapper +, nixosTests +}: + +let + scriptBinEnv = lib.makeBinPath [ which iproute2 iptables gnused coreutils gawk ]; +in +stdenv.mkDerivation rec { + name = "miniupnpd-2.1.20190502"; + + src = fetchurl { + url = "http://miniupnp.free.fr/files/download.php?file=${name}.tar.gz"; + sha256 = "1m8d0g9b0bjwsnqccw1yapp6n0jghmgzwixwjflwmvi2fi6hdp4b"; + name = "${name}.tar.gz"; + }; + + buildInputs = [ iptables libuuid ]; + nativeBuildInputs= [ pkg-config makeWrapper ]; + + makefile = "Makefile.linux"; + + buildFlags = [ "miniupnpd" "genuuid" ]; + + installFlags = [ "PREFIX=$(out)" "INSTALLPREFIX=$(out)" ]; + + postFixup = '' + for script in $out/etc/miniupnpd/ip{,6}tables_{init,removeall}.sh + do + wrapProgram $script --set PATH '${scriptBinEnv}:$PATH' + done + ''; + + passthru.tests = { + bittorrent-integration = nixosTests.bittorrent; + }; + + meta = with lib; { + homepage = "http://miniupnp.free.fr/"; + description = "A daemon that implements the UPnP Internet Gateway Device (IGD) specification"; + platforms = platforms.linux; + license = licenses.bsd3; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/miredo/default.nix b/nixpkgs/pkgs/tools/networking/miredo/default.nix new file mode 100644 index 000000000000..94565db2076f --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/miredo/default.nix @@ -0,0 +1,34 @@ +{ lib, stdenv, fetchurl, nettools, iproute2, judy }: + +stdenv.mkDerivation rec { + version = "1.2.6"; + pname = "miredo"; + + buildInputs = [ judy ]; + + src = fetchurl { + url = "https://www.remlab.net/files/miredo/miredo-${version}.tar.xz"; + sha256 = "0j9ilig570snbmj48230hf7ms8kvcwi2wblycqrmhh85lksd49ps"; + }; + + postPatch = '' + substituteInPlace misc/client-hook.bsd \ + --replace '/sbin/route' '${nettools}/bin/route' \ + --replace '/sbin/ifconfig' '${nettools}/bin/ifconfig' + substituteInPlace misc/client-hook.iproute --replace '/sbin/ip' '${iproute2}/bin/ip' + ''; + + configureFlags = [ "--with-Judy" ]; + + postInstall = '' + rm -rf $out/lib/systemd $out/var $out/etc/miredo/miredo.conf + ''; + + meta = with lib; { + description = "Teredo IPv6 Tunneling Daemon"; + homepage = "https://www.remlab.net/miredo/"; + license = licenses.gpl2; + maintainers = [ maintainers.volth ]; + platforms = platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/mmsd/default.nix b/nixpkgs/pkgs/tools/networking/mmsd/default.nix new file mode 100644 index 000000000000..f102995a3cc5 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/mmsd/default.nix @@ -0,0 +1,38 @@ +{ lib, stdenv +, fetchgit +, autoreconfHook +, pkg-config +, glib +, dbus +}: + +stdenv.mkDerivation rec { + pname = "mmsd"; + version = "unstable-2019-07-15"; + + src = fetchgit { + url = "git://git.kernel.org/pub/scm/network/ofono/mmsd.git"; + rev = "f4b8b32477a411180be1823fdc460b4f7e1e3c9c"; + sha256 = "0hcnpyhsi7b5m825dhnwbp65yi0961wi8mipzdvaw5nc693xv15b"; + }; + + nativeBuildInputs = [ + autoreconfHook + pkg-config + ]; + + buildInputs = [ + glib + dbus + ]; + + doCheck = true; + + meta = with lib; { + description = "Multimedia Messaging Service Daemon"; + homepage = "https://01.org/ofono"; + license = licenses.gpl2; + maintainers = with maintainers; [ jtojnar ]; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/modem-manager/default.nix b/nixpkgs/pkgs/tools/networking/modem-manager/default.nix new file mode 100644 index 000000000000..71ea50ea1726 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/modem-manager/default.nix @@ -0,0 +1,44 @@ +{ lib, stdenv, fetchurl, glib, udev, libgudev, polkit, ppp, gettext, pkg-config +, libmbim, libqmi, systemd, vala, gobject-introspection, dbus }: + +stdenv.mkDerivation rec { + pname = "modem-manager"; + version = "1.14.12"; + + package = "ModemManager"; + src = fetchurl { + url = "https://www.freedesktop.org/software/${package}/${package}-${version}.tar.xz"; + sha256 = "sha256-0QqXEZndwl3N8VbFasCOkWEsCVOdVlIueu1G1G5IO7E="; + }; + + nativeBuildInputs = [ vala gobject-introspection gettext pkg-config ]; + + buildInputs = [ glib udev libgudev polkit ppp libmbim libqmi systemd ]; + + configureFlags = [ + "--with-polkit" + "--with-udev-base-dir=${placeholder "out"}/lib/udev" + "--with-dbus-sys-dir=${placeholder "out"}/share/dbus-1/system.d" + "--with-systemdsystemunitdir=${placeholder "out"}/etc/systemd/system" + "--sysconfdir=/etc" + "--localstatedir=/var" + "--with-systemd-suspend-resume" + "--with-systemd-journal" + ]; + + preCheck = '' + export G_TEST_DBUS_DAEMON="${dbus.daemon}/bin/dbus-daemon" + ''; + + enableParallelBuilding = true; + + doCheck = true; + + meta = with lib; { + description = "WWAN modem manager, part of NetworkManager"; + homepage = "https://www.freedesktop.org/wiki/Software/ModemManager/"; + license = licenses.gpl2Plus; + maintainers = [ ]; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/moodle-dl/default.nix b/nixpkgs/pkgs/tools/networking/moodle-dl/default.nix new file mode 100644 index 000000000000..95140467f7a2 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/moodle-dl/default.nix @@ -0,0 +1,34 @@ +{ lib, python3Packages }: + +python3Packages.buildPythonApplication rec { + pname = "moodle-dl"; + version = "2.1.2.5"; + + src = python3Packages.fetchPypi { + inherit pname version; + sha256 = "1gc4037dwyi48h4vi0bam23rr7pfyn6jrz334radz0r6rk94y8lz"; + }; + + # nixpkgs (and the GitHub upstream for readchar) are missing 2.0.1 + postPatch = '' + substituteInPlace setup.py --replace 'readchar>=2.0.1' 'readchar>=2.0.0' + ''; + + propagatedBuildInputs = with python3Packages; [ + sentry-sdk + colorama + readchar + youtube-dl + certifi + html2text + requests + slixmpp + ]; + + meta = with lib; { + homepage = "https://github.com/C0D3D3V/Moodle-Downloader-2"; + maintainers = [ maintainers.kmein ]; + description = "A Moodle downloader that downloads course content fast from Moodle"; + license = licenses.gpl3Plus; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/mosh/bash_completion_datadir.patch b/nixpkgs/pkgs/tools/networking/mosh/bash_completion_datadir.patch new file mode 100644 index 000000000000..4b71f125d287 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/mosh/bash_completion_datadir.patch @@ -0,0 +1,19 @@ +diff --git a/configure.ac b/configure.ac +index 3ad983d..ff8ff96 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -476,13 +476,7 @@ AS_IF([echo "$protobuf_LIBS" | grep -q -- -pthread], + + # Bash completion needs to ask where it goes if >= 2.0 is installed. + AS_IF([test "$install_completion" != no], +- [PKG_CHECK_MODULES([BASH_COMPLETION], [bash-completion >= 2.0], +- [if test "$prefix" = "NONE"; then +- completions="`pkg-config --variable=completionsdir bash-completion`" +- else +- completions="`pkg-config --define-variable=prefix=$prefix --variable=completionsdir bash-completion`" +- fi], +- [completions="${sysconfdir}/bash_completion.d"]) ++ [completions="`pkg-config --define-variable=datadir=$datadir --variable=completionsdir bash-completion`"] + AC_SUBST([completions])]) + + AC_CONFIG_FILES([ diff --git a/nixpkgs/pkgs/tools/networking/mosh/default.nix b/nixpkgs/pkgs/tools/networking/mosh/default.nix new file mode 100644 index 000000000000..92c241967ae0 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/mosh/default.nix @@ -0,0 +1,63 @@ +{ lib, stdenv, fetchurl, fetchpatch, zlib, protobuf, ncurses, pkg-config +, makeWrapper, perlPackages, openssl, autoreconfHook, openssh, bash-completion +, withUtempter ? stdenv.isLinux, libutempter }: + +stdenv.mkDerivation rec { + pname = "mosh"; + version = "1.3.2"; + + src = fetchurl { + url = "https://mosh.org/mosh-${version}.tar.gz"; + sha256 = "05hjhlp6lk8yjcy59zywpf0r6s0h0b9zxq0lw66dh9x8vxrhaq6s"; + }; + + nativeBuildInputs = [ autoreconfHook pkg-config makeWrapper ]; + buildInputs = [ protobuf ncurses zlib openssl bash-completion ] + ++ (with perlPackages; [ perl IOTty ]) + ++ lib.optional withUtempter libutempter; + + enableParallelBuilding = true; + + patches = [ + ./ssh_path.patch + ./mosh-client_path.patch + ./utempter_path.patch + # Fix w/c++17, ::bind vs std::bind + (fetchpatch { + url = "https://github.com/mobile-shell/mosh/commit/e5f8a826ef9ff5da4cfce3bb8151f9526ec19db0.patch"; + sha256 = "15518rb0r5w1zn4s6981bf1sz6ins6gpn2saizfzhmr13hw4gmhm"; + }) + # Fix build with bash-completion 2.10 + ./bash_completion_datadir.patch + ]; + postPatch = '' + substituteInPlace scripts/mosh.pl \ + --subst-var-by ssh "${openssh}/bin/ssh" + substituteInPlace scripts/mosh.pl \ + --subst-var-by mosh-client "$out/bin/mosh-client" + ''; + + configureFlags = [ "--enable-completion" ] ++ lib.optional withUtempter "--with-utempter"; + + postInstall = '' + wrapProgram $out/bin/mosh --prefix PERL5LIB : $PERL5LIB + ''; + + CXXFLAGS = lib.optionalString stdenv.cc.isClang "-std=c++11"; + + meta = with lib; { + homepage = "https://mosh.org/"; + description = "Mobile shell (ssh replacement)"; + longDescription = '' + Remote terminal application that allows roaming, supports intermittent + connectivity, and provides intelligent local echo and line editing of + user keystrokes. + + Mosh is a replacement for SSH. It's more robust and responsive, + especially over Wi-Fi, cellular, and long-distance links. + ''; + license = licenses.gpl3Plus; + maintainers = with maintainers; [ viric ]; + platforms = platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/mosh/mosh-client_path.patch b/nixpkgs/pkgs/tools/networking/mosh/mosh-client_path.patch new file mode 100644 index 000000000000..327fb7af9260 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/mosh/mosh-client_path.patch @@ -0,0 +1,22 @@ +diff --git a/scripts/mosh.pl b/scripts/mosh.pl +index 56e96d7..2a2177e 100755 +--- a/scripts/mosh.pl ++++ b/scripts/mosh.pl +@@ -61,7 +61,7 @@ my $have_ipv6 = eval { + + $|=1; + +-my $client = 'mosh-client'; ++my $client = '@mosh-client@'; + my $server = 'mosh-server'; + + my $predict = undef; +@@ -91,7 +91,7 @@ my @cmdline = @ARGV; + my $usage = + qq{Usage: $0 [options] [--] [user@]host [command...] + --client=PATH mosh client on local machine +- (default: "mosh-client") ++ (default: "@mosh-client@") + --server=COMMAND mosh server on remote machine + (default: "mosh-server") + diff --git a/nixpkgs/pkgs/tools/networking/mosh/ssh_path.patch b/nixpkgs/pkgs/tools/networking/mosh/ssh_path.patch new file mode 100644 index 000000000000..cb2a650718ab --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/mosh/ssh_path.patch @@ -0,0 +1,13 @@ +diff --git i/scripts/mosh.pl w/scripts/mosh.pl +index c511482..55bf5f3 100755 +--- i/scripts/mosh.pl ++++ w/scripts/mosh.pl +@@ -66,7 +66,7 @@ my $use_remote_ip = 'proxy'; + my $family = 'prefer-inet'; + my $port_request = undef; + +-my @ssh = ('ssh'); ++my @ssh = ('@ssh@'); + + my $term_init = 1; + diff --git a/nixpkgs/pkgs/tools/networking/mosh/utempter_path.patch b/nixpkgs/pkgs/tools/networking/mosh/utempter_path.patch new file mode 100644 index 000000000000..a981708ffadf --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/mosh/utempter_path.patch @@ -0,0 +1,14 @@ +diff -ur mosh-1.3.2/src/frontend/mosh-server.cc mosh-1.3.2.patched/src/frontend/mosh-server.cc +--- mosh-1.3.2/src/frontend/mosh-server.cc 2017-07-22 23:14:53.000000000 +0200 ++++ mosh-1.3.2.patched/src/frontend/mosh-server.cc 2018-06-06 10:45:50.725352804 +0200 +@@ -351,6 +351,10 @@ + } + } + ++#ifdef HAVE_UTEMPTER ++ utempter_set_helper( "utempter" ); ++#endif ++ + try { + return run_server( desired_ip, desired_port, command_path, command_argv, colors, verbose, with_motd ); + } catch ( const Network::NetworkException &e ) { diff --git a/nixpkgs/pkgs/tools/networking/mozwire/default.nix b/nixpkgs/pkgs/tools/networking/mozwire/default.nix new file mode 100644 index 000000000000..afccd8376d8f --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/mozwire/default.nix @@ -0,0 +1,24 @@ +{ rustPlatform, lib, stdenv, fetchFromGitHub, Security }: + +rustPlatform.buildRustPackage rec { + pname = "MozWire"; + version = "0.7.0"; + + src = fetchFromGitHub { + owner = "NilsIrl"; + repo = pname; + rev = "v${version}"; + sha256 = "01bj3c34x9ywxygsz4rdyw5gc9cz8x6zzl5fd7db8qy8bx2lhlr9"; + }; + + buildInputs = lib.optionals stdenv.isDarwin [ Security ]; + + cargoSha256 = "0q27p2hyw6c1fh5x8kwsrw8a1hk6z90z0z3w86ga8ryz53xg4vdi"; + + meta = with lib; { + description = "MozillaVPN configuration manager giving Linux, macOS users (among others), access to MozillaVPN"; + homepage = "https://github.com/NilsIrl/MozWire"; + license = licenses.gpl3; + maintainers = with maintainers; [ siraben nilsirl ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/mpack/build-fix.patch b/nixpkgs/pkgs/tools/networking/mpack/build-fix.patch new file mode 100644 index 000000000000..0329bedd07f3 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/mpack/build-fix.patch @@ -0,0 +1,29 @@ +diff -ubr mpack-1.6-orig/unixos.c mpack-1.6/unixos.c +--- mpack-1.6-orig/unixos.c 2013-08-17 14:32:38.102772775 +0200 ++++ mpack-1.6/unixos.c 2013-08-17 14:32:43.180792505 +0200 +@@ -38,10 +38,6 @@ + #define MAXHOSTNAMELEN 64 + #endif + +-extern int errno; +-extern char *malloc(); +-extern char *getenv(); +- + int overwrite_files = 0; + int didchat; + +Only in mpack-1.6: unixos.o +Only in mpack-1.6: unixunpk.o +Only in mpack-1.6: uudecode.o +diff -ubr mpack-1.6-orig/xmalloc.c mpack-1.6/xmalloc.c +--- mpack-1.6-orig/xmalloc.c 2013-08-17 14:32:38.102772775 +0200 ++++ mpack-1.6/xmalloc.c 2013-08-17 14:33:08.900892319 +0200 +@@ -24,7 +24,6 @@ + */ + #include <stdio.h> + #include <string.h> +-extern char *malloc(), *realloc(); + + char *xmalloc (int size) + { +Only in mpack-1.6: xmalloc.o diff --git a/nixpkgs/pkgs/tools/networking/mpack/default.nix b/nixpkgs/pkgs/tools/networking/mpack/default.nix new file mode 100644 index 000000000000..3aca81596e08 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/mpack/default.nix @@ -0,0 +1,35 @@ +{ lib, stdenv, fetchurl }: + +stdenv.mkDerivation rec { + name = "mpack-1.6"; + + src = fetchurl { + url = "http://ftp.andrew.cmu.edu/pub/mpack/${name}.tar.gz"; + sha256 = "0k590z96509k96zxmhv72gkwhrlf55jkmyqlzi72m61r7axhhh97"; + }; + + patches = [ ./build-fix.patch ./sendmail-via-execvp.diff ]; + + postPatch = '' + for f in *.{c,man,pl,unix} ; do + substituteInPlace $f --replace /usr/tmp /tmp + done + + # this just shuts up some warnings + for f in {decode,encode,part,unixos,unixpk,unixunpk,xmalloc}.c ; do + sed -i 'i#include <stdlib.h>' $f + done + ''; + + postInstall = '' + install -Dm644 -t $out/share/doc/mpack INSTALL README.* + ''; + + enableParallelBuilding = true; + + meta = with lib; { + description = "Utilities for encoding and decoding binary files in MIME"; + license = licenses.free; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/mpack/sendmail-via-execvp.diff b/nixpkgs/pkgs/tools/networking/mpack/sendmail-via-execvp.diff new file mode 100644 index 000000000000..8f10901038d6 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/mpack/sendmail-via-execvp.diff @@ -0,0 +1,12 @@ +--- mpack-1.6/unixpk.c 2003-07-21 22:50:41.000000000 +0200 ++++ mpack-1.6/unixpk.c 2018-09-16 12:57:14.104026964 +0200 +@@ -254,8 +254,9 @@ + #ifdef SCO + execv("/usr/lib/mail/execmail", addr+start); + #else ++ execvp("sendmail", addr+start); + execv("/usr/lib/sendmail", addr+start); + execv("/usr/sbin/sendmail", addr+start); + #endif + perror("execv"); + _exit(1); diff --git a/nixpkgs/pkgs/tools/networking/mtr/default.nix b/nixpkgs/pkgs/tools/networking/mtr/default.nix new file mode 100644 index 000000000000..1257c167e768 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/mtr/default.nix @@ -0,0 +1,44 @@ +{ stdenv, lib, fetchFromGitHub, autoreconfHook, pkg-config +, libcap, ncurses +, withGtk ? false, gtk3 }: + +stdenv.mkDerivation rec { + pname = "mtr${lib.optionalString withGtk "-gui"}"; + version = "0.94"; + + src = fetchFromGitHub { + owner = "traviscross"; + repo = "mtr"; + rev = "v${version}"; + sha256 = "0wnz87cr2lcl74bj8qxq9xgai40az3pk9k0z893scyc8svd61xz6"; + }; + + # we need this before autoreconfHook does its thing + postPatch = '' + echo ${version} > .tarball-version + ''; + + # and this after autoreconfHook has generated Makefile.in + preConfigure = '' + substituteInPlace Makefile.in \ + --replace ' install-exec-hook' "" + ''; + + configureFlags = lib.optional (!withGtk) "--without-gtk"; + + nativeBuildInputs = [ autoreconfHook pkg-config ]; + + buildInputs = [ ncurses ] + ++ lib.optional withGtk gtk3 + ++ lib.optional stdenv.isLinux libcap; + + enableParallelBuilding = true; + + meta = with lib; { + description = "A network diagnostics tool"; + homepage = "https://www.bitwizard.nl/mtr/"; + license = licenses.gpl2; + maintainers = with maintainers; [ koral orivej raskin globin ]; + platforms = platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/mu/default.nix b/nixpkgs/pkgs/tools/networking/mu/default.nix new file mode 100644 index 000000000000..4553063929fd --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/mu/default.nix @@ -0,0 +1,62 @@ +{ lib, stdenv, fetchFromGitHub, sqlite, pkg-config, autoreconfHook, pmccabe +, xapian, glib, gmime3, texinfo, emacs, guile +, gtk3, webkitgtk, libsoup, icu +, makeWrapper +, withMug ? false +, batchSize ? null }: + +stdenv.mkDerivation rec { + pname = "mu"; + version = "1.4.15"; + + src = fetchFromGitHub { + owner = "djcb"; + repo = "mu"; + rev = version; + sha256 = "sha256-VIUA0W+AmEbvGWatv4maBGILvUTGhBgO3iQtjIc3vG8="; + }; + + postPatch = lib.optionalString (batchSize != null) '' + sed -i lib/mu-store.cc --regexp-extended \ + -e 's@(constexpr auto BatchSize).*@\1 = ${toString batchSize};@' + ''; + + buildInputs = [ + sqlite xapian glib gmime3 texinfo emacs libsoup icu + ] + # Workaround for https://github.com/djcb/mu/issues/1641 + ++ lib.optional (!stdenv.isDarwin) guile + ++ lib.optionals withMug [ gtk3 webkitgtk ]; + + nativeBuildInputs = [ pkg-config autoreconfHook pmccabe makeWrapper ]; + + enableParallelBuilding = true; + + preBuild = '' + # Fix mu4e-builddir (set it to $out) + substituteInPlace mu4e/mu4e-meta.el.in \ + --replace "@abs_top_builddir@" "$out" + ''; + + # Make sure included scripts can find their dependencies & optionally install mug + postInstall = '' + wrapProgram "$out/bin/mu" \ + --prefix LD_LIBRARY_PATH : "$out/lib" \ + --prefix GUILE_LOAD_PATH : "$out/share/guile/site/2.2" + '' + lib.optionalString withMug '' + for f in mug ; do + install -m755 toys/$f/$f $out/bin/$f + done + ''; + + doCheck = true; + + meta = with lib; { + description = "A collection of utilties for indexing and searching Maildirs"; + license = licenses.gpl3Plus; + homepage = "https://www.djcbsoftware.nl/code/mu/"; + changelog = "https://github.com/djcb/mu/releases/tag/${version}"; + maintainers = with maintainers; [ antono peterhoeg ]; + platforms = platforms.mesaPlatforms; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/mubeng/default.nix b/nixpkgs/pkgs/tools/networking/mubeng/default.nix new file mode 100644 index 000000000000..11ebe338c90b --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/mubeng/default.nix @@ -0,0 +1,25 @@ +{ lib +, buildGoModule +, fetchFromGitHub +}: + +buildGoModule rec { + pname = "mubeng"; + version = "0.4.5"; + + src = fetchFromGitHub { + owner = "kitabisa"; + repo = pname; + rev = "v${version}"; + sha256 = "03hm4wqlvsbi06g0ijrhvbk9i2ahmd1m8l80wbcijznhbdl5msl8"; + }; + + vendorSha256 = "1qcxix6724ly0klsr8bw3nv6pxn0wixqiqcgqkcp6sia4dxbbg14"; + + meta = with lib; { + description = "Proxy checker and IP rotator"; + homepage = "https://github.com/kitabisa/mubeng"; + license = with licenses; [ asl20 ]; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/nat-traverse/default.nix b/nixpkgs/pkgs/tools/networking/nat-traverse/default.nix new file mode 100644 index 000000000000..a1c1337a216b --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/nat-traverse/default.nix @@ -0,0 +1,37 @@ +{ lib, stdenv, fetchurl, perl }: + +stdenv.mkDerivation rec { + pname = "nat-traverse"; + version = "0.7"; + + src = fetchurl { + url = "https://www.speicherleck.de/iblech/nat-traverse/nat-traverse-${version}.tar.bz2"; + sha256 = "0knwnqsjwv7sa5wjb863ghabs7s269a73qwkmxpsbngjw9s0j2ih"; + }; + + nativeBuildInputs = [ perl ]; + + installPhase = '' + mkdir -p $out/bin $out/share/man/man1 + cp nat-traverse $out/bin + gzip -c nat-traverse.1 > $out/share/man/man1/nat-traverse.1.gz + ''; + + meta = with lib; { + description = "NAT gateway traversal utility"; + longDescription = '' + nat-traverse establishes direct connections between nodes which are + behind NAT gateways, i.e. hosts which do not have public IP addresses. + This is done using an UDP NAT traversal technique. Additionally, it's + possible to setup a small VPN by using pppd on top of nat-traverse. + + nat-traverse does not need an external server on the Internet, and it + isn't necessary to reconfigure the involved NAT gateways, either. + nat-traverse works out-of-the-box. + ''; + homepage = "https://www.speicherleck.de/iblech/nat-traverse/"; + license = licenses.gpl3Plus; + platforms = platforms.all; + maintainers = [ maintainers.iblech ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/nbd/default.nix b/nixpkgs/pkgs/tools/networking/nbd/default.nix new file mode 100644 index 000000000000..6478a15aa1a4 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/nbd/default.nix @@ -0,0 +1,35 @@ +{ lib, stdenv, fetchurl, pkg-config, glib, which }: + +stdenv.mkDerivation rec { + name = "nbd-3.21"; + + src = fetchurl { + url = "mirror://sourceforge/nbd/${name}.tar.xz"; + sha256 = "sha256-52iK852Rczu80tsIBixE/lA9AE5RUodAE5xEr/amvvk="; + }; + + buildInputs = [ glib ] + ++ lib.optional (stdenv ? glibc) stdenv.glibc.linuxHeaders; + + nativeBuildInputs = [ pkg-config which ]; + + postInstall = '' + mkdir -p "$out/share/doc/${name}" + cp README.md "$out/share/doc/${name}/" + ''; + + doCheck = true; + + # Glib calls `clock_gettime', which is in librt. Linking that library + # here ensures that a proper rpath is added to the executable so that + # it can be loaded at run-time. + NIX_LDFLAGS = lib.optionalString stdenv.isLinux "-lrt -lpthread"; + + meta = { + homepage = "http://nbd.sourceforge.net"; + description = "Map arbitrary files as block devices over the network"; + license = lib.licenses.gpl2; + maintainers = [ lib.maintainers.peti ]; + platforms = lib.platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/ncftp/default.nix b/nixpkgs/pkgs/tools/networking/ncftp/default.nix new file mode 100644 index 000000000000..a43d5f4a88c8 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/ncftp/default.nix @@ -0,0 +1,42 @@ +{ lib, stdenv, fetchurl, ncurses, coreutils }: + +stdenv.mkDerivation rec { + pname = "ncftp"; + version = "3.2.6"; + + src = fetchurl { + url = "ftp://ftp.ncftp.com/ncftp/ncftp-${version}-src.tar.xz"; + sha256 = "1389657cwgw5a3kljnqmhvfh4vr2gcr71dwz1mlhf22xq23hc82z"; + }; + + buildInputs = [ ncurses ]; + + enableParallelBuilding = true; + + preConfigure = '' + find -name Makefile.in | xargs sed -i '/^TMPDIR=/d' + + find . -name '*.sh' -or -name '*.in' -or -name '*.c' -or -name configure | xargs sed -i \ + -e 's@/bin/ls@${coreutils}/bin/ls@g' \ + -e 's@/bin/rm@${coreutils}/bin/rm@g' + ''; + + postInstall = '' + rmdir $out/etc + mkdir -p $out/share/doc + cp -r doc $out/share/doc/ncftp + ''; + + configureFlags = [ + "--enable-ssp" + "--mandir=$(out)/share/man/" + ]; + + meta = with lib; { + description = "Command line FTP (File Transfer Protocol) client"; + homepage = "https://www.ncftp.com/ncftp/"; + maintainers = with maintainers; [ bjornfor ]; + platforms = platforms.unix; + license = licenses.clArtistic; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/ndisc6/default.nix b/nixpkgs/pkgs/tools/networking/ndisc6/default.nix new file mode 100644 index 000000000000..6612315c6f2d --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/ndisc6/default.nix @@ -0,0 +1,31 @@ +{ lib, stdenv, fetchurl, perl }: + +stdenv.mkDerivation rec { + name = "ndisc6-1.0.4"; + + src = fetchurl { + url = "https://www.remlab.net/files/ndisc6/archive/${name}.tar.bz2"; + sha256 = "07swyar1hl83zxmd7fqwb2q0c0slvrswkcfp3nz5lknrk15dmcdb"; + }; + + buildInputs = [ perl ]; + + configureFlags = [ + "--sysconfdir=/etc" + "--localstatedir=/var" + "--disable-suid-install" + ]; + + installFlags = [ + "sysconfdir=\${out}/etc" + "localstatedir=$(TMPDIR)" + ]; + + meta = with lib; { + homepage = "https://www.remlab.net/ndisc6/"; + description = "A small collection of useful tools for IPv6 networking"; + maintainers = with maintainers; [ eelco ]; + platforms = platforms.linux; + license = licenses.gpl2; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/ndjbdns/default.nix b/nixpkgs/pkgs/tools/networking/ndjbdns/default.nix new file mode 100644 index 000000000000..651cbab86d93 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/ndjbdns/default.nix @@ -0,0 +1,31 @@ +{ lib, stdenv, fetchFromGitHub, autoreconfHook, systemd, pkg-config }: + +with lib; + +stdenv.mkDerivation { + version = "1.06"; + pname = "ndjbdns"; + + src = fetchFromGitHub { + owner = "pjps"; + repo = "ndjbdns"; + rev = "64d371b6f887621de7bf8bd495be10442b2accd0"; + sha256 = "0gjyvn8r66kp49gasd6sqfvg2pj0c6v67hnq7cqwl04kj69rfy86"; + }; + + nativeBuildInputs = [ autoreconfHook pkg-config ]; + buildInputs = [ ] + ++ optional stdenv.isLinux systemd; + + meta = { + description = "A brand new release of the Djbdns"; + longDescription = '' + Djbdns is a fully‐fledged Domain Name System(DNS), originally written by the eminent author of qmail, Dr. D J Bernstein. + ''; + homepage = "http://pjp.dgplug.org/ndjbdns/"; + license = licenses.gpl2; + maintainers = [ maintainers.msackman ]; + platforms = platforms.linux ++ platforms.darwin; + }; + +} diff --git a/nixpkgs/pkgs/tools/networking/nebula/default.nix b/nixpkgs/pkgs/tools/networking/nebula/default.nix new file mode 100644 index 000000000000..06615ae25fae --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/nebula/default.nix @@ -0,0 +1,44 @@ +{ lib, buildGoModule, fetchFromGitHub }: + +buildGoModule rec { + pname = "nebula"; + version = "1.4.0"; + + src = fetchFromGitHub { + owner = "slackhq"; + repo = pname; + rev = "v${version}"; + sha256 = "lu2/rSB9cFD7VUiK+niuqCX9CI2x+k4Pi+U5yksETSU="; + }; + + vendorSha256 = "p1inJ9+NAb2d81cn+y+ofhxFz9ObUiLgj+9cACa6Jqg="; + + doCheck = false; + + subPackages = [ "cmd/nebula" "cmd/nebula-cert" ]; + + buildFlagsArray = [ "-ldflags=" "-X main.Build=${version}" ]; + + meta = with lib; { + description = "A scalable overlay networking tool with a focus on performance, simplicity and security"; + longDescription = '' + Nebula is a scalable overlay networking tool with a focus on performance, + simplicity and security. It lets you seamlessly connect computers + anywhere in the world. Nebula is portable, and runs on Linux, OSX, and + Windows. (Also: keep this quiet, but we have an early prototype running + on iOS). It can be used to connect a small number of computers, but is + also able to connect tens of thousands of computers. + + Nebula incorporates a number of existing concepts like encryption, + security groups, certificates, and tunneling, and each of those + individual pieces existed before Nebula in various forms. What makes + Nebula different to existing offerings is that it brings all of these + ideas together, resulting in a sum that is greater than its individual + parts. + ''; + homepage = "https://github.com/slackhq/nebula"; + license = licenses.mit; + maintainers = with maintainers; [ Br1ght0ne ]; + }; + +} diff --git a/nixpkgs/pkgs/tools/networking/netboot/default.nix b/nixpkgs/pkgs/tools/networking/netboot/default.nix new file mode 100644 index 000000000000..e7d984a798b3 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/netboot/default.nix @@ -0,0 +1,20 @@ +{ lib, stdenv, fetchurl, bison, lzo, db4 }: + +stdenv.mkDerivation rec { + name = "netboot-0.10.2"; + src = fetchurl { + url = "mirror://sourceforge/netboot/${name}.tar.gz"; + sha256 = "09w09bvwgb0xzn8hjz5rhi3aibysdadbg693ahn8rylnqfq4hwg0"; + }; + + buildInputs = [ bison lzo db4 ]; + + hardeningDisable = [ "format" ]; + + meta = with lib; { + description = "Mini PXE server"; + maintainers = [ maintainers.raskin ]; + platforms = ["x86_64-linux"]; + license = lib.licenses.free; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/netcat/default.nix b/nixpkgs/pkgs/tools/networking/netcat/default.nix new file mode 100644 index 000000000000..7b325b2f4840 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/netcat/default.nix @@ -0,0 +1,17 @@ +{ lib, stdenv, fetchurl }: + +stdenv.mkDerivation { + name = "netcat-gnu-0.7.1"; + + src = fetchurl { + url = "mirror://sourceforge/netcat/netcat-0.7.1.tar.bz2"; + sha256 = "1frjcdkhkpzk0f84hx6hmw5l0ynpmji8vcbaxg8h5k2svyxz0nmm"; + }; + + meta = with lib; { + description = "Utility which reads and writes data across network connections"; + homepage = "http://netcat.sourceforge.net/"; + license = licenses.gpl2Plus; + platforms = platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/nethogs/default.nix b/nixpkgs/pkgs/tools/networking/nethogs/default.nix new file mode 100644 index 000000000000..c6a8f3b7f4e9 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/nethogs/default.nix @@ -0,0 +1,36 @@ +{ lib, stdenv, fetchFromGitHub, ncurses, libpcap }: + +stdenv.mkDerivation rec { + pname = "nethogs"; + version = "0.8.6"; + + src = fetchFromGitHub { + owner = "raboof"; + repo = "nethogs"; + rev = "v${version}"; + sha256 = "0sn1sdp86akwlm4r1vmkxjjl50c0xaisk91bbz57z7kcsaphxna9"; + }; + + buildInputs = [ ncurses libpcap ]; + + makeFlags = [ "VERSION=${version}" ]; + + installFlags = [ "PREFIX=$(out)" "sbin=$(out)/bin" ]; + + meta = with lib; { + description = "A small 'net top' tool, grouping bandwidth by process"; + longDescription = '' + NetHogs is a small 'net top' tool. Instead of breaking the traffic down + per protocol or per subnet, like most tools do, it groups bandwidth by + process. NetHogs does not rely on a special kernel module to be loaded. + If there's suddenly a lot of network traffic, you can fire up NetHogs + and immediately see which PID is causing this. This makes it easy to + identify programs that have gone wild and are suddenly taking up your + bandwidth. + ''; + license = licenses.gpl2Plus; + homepage = "https://github.com/raboof/nethogs#readme"; + platforms = platforms.linux; + maintainers = [ maintainers.rycee ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/netifd/default.nix b/nixpkgs/pkgs/tools/networking/netifd/default.nix new file mode 100644 index 000000000000..dc343e563a75 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/netifd/default.nix @@ -0,0 +1,23 @@ +{ lib, stdenv, cmake, fetchgit, libnl, libubox, uci, ubus, json_c, pkg-config }: + +stdenv.mkDerivation { + pname = "netifd"; + version = "unstable-2021-04-03"; + + src = fetchgit { + url = "https://git.openwrt.org/project/netifd.git"; + rev = "327da9895327bc56b23413ee91a6e6b6e0e4329d"; + sha256 = "0jvk2hx8kbkc6d72gh9rwap8ds6qgnmny6306vvzxy68v03xikwv"; + }; + + buildInputs = [ libnl libubox uci ubus json_c ]; + nativeBuildInputs = [ cmake pkg-config ]; + + meta = with lib; { + description = "OpenWrt Network interface configuration daemon"; + homepage = "https://git.openwrt.org/?p=project/netifd.git;a=summary"; + license = licenses.lgpl21Only; + platforms = platforms.linux; + maintainers = with maintainers; [ petabyteboy ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/netkit/tftp/default.nix b/nixpkgs/pkgs/tools/networking/netkit/tftp/default.nix new file mode 100644 index 000000000000..3a7a3a1deb49 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/netkit/tftp/default.nix @@ -0,0 +1,26 @@ +{lib, stdenv, fetchurl}: + +stdenv.mkDerivation rec { + name = "netkit-tftp-0.17"; + + src = fetchurl { + urls = [ + "mirror://ubuntu/pool/universe/n/netkit-tftp/netkit-tftp_0.17.orig.tar.gz" + "ftp://ftp.uk.linux.org/pub/linux/Networking/netkit/${name}.tar.gz" + "https://ftp.cc.uoc.gr/mirrors/linux/ubuntu/packages/pool/universe/n/netkit-tftp/netkit-tftp_0.17.orig.tar.gz" + ]; + sha256 = "0kfibbjmy85r3k92cdchha78nzb6silkgn1zaq9g8qaf1l0w0hrs"; + }; + + preInstall = " + mkdir -p $out/man/man{1,8} $out/sbin $out/bin + "; + + meta = { + description = "Netkit TFTP client and server"; + homepage = "ftp://ftp.uk.linux.org/pub/linux/Networking/netkit/"; + license = lib.licenses.bsdOriginal; + maintainers = with lib.maintainers; [viric]; + platforms = with lib.platforms; linux; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/netmask/default.nix b/nixpkgs/pkgs/tools/networking/netmask/default.nix new file mode 100644 index 000000000000..c1613fcf9206 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/netmask/default.nix @@ -0,0 +1,24 @@ +{ lib, stdenv, fetchFromGitHub, autoreconfHook, texinfo }: + +stdenv.mkDerivation rec { + pname = "netmask"; + version = "2.4.4"; + + src = fetchFromGitHub { + owner = "tlby"; + repo = "netmask"; + rev = "v${version}"; + sha256 = "1269bmdvl534wr0bamd7cqbnr76pnb14yn8ly4qsfg29kh7hrds6"; + }; + + buildInputs = [ texinfo ]; + nativeBuildInputs = [ autoreconfHook ]; + + meta = with lib; { + homepage = "https://github.com/tlby/netmask"; + description = "An IP address formatting tool "; + license = licenses.gpl2; + platforms = platforms.linux; + maintainers = [ maintainers.jensbin ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/netrw/default.nix b/nixpkgs/pkgs/tools/networking/netrw/default.nix new file mode 100644 index 000000000000..c5e54ab8f432 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/netrw/default.nix @@ -0,0 +1,35 @@ +{ lib, stdenv, fetchurl +, checksumType ? "built-in" +, libmhash ? null +, openssl ? null +}: + +assert checksumType == "mhash" -> libmhash != null; +assert checksumType == "openssl" -> openssl != null; + +stdenv.mkDerivation rec { + pname = "netrw"; + version = "1.3.2"; + + configureFlags = [ + "--with-checksum=${checksumType}" + ]; + + buildInputs = lib.optional (checksumType == "mhash") libmhash + ++ lib.optional (checksumType == "openssl") openssl; + + src = fetchurl { + urls = [ + "https://mamuti.net/files/netrw/netrw-${version}.tar.bz2" + "http://www.sourcefiles.org/Networking/FTP/Other/netrw-${version}.tar.bz2" + ]; + sha256 = "1gnl80i5zkyj2lpnb4g0q0r5npba1x6cnafl2jb3i3pzlfz1bndr"; + }; + + meta = { + description = "Simple tool for transporting data over the network"; + license = lib.licenses.gpl2; + homepage = "https://mamuti.net/netrw/index.en.html"; + platforms = lib.platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/netselect/default.nix b/nixpkgs/pkgs/tools/networking/netselect/default.nix new file mode 100644 index 000000000000..be68e3e2c600 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/netselect/default.nix @@ -0,0 +1,34 @@ +{ lib, stdenv, fetchFromGitHub }: + +stdenv.mkDerivation rec { + pname = "netselect"; + version = "0.4"; + + src = fetchFromGitHub { + owner = "apenwarr"; + repo = "netselect"; + rev = "${pname}-${version}"; + sha256 = "1zncyvjzllrjbdvz7c50d1xjyhs9mwqfy92ndpfc5b3mxqslw4kx"; + }; + + postPatch = '' + substituteInPlace netselect-apt \ + --replace "/usr/bin/" "" + ''; + + makeFlags = [ "PREFIX=$(out)" ]; + + installPhase = '' + runHook preInstall + install -Dm555 -t $out/bin netselect netselect-apt + install -Dm444 -t $out/share/man/man1 *.1 + runHook postInstall + ''; + + meta = with lib; { + homepage = "https://github.com/apenwarr/netselect"; + description = "An ultrafast intelligent parallelizing binary-search implementation of \"ping\""; + license = licenses.bsd3; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/netsniff-ng/default.nix b/nixpkgs/pkgs/tools/networking/netsniff-ng/default.nix new file mode 100644 index 000000000000..36028208f56d --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/netsniff-ng/default.nix @@ -0,0 +1,92 @@ +{ stdenv +, lib +, fetchFromGitHub +, makeWrapper +, bison +, flex +, geoip +, geolite-legacy +, libcli +, libnet +, libnetfilter_conntrack +, libnl +, libpcap +, libsodium +, liburcu +, ncurses +, pkg-config +, zlib +}: + +stdenv.mkDerivation rec { + pname = "netsniff-ng"; + version = "0.6.8"; + + src = fetchFromGitHub { + repo = pname; + owner = pname; + rev = "v${version}"; + sha256 = "10ih8amaqspy0zwg7hqvypa1v7ixpjl0n608cyfgyfzffp73lbqf"; + }; + + nativeBuildInputs = [ + bison + flex + makeWrapper + pkg-config + ]; + + buildInputs = [ + geoip + geolite-legacy + libcli + libnet + libnl + libnetfilter_conntrack + libpcap + libsodium + liburcu + ncurses + zlib + ]; + + # ./configure is not autoGNU but some home-brewn magic + configurePhase = '' + patchShebangs configure + substituteInPlace configure --replace "which" "command -v" + NACL_INC_DIR=${libsodium.dev}/include/sodium NACL_LIB=sodium ./configure + ''; + + enableParallelBuilding = true; + + # All files installed to /etc are just static data that can go in the store + makeFlags = [ "PREFIX=$(out)" "ETCDIR=$(out)/etc" ]; + + postInstall = '' + # trafgen and bpfc can call out to cpp to process config files. + wrapProgram "$out/sbin/trafgen" --prefix PATH ":" "${stdenv.cc}/bin" + wrapProgram "$out/sbin/bpfc" --prefix PATH ":" "${stdenv.cc}/bin" + + ln -sv ${geolite-legacy}/share/GeoIP/GeoIP.dat $out/etc/netsniff-ng/country4.dat + ln -sv ${geolite-legacy}/share/GeoIP/GeoIPv6.dat $out/etc/netsniff-ng/country6.dat + ln -sv ${geolite-legacy}/share/GeoIP/GeoIPCity.dat $out/etc/netsniff-ng/city4.dat + ln -sv ${geolite-legacy}/share/GeoIP/GeoIPCityv6.dat $out/etc/netsniff-ng/city6.dat + ln -sv ${geolite-legacy}/share/GeoIP/GeoIPASNum.dat $out/etc/netsniff-ng/asname4.dat + ln -sv ${geolite-legacy}/share/GeoIP/GeoIPASNumv6.dat $out/etc/netsniff-ng/asname6.dat + rm -v $out/etc/netsniff-ng/geoip.conf # updating databases after installation is impossible + ''; + + meta = with lib; { + description = "Swiss army knife for daily Linux network plumbing"; + longDescription = '' + netsniff-ng is a free Linux networking toolkit. Its gain of performance + is reached by zero-copy mechanisms, so that on packet reception and + transmission the kernel does not need to copy packets from kernel space + to user space and vice versa. The toolkit can be used for network + development and analysis, debugging, auditing or network reconnaissance. + ''; + homepage = "http://netsniff-ng.org/"; + license = with licenses; [ gpl2Only ]; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/nettee/default.nix b/nixpkgs/pkgs/tools/networking/nettee/default.nix new file mode 100644 index 000000000000..c5cbcb19a971 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/nettee/default.nix @@ -0,0 +1,68 @@ +{ stdenv, lib, fetchurl, cleanPackaging }: + +let + version = "0.3.4"; + sha256 = "00xbkp99x9v07r34w7m2p8gak5hdsdbka36n7a733rdrrkgf5z7r"; + +in stdenv.mkDerivation { + pname = "nettee"; + inherit version; + + src = fetchurl { + url = "http://saf.bio.caltech.edu/pub/software/linux_or_unix_tools/beta-nettee-${version}.tar.gz"; + inherit sha256; + }; + + meta = { + homepage = "http://saf.bio.caltech.edu/nettee.html"; + description = ''Network "tee" program''; + license = lib.licenses.gpl2; + maintainers = with lib.maintainers; [ Profpatsch ]; + platforms = lib.platforms.linux; + }; + + outputs = [ "bin" "man" "doc" "out" ]; + + patchPhase = '' + # h_addr field was removed + sed -e '1 i #define h_addr h_addr_list[0]' \ + -i nettee.c + ''; + + buildPhase = '' + cat README.TXT + mkdir -p $bin/bin + $CC -o $bin/bin/nettee \ + -Wall -pedantic -std=c99\ + -D_LARGEFILE64_SOURCE -D_POSIX_SOURCE -D_XOPEN_SOURCE\ + nettee.c rb.c nio.c + ''; + + installPhase = '' + ${cleanPackaging.commonFileActions { + docFiles = [ + "*.html" + "*.TXT" + "LICENSE" + "*.sh" + "topology.txt" + "beowulf.master" + "topology_info" + ]; + noiseFiles = [ + "*.c" + "*.h" + "nettee" + ]; + }} $doc/share/doc/nettee + + mkdir -p $man/share/man/{man1,man3} + mv nettee.1 $man/share/man/man1 + mv nettee_cmd.3 $man/share/man/man3 + ''; + + postFixup = '' + ${cleanPackaging.checkForRemainingFiles} + ''; + +} diff --git a/nixpkgs/pkgs/tools/networking/networkmanager/0.9.8/default.nix b/nixpkgs/pkgs/tools/networking/networkmanager/0.9.8/default.nix new file mode 100644 index 000000000000..757c886fdf3f --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/networkmanager/0.9.8/default.nix @@ -0,0 +1,64 @@ +{ lib, stdenv, fetchurl, intltool, pkg-config, dbus-glib +, udev, libnl, libuuid, gnutls, dhcp +, libgcrypt, perl, libgudev, avahi, ppp, kmod }: + +stdenv.mkDerivation rec { + pname = "networkmanager"; + version = "0.9.8.10"; + + src = fetchurl { + url = "mirror://gnome/sources/NetworkManager/0.9/NetworkManager-${version}.tar.xz"; + sha256 = "0wn9qh8r56r8l19dqr68pdl1rv3zg1dv47rfy6fqa91q7li2fk86"; + }; + + preConfigure = '' + substituteInPlace tools/glib-mkenums --replace /usr/bin/perl ${perl}/bin/perl + substituteInPlace src/nm-device.c \ + --replace @avahi@ ${avahi} \ + --replace @kmod@ ${kmod} + substituteInPlace src/ppp-manager/nm-ppp-manager.c \ + --replace @ppp@ ${ppp} \ + --replace @kmod@ ${kmod} + ''; + + # Right now we hardcode quite a few paths at build time. Probably we should + # patch networkmanager to allow passing these path in config file. This will + # remove unneeded build-time dependencies. + configureFlags = [ + "--with-distro=exherbo" + "--with-dhclient=${dhcp}/sbin/dhclient" + "--with-dhcpcd=no" + "--with-iptables=no" + "--with-udev-dir=\${out}/lib/udev" + "--with-resolvconf=no" + "--sysconfdir=/etc" "--localstatedir=/var" + "--with-dbus-sys-dir=\${out}/etc/dbus-1/system.d" + "--with-crypto=gnutls" "--disable-more-warnings" + "--with-systemdsystemunitdir=$(out)/etc/systemd/system" + "--with-kernel-firmware-dir=/run/current-system/firmware" + "--disable-ppp" + ]; + + buildInputs = [ udev libnl libuuid gnutls libgcrypt libgudev ]; + + propagatedBuildInputs = [ dbus-glib ]; + + nativeBuildInputs = [ intltool pkg-config ]; + + patches = + [ ./libnl-3.2.25.patch + ./nixos-purity.patch + ]; + + preInstall = + '' + installFlagsArray=( "sysconfdir=$out/etc" "localstatedir=$out/var" ) + ''; + + meta = with lib; { + homepage = "http://projects.gnome.org/NetworkManager/"; + description = "Network configuration and management tool"; + license = licenses.gpl2Plus; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/networkmanager/0.9.8/libnl-3.2.25.patch b/nixpkgs/pkgs/tools/networking/networkmanager/0.9.8/libnl-3.2.25.patch new file mode 100644 index 000000000000..17c2966b7064 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/networkmanager/0.9.8/libnl-3.2.25.patch @@ -0,0 +1,61 @@ +diff --git a/src/nm-netlink-monitor.c b/src/nm-netlink-monitor.c +index ba8053e..5ac39d3 100644 +--- a/src/nm-netlink-monitor.c ++++ b/src/nm-netlink-monitor.c +@@ -177,40 +177,15 @@ link_msg_handler (struct nl_object *obj, void *arg) + static int + event_msg_recv (struct nl_msg *msg, void *arg) + { +- struct nl_sock *nlh = arg; +- struct nlmsghdr *hdr = nlmsg_hdr (msg); + struct ucred *creds = nlmsg_get_creds (msg); +- const struct sockaddr_nl *snl; +- guint32 local_port; +- gboolean accept_msg = FALSE; +- +- /* Only messages sent from the kernel */ +- if (!creds || creds->uid != 0) { +- nm_log_dbg (LOGD_HW, "ignoring netlink message from UID %d", +- creds ? creds->uid : -1); +- return NL_SKIP; +- } +- +- snl = nlmsg_get_src (msg); +- g_assert (snl); +- +- /* Accept any messages from the kernel */ +- if (hdr->nlmsg_pid == 0 || snl->nl_pid == 0) +- accept_msg = TRUE; + +- /* And any multicast message directed to our netlink PID, since multicast +- * currently requires CAP_ADMIN to use. +- */ +- local_port = nl_socket_get_local_port (nlh); +- if ((hdr->nlmsg_pid == local_port) && snl->nl_groups) +- accept_msg = TRUE; +- +- if (accept_msg == FALSE) { +- nm_log_dbg (LOGD_HW, "ignoring netlink message from PID %d (local PID %d, multicast %d)", +- hdr->nlmsg_pid, +- local_port, +- (hdr->nlmsg_flags & NLM_F_MULTI)); +- return NL_SKIP; ++ if (!creds || creds->pid || creds->uid || creds->gid) { ++ if (creds) ++ nm_log_dbg (LOGD_HW, "netlink: received non-kernel message (pid %d uid %d gid %d)", ++ creds->pid, creds->uid, creds->gid); ++ else ++ nm_log_dbg (LOGD_HW, "netlink: received message without credentials"); ++ return NL_STOP; + } + + return NL_OK; +@@ -285,7 +260,7 @@ nlh_setup (struct nl_sock *nlh, + { + int err; + +- nl_socket_modify_cb (nlh, NL_CB_MSG_IN, NL_CB_CUSTOM, event_msg_recv, cb_data); ++ nl_socket_modify_cb (nlh, NL_CB_MSG_IN, NL_CB_CUSTOM, event_msg_recv, NULL); + + if (valid_func) + nl_socket_modify_cb (nlh, NL_CB_VALID, NL_CB_CUSTOM, valid_func, cb_data); diff --git a/nixpkgs/pkgs/tools/networking/networkmanager/0.9.8/nixos-purity.patch b/nixpkgs/pkgs/tools/networking/networkmanager/0.9.8/nixos-purity.patch new file mode 100644 index 000000000000..9ebc080ba96f --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/networkmanager/0.9.8/nixos-purity.patch @@ -0,0 +1,77 @@ +diff --git a/src/dhcp-manager/nm-dhcp-dhclient.c b/src/dhcp-manager/nm-dhcp-dhclient.c +index 0932139..5b5aee8 100644 +--- a/src/dhcp-manager/nm-dhcp-dhclient.c ++++ b/src/dhcp-manager/nm-dhcp-dhclient.c +@@ -68,10 +68,6 @@ const char * + nm_dhcp_dhclient_get_path (const char *try_first) + { + static const char *dhclient_paths[] = { +- "/sbin/dhclient", +- "/usr/sbin/dhclient", +- "/usr/pkg/sbin/dhclient", +- "/usr/local/sbin/dhclient", + NULL + }; + const char **path = dhclient_paths; +diff --git a/src/dhcp-manager/nm-dhcp-dhcpcd.c b/src/dhcp-manager/nm-dhcp-dhcpcd.c +index 237661f..48bc33f 100644 +--- a/src/dhcp-manager/nm-dhcp-dhcpcd.c ++++ b/src/dhcp-manager/nm-dhcp-dhcpcd.c +@@ -51,10 +51,6 @@ const char * + nm_dhcp_dhcpcd_get_path (const char *try_first) + { + static const char *dhcpcd_paths[] = { +- "/sbin/dhcpcd", +- "/usr/sbin/dhcpcd", +- "/usr/pkg/sbin/dhcpcd", +- "/usr/local/sbin/dhcpcd", + NULL + }; + const char **path = dhcpcd_paths; +diff --git a/src/nm-device.c b/src/nm-device.c +index 1dc94ee..e60f3c8 100644 +--- a/src/nm-device.c ++++ b/src/nm-device.c +@@ -1321,8 +1321,7 @@ aipd_start (NMDevice *self, NMDeviceStateReason *reason) + char *argv[6], *cmdline; + const char **aipd_binary = NULL; + static const char *aipd_paths[] = { +- "/usr/sbin/avahi-autoipd", +- "/usr/local/sbin/avahi-autoipd", ++ "@avahi@/sbin/avahi-autoipd", + NULL + }; + int i = 0; +@@ -2555,7 +2554,7 @@ share_init (void) + } + + for (iter = modules; *iter; iter++) { +- char *argv[3] = { "/sbin/modprobe", *iter, NULL }; ++ char *argv[3] = { "@kmod@/bin/modprobe", *iter, NULL }; + char *envp[1] = { NULL }; + GError *error = NULL; + +diff --git a/src/ppp-manager/nm-ppp-manager.c b/src/ppp-manager/nm-ppp-manager.c +index 59698c3..7dba0f7 100644 +--- a/src/ppp-manager/nm-ppp-manager.c ++++ b/src/ppp-manager/nm-ppp-manager.c +@@ -661,9 +661,7 @@ static inline const char * + nm_find_pppd (void) + { + static const char *pppd_binary_paths[] = { +- "/usr/local/sbin/pppd", +- "/usr/sbin/pppd", +- "/sbin/pppd", ++ "@ppp@/sbin/pppd", + NULL + }; + +@@ -988,7 +986,7 @@ nm_ppp_manager_start (NMPPPManager *manager, + + /* Make sure /dev/ppp exists (bgo #533064) */ + if (stat ("/dev/ppp", &st) || !S_ISCHR (st.st_mode)) +- ignored = system ("/sbin/modprobe ppp_generic"); ++ ignored = system ("@kmod@/bin/modprobe ppp_generic"); + + connection = nm_act_request_get_connection (req); + g_assert (connection); diff --git a/nixpkgs/pkgs/tools/networking/networkmanager/applet/default.nix b/nixpkgs/pkgs/tools/networking/networkmanager/applet/default.nix new file mode 100644 index 000000000000..5f83ffae055f --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/networkmanager/applet/default.nix @@ -0,0 +1,89 @@ +{ lib, stdenv +, fetchurl +, meson +, ninja +, gettext +, pkg-config +, networkmanager +, gnome +, libnotify +, libsecret +, polkit +, modemmanager +, libnma +, glib-networking +, gsettings-desktop-schemas +, libgudev +, jansson +, wrapGAppsHook +, gobject-introspection +, python3 +, gtk3 +, libappindicator-gtk3 +, glib +}: + +stdenv.mkDerivation rec { + pname = "network-manager-applet"; + version = "1.22.0"; + + src = fetchurl { + url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz"; + sha256 = "sha256-xw2AtI1AqcuZ7JZ8xDifZ+fwMBUopp1IFXIEEzGmRr4="; + }; + + mesonFlags = [ + "-Dselinux=false" + "-Dappindicator=yes" + ]; + + outputs = [ "out" "man" ]; + + buildInputs = [ + libnma + gtk3 + networkmanager + libnotify + libsecret + gsettings-desktop-schemas + polkit + libgudev + modemmanager + jansson + glib + glib-networking + libappindicator-gtk3 + gnome.adwaita-icon-theme + ]; + + nativeBuildInputs = [ + meson + ninja + gettext + pkg-config + wrapGAppsHook + gobject-introspection + python3 + ]; + + postPatch = '' + chmod +x meson_post_install.py # patchShebangs requires executable file + patchShebangs meson_post_install.py + ''; + + passthru = { + updateScript = gnome.updateScript { + packageName = pname; + attrPath = "networkmanagerapplet"; + versionPolicy = "odd-unstable"; + }; + }; + + meta = with lib; { + homepage = "https://gitlab.gnome.org/GNOME/network-manager-applet/"; + description = "NetworkManager control applet for GNOME"; + license = licenses.gpl2Plus; + maintainers = with maintainers; [ phreedom ]; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/networkmanager/default.nix b/nixpkgs/pkgs/tools/networking/networkmanager/default.nix new file mode 100644 index 000000000000..11c5462ab202 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/networkmanager/default.nix @@ -0,0 +1,112 @@ +{ lib, stdenv, fetchurl, substituteAll, intltool, pkg-config, fetchpatch, dbus +, gnome, systemd, libuuid, polkit, gnutls, ppp, dhcp, iptables, python3, vala +, libgcrypt, dnsmasq, bluez5, readline, libselinux, audit +, gobject-introspection, modemmanager, openresolv, libndp, newt, libsoup +, ethtool, gnused, iputils, kmod, jansson, gtk-doc, libxslt +, docbook_xsl, docbook_xml_dtd_412, docbook_xml_dtd_42, docbook_xml_dtd_43 +, openconnect, curl, meson, ninja, libpsl, mobile-broadband-provider-info, runtimeShell }: + +let + pythonForDocs = python3.withPackages (pkgs: with pkgs; [ pygobject3 ]); +in stdenv.mkDerivation rec { + pname = "networkmanager"; + version = "1.30.4"; + + src = fetchurl { + url = "mirror://gnome/sources/NetworkManager/${lib.versions.majorMinor version}/NetworkManager-${version}.tar.xz"; + sha256 = "sha256-YFC3JCEuo85zhhEzWb6pr6H2eaVPYNmZpZmYkuZywZA="; + }; + + outputs = [ "out" "dev" "devdoc" "man" "doc" ]; + + # Right now we hardcode quite a few paths at build time. Probably we should + # patch networkmanager to allow passing these path in config file. This will + # remove unneeded build-time dependencies. + mesonFlags = [ + "-Ddhclient=${dhcp}/bin/dhclient" + "-Ddnsmasq=${dnsmasq}/bin/dnsmasq" + # Upstream prefers dhclient, so don't add dhcpcd to the closure + "-Ddhcpcd=no" + "-Ddhcpcanon=no" + "-Dpppd=${ppp}/bin/pppd" + "-Diptables=${iptables}/bin/iptables" + # to enable link-local connections + "-Dudev_dir=${placeholder "out"}/lib/udev" + "-Dresolvconf=${openresolv}/bin/resolvconf" + "-Ddbus_conf_dir=${placeholder "out"}/share/dbus-1/system.d" + "-Dsystemdsystemunitdir=${placeholder "out"}/etc/systemd/system" + "-Dkernel_firmware_dir=/run/current-system/firmware" + "--sysconfdir=/etc" + "--localstatedir=/var" + "-Dcrypto=gnutls" + "-Dsession_tracking=systemd" + "-Dmodem_manager=true" + "-Dnmtui=true" + "-Ddocs=true" + "-Dtests=no" + "-Dqt=false" + "-Dpolkit_agent_helper_1=/run/wrappers/bin/polkit-agent-helper-1" + # Allow using iwd when configured to do so + "-Diwd=true" + "-Dlibaudit=yes-disabled-by-default" + # We don't use firewalld in NixOS + "-Dfirewalld_zone=false" + ]; + + patches = [ + (substituteAll { + src = ./fix-paths.patch; + inherit iputils kmod openconnect ethtool gnused systemd; + inherit runtimeShell; + }) + + # Meson does not support using different directories during build and + # for installation like Autotools did with flags passed to make install. + ./fix-install-paths.patch + ]; + + buildInputs = [ + systemd libselinux audit libpsl libuuid polkit ppp libndp curl mobile-broadband-provider-info + bluez5 dnsmasq gobject-introspection modemmanager readline newt libsoup jansson + ]; + + propagatedBuildInputs = [ gnutls libgcrypt ]; + + nativeBuildInputs = [ + meson ninja intltool pkg-config + vala gobject-introspection dbus + # Docs + gtk-doc libxslt docbook_xsl docbook_xml_dtd_412 docbook_xml_dtd_42 docbook_xml_dtd_43 pythonForDocs + ]; + + doCheck = false; # requires /sys, the net + + postPatch = '' + patchShebangs ./tools + patchShebangs libnm/generate-setting-docs.py + ''; + + preBuild = '' + # Our gobject-introspection patches make the shared library paths absolute + # in the GIR files. When building docs, the library is not yet installed, + # though, so we need to replace the absolute path with a local one during build. + # We are using a symlink that will be overridden during installation. + mkdir -p ${placeholder "out"}/lib + ln -s $PWD/libnm/libnm.so.0 ${placeholder "out"}/lib/libnm.so.0 + ''; + + passthru = { + updateScript = gnome.updateScript { + packageName = pname; + attrPath = "networkmanager"; + }; + }; + + meta = with lib; { + homepage = "https://wiki.gnome.org/Projects/NetworkManager"; + description = "Network configuration and management tool"; + license = licenses.gpl2Plus; + maintainers = teams.freedesktop.members ++ (with maintainers; [ phreedom domenkozar obadz ]); + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/networkmanager/dmenu/default.nix b/nixpkgs/pkgs/tools/networking/networkmanager/dmenu/default.nix new file mode 100644 index 000000000000..9ea3dde19ab3 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/networkmanager/dmenu/default.nix @@ -0,0 +1,40 @@ +{ lib, stdenv, glib, fetchFromGitHub, networkmanager, python3Packages +, gobject-introspection }: + +let inherit (python3Packages) python pygobject3; +in stdenv.mkDerivation rec { + pname = "networkmanager_dmenu"; + version = "1.6.0"; + + src = fetchFromGitHub { + owner = "firecat53"; + repo = "networkmanager-dmenu"; + rev = version; + sha256 = "1liidqh8c33pxyb07qyj0jkd0fdak73g9r2iwiq62vfzrpik09k0"; + }; + + buildInputs = [ glib python pygobject3 gobject-introspection networkmanager python3Packages.wrapPython ]; + + dontBuild = true; + + installPhase = '' + mkdir -p $out/bin + cp networkmanager_dmenu $out/bin/ + ''; + + postFixup = '' + makeWrapperArgs="\ + --prefix GI_TYPELIB_PATH : $GI_TYPELIB_PATH \ + --prefix PYTHONPATH : \"$(toPythonPath $out):$(toPythonPath ${pygobject3})\"" + wrapPythonPrograms + ''; + + + meta = with lib; { + description = "Small script to manage NetworkManager connections with dmenu instead of nm-applet"; + homepage = "https://github.com/firecat53/networkmanager-dmenu"; + license = lib.licenses.mit; + maintainers = [ lib.maintainers.jensbin ]; + platforms = lib.platforms.all; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/networkmanager/fix-install-paths.patch b/nixpkgs/pkgs/tools/networking/networkmanager/fix-install-paths.patch new file mode 100644 index 000000000000..4e80247cf144 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/networkmanager/fix-install-paths.patch @@ -0,0 +1,16 @@ +diff --git a/meson.build b/meson.build +index a2d925a7e..5a65cd2fe 100644 +--- a/meson.build ++++ b/meson.build +@@ -959,9 +959,9 @@ meson.add_install_script( + join_paths('tools', 'meson-post-install.sh'), + nm_datadir, + nm_bindir, +- nm_pkgconfdir, ++ nm_prefix + nm_pkgconfdir, + nm_pkglibdir, +- nm_pkgstatedir, ++ nm_prefix + nm_pkgstatedir, + nm_mandir, + nm_sysconfdir, + enable_docs ? '1' : '0', diff --git a/nixpkgs/pkgs/tools/networking/networkmanager/fix-paths.patch b/nixpkgs/pkgs/tools/networking/networkmanager/fix-paths.patch new file mode 100644 index 000000000000..cb9d3c3a0d20 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/networkmanager/fix-paths.patch @@ -0,0 +1,92 @@ +diff --git a/clients/common/nm-vpn-helpers.c b/clients/common/nm-vpn-helpers.c +index 15c47c3ec..4d1913aa6 100644 +--- a/clients/common/nm-vpn-helpers.c ++++ b/clients/common/nm-vpn-helpers.c +@@ -208,15 +208,7 @@ nm_vpn_openconnect_authenticate_helper(const char *host, + NULL, + }; + +- path = nm_utils_file_search_in_paths("openconnect", +- "/usr/sbin/openconnect", +- DEFAULT_PATHS, +- G_FILE_TEST_IS_EXECUTABLE, +- NULL, +- NULL, +- error); +- if (!path) +- return FALSE; ++ path = "@openconnect@/bin/openconnect"; + + if (!g_spawn_sync(NULL, + (char **) NM_MAKE_STRV(path, "--authenticate", host), +diff --git a/data/84-nm-drivers.rules b/data/84-nm-drivers.rules +index e398cb9f2..a43d61864 100644 +--- a/data/84-nm-drivers.rules ++++ b/data/84-nm-drivers.rules +@@ -7,6 +7,6 @@ ACTION!="add|change", GOTO="nm_drivers_end" + # Determine ID_NET_DRIVER if there's no ID_NET_DRIVER or DRIVERS (old udev?) + ENV{ID_NET_DRIVER}=="?*", GOTO="nm_drivers_end" + DRIVERS=="?*", GOTO="nm_drivers_end" +-PROGRAM="/bin/sh -c '/usr/sbin/ethtool -i $$1 |/usr/bin/sed -n s/^driver:\ //p' -- $env{INTERFACE}", ENV{ID_NET_DRIVER}="%c" ++PROGRAM="@runtimeShell@ -c '@ethtool@/bin/ethtool -i $$1 |@gnused@/bin/sed -n s/^driver:\ //p' -- $env{INTERFACE}", ENV{ID_NET_DRIVER}="%c" + + LABEL="nm_drivers_end" +diff --git a/data/NetworkManager.service.in b/data/NetworkManager.service.in +index 91ebd9a36..5201a56c3 100644 +--- a/data/NetworkManager.service.in ++++ b/data/NetworkManager.service.in +@@ -8,7 +8,7 @@ Before=network.target @DISTRO_NETWORK_SERVICE@ + [Service] + Type=dbus + BusName=org.freedesktop.NetworkManager +-ExecReload=/usr/bin/busctl call org.freedesktop.NetworkManager /org/freedesktop/NetworkManager org.freedesktop.NetworkManager Reload u 0 ++ExecReload=@systemd@/bin/busctl call org.freedesktop.NetworkManager /org/freedesktop/NetworkManager org.freedesktop.NetworkManager Reload u 0 + #ExecReload=/bin/kill -HUP $MAINPID + ExecStart=@sbindir@/NetworkManager --no-daemon + Restart=on-failure +diff --git a/libnm/meson.build b/libnm/meson.build +index d0846419c..a7adb2cc6 100644 +--- a/libnm/meson.build ++++ b/libnm/meson.build +@@ -280,7 +280,6 @@ if enable_introspection + output: 'nm-settings-docs-gir.xml', + command: [ + generate_setting_docs_env, +- python.path(), + join_paths(meson.source_root(), 'tools', 'generate-docs-nm-settings-docs-gir.py'), + '--lib-path', meson.current_build_dir(), + '--gir', '@INPUT@', +diff --git a/src/core/devices/nm-device.c b/src/core/devices/nm-device.c +index 040dd0b4d..98aea3aa9 100644 +--- a/src/core/devices/nm-device.c ++++ b/src/core/devices/nm-device.c +@@ -13957,14 +13957,14 @@ nm_device_start_ip_check(NMDevice *self) + gw = nm_ip4_config_best_default_route_get(priv->ip_config_4); + if (gw) { + _nm_utils_inet4_ntop(NMP_OBJECT_CAST_IP4_ROUTE(gw)->gateway, buf); +- ping_binary = nm_utils_find_helper("ping", "/usr/bin/ping", NULL); ++ ping_binary = "@iputils@/bin/ping"; + log_domain = LOGD_IP4; + } + } else if (priv->ip_config_6 && priv->ip_state_6 == NM_DEVICE_IP_STATE_DONE) { + gw = nm_ip6_config_best_default_route_get(priv->ip_config_6); + if (gw) { + _nm_utils_inet6_ntop(&NMP_OBJECT_CAST_IP6_ROUTE(gw)->gateway, buf); +- ping_binary = nm_utils_find_helper("ping6", "/usr/bin/ping6", NULL); ++ ping_binary = "@iputils@/bin/ping"; + log_domain = LOGD_IP6; + } + } +diff --git a/src/core/nm-core-utils.c b/src/core/nm-core-utils.c +index 9075c30dd..4b140e92b 100644 +--- a/src/core/nm-core-utils.c ++++ b/src/core/nm-core-utils.c +@@ -333,7 +333,7 @@ nm_utils_modprobe(GError **error, gboolean suppress_error_logging, const char *a + + /* construct the argument list */ + argv = g_ptr_array_sized_new(4); +- g_ptr_array_add(argv, "/sbin/modprobe"); ++ g_ptr_array_add(argv, "@kmod@/bin/modprobe"); + g_ptr_array_add(argv, "--use-blacklist"); + g_ptr_array_add(argv, (char *) arg1); + diff --git a/nixpkgs/pkgs/tools/networking/networkmanager/fortisslvpn/default.nix b/nixpkgs/pkgs/tools/networking/networkmanager/fortisslvpn/default.nix new file mode 100644 index 000000000000..f97bac13cf7f --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/networkmanager/fortisslvpn/default.nix @@ -0,0 +1,84 @@ +{ lib, stdenv +, fetchurl +, substituteAll +, openfortivpn +, gettext +, pkg-config +, file +, glib +, gtk3 +, networkmanager +, ppp +, libsecret +, withGnome ? true +, gnome +, fetchpatch +, libnma +}: + +stdenv.mkDerivation rec { + pname = "NetworkManager-fortisslvpn"; + version = "1.2.10"; + name = "${pname}${if withGnome then "-gnome" else ""}-${version}"; + + src = fetchurl { + url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz"; + sha256 = "1sw66cxgs4in4cjp1cm95c5ijsk8xbbmq4ykg2jwqwgz6cf2lr3s"; + }; + + patches = [ + (substituteAll { + src = ./fix-paths.patch; + inherit openfortivpn; + }) + + # Don't use etc/dbus-1/system.d + (fetchpatch { + url = "https://gitlab.gnome.org/GNOME/NetworkManager-fortisslvpn/merge_requests/11.patch"; + sha256 = "0l7l2r1njh62lh2pf497ibf99sgkvjsj58xr76qx3jxgq9zfw6n9"; + }) + ]; + + nativeBuildInputs = [ + gettext + pkg-config + file + ]; + + buildInputs = [ + openfortivpn + networkmanager + ppp + glib + ] ++ lib.optionals withGnome [ + gtk3 + libsecret + libnma + ]; + + configureFlags = [ + "--with-gnome=${if withGnome then "yes" else "no"}" + "--localstatedir=/var" + "--enable-absolute-paths" + ]; + + installFlags = [ + # the installer only creates an empty directory in localstatedir, so + # we can drop it + "localstatedir=." + ]; + + passthru = { + updateScript = gnome.updateScript { + packageName = pname; + attrPath = "networkmanager-fortisslvpn"; + versionPolicy = "odd-unstable"; + }; + }; + + meta = with lib; { + description = "NetworkManager’s FortiSSL plugin"; + inherit (networkmanager.meta) maintainers platforms; + license = licenses.gpl2; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/networkmanager/fortisslvpn/fix-paths.patch b/nixpkgs/pkgs/tools/networking/networkmanager/fortisslvpn/fix-paths.patch new file mode 100644 index 000000000000..a1241b6738c2 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/networkmanager/fortisslvpn/fix-paths.patch @@ -0,0 +1,11 @@ +--- a/src/nm-fortisslvpn-service.c ++++ b/src/nm-fortisslvpn-service.c +@@ -387,7 +387,7 @@ + { + static const char *openfortivpn_binary_paths[] = + { +- "/bin/openfortivpn", ++ "@openfortivpn@/bin/openfortivpn", + "/usr/bin/openfortivpn", + "/usr/local/bin/openfortivpn", + NULL diff --git a/nixpkgs/pkgs/tools/networking/networkmanager/iodine/default.nix b/nixpkgs/pkgs/tools/networking/networkmanager/iodine/default.nix new file mode 100644 index 000000000000..e56d9411b393 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/networkmanager/iodine/default.nix @@ -0,0 +1,58 @@ +{ lib, stdenv, fetchFromGitLab, substituteAll, autoreconfHook, iodine, intltool, pkg-config, networkmanager, libsecret, gtk3 +, withGnome ? true, gnome, fetchpatch, libnma, glib }: + +let + pname = "NetworkManager-iodine"; + version = "unstable-2019-11-05"; +in stdenv.mkDerivation { + name = "${pname}${if withGnome then "-gnome" else ""}-${version}"; + + src = fetchFromGitLab { + domain = "gitlab.gnome.org"; + owner = "GNOME"; + repo = "network-manager-iodine"; + rev = "2ef0abf089b00a0546f214dde0d45e63f2990b79"; + sha256 = "1ps26fr9b1yyafj7lrzf2kmaxb0ipl0mhagch5kzrjdsc5xkajz7"; + }; + + patches = [ + (substituteAll { + src = ./fix-paths.patch; + inherit iodine; + }) + # Don't use etc/dbus-1/system.d + (fetchpatch { + url = "https://gitlab.gnome.org/GNOME/network-manager-iodine/merge_requests/2.patch"; + sha256 = "108pkf0mddj32s46k7jkmpwcaq2ylci4dqpp7wck3zm9q2jffff2"; + }) + ]; + + buildInputs = [ iodine networkmanager glib ] + ++ lib.optionals withGnome [ gtk3 libsecret libnma ]; + + nativeBuildInputs = [ intltool autoreconfHook pkg-config ]; + + # glib-2.62 deprecations + NIX_CFLAGS_COMPILE = "-DGLIB_DISABLE_DEPRECATION_WARNINGS"; + + preConfigure = "intltoolize"; + configureFlags = [ + "--without-libnm-glib" + "--with-gnome=${if withGnome then "yes" else "no"}" + "--localstatedir=/" # needed for the management socket under /run/NetworkManager + "--enable-absolute-paths" + ]; + + passthru = { + updateScript = gnome.updateScript { + packageName = pname; + attrPath = "networkmanager-iodine"; + }; + }; + + meta = with lib; { + description = "NetworkManager's iodine plugin"; + inherit (networkmanager.meta) maintainers platforms; + license = licenses.gpl2Plus; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/networkmanager/iodine/fix-paths.patch b/nixpkgs/pkgs/tools/networking/networkmanager/iodine/fix-paths.patch new file mode 100644 index 000000000000..d32dbfadbafa --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/networkmanager/iodine/fix-paths.patch @@ -0,0 +1,11 @@ +--- a/src/nm-iodine-service.c ++++ b/src/nm-iodine-service.c +@@ -62,7 +62,7 @@ + + static const char *iodine_binary_paths[] = + { +- "/usr/bin/iodine", ++ "@iodine@/bin/iodine", + "/usr/sbin/iodine", + "/usr/local/bin/iodine", + "/usr/local/sbin/iodine", diff --git a/nixpkgs/pkgs/tools/networking/networkmanager/l2tp/default.nix b/nixpkgs/pkgs/tools/networking/networkmanager/l2tp/default.nix new file mode 100644 index 000000000000..bfcc2d8ae86e --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/networkmanager/l2tp/default.nix @@ -0,0 +1,51 @@ +{ lib, stdenv, substituteAll, fetchFromGitHub, autoreconfHook, libtool, intltool, pkg-config +, file, findutils +, gtk3, networkmanager, ppp, xl2tpd, strongswan, libsecret +, withGnome ? true, libnma }: + +stdenv.mkDerivation rec { + name = "${pname}${if withGnome then "-gnome" else ""}-${version}"; + pname = "NetworkManager-l2tp"; + version = "1.2.12"; + + src = fetchFromGitHub { + owner = "nm-l2tp"; + repo = "network-manager-l2tp"; + rev = version; + sha256 = "0cq07kvlm98s8a7l4a3zmqnif8x3307kv7n645zx3f1r7x72b8m4"; + }; + + patches = [ + (substituteAll { + src = ./fix-paths.patch; + inherit strongswan xl2tpd; + }) + ]; + + buildInputs = [ networkmanager ppp ] + ++ lib.optionals withGnome [ gtk3 libsecret libnma ]; + + nativeBuildInputs = [ autoreconfHook libtool intltool pkg-config file findutils ]; + + preConfigure = '' + intltoolize -f + ''; + + configureFlags = [ + "--without-libnm-glib" + "--with-gnome=${if withGnome then "yes" else "no"}" + "--localstatedir=/var" + "--sysconfdir=$(out)/etc" + "--enable-absolute-paths" + ]; + + enableParallelBuilding = true; + + meta = with lib; { + description = "L2TP plugin for NetworkManager"; + inherit (networkmanager.meta) platforms; + homepage = "https://github.com/nm-l2tp/network-manager-l2tp"; + license = licenses.gpl2; + maintainers = with maintainers; [ abbradar obadz ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/networkmanager/l2tp/fix-paths.patch b/nixpkgs/pkgs/tools/networking/networkmanager/l2tp/fix-paths.patch new file mode 100644 index 000000000000..531672c39362 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/networkmanager/l2tp/fix-paths.patch @@ -0,0 +1,22 @@ +diff --git a/shared/utils.c b/shared/utils.c +index c978a1f..d2c36cd 100644 +--- a/shared/utils.c ++++ b/shared/utils.c +@@ -52,7 +52,7 @@ nm_find_ipsec (void) + { + static const char *ipsec_binary_paths[] = + { +- "/sbin/ipsec", ++ "@strongswan@/bin/ipsec", + "/usr/sbin/ipsec", + "/usr/local/sbin/ipsec", + "/sbin/strongswan", +@@ -77,7 +77,7 @@ nm_find_l2tpd (void) + { + static const char *l2tp_binary_paths[] = + { +- "/sbin/xl2tpd", ++ "@xl2tpd@/bin/xl2tpd", + "/usr/sbin/xl2tpd", + "/usr/local/sbin/xl2tpd", + NULL diff --git a/nixpkgs/pkgs/tools/networking/networkmanager/libnma/default.nix b/nixpkgs/pkgs/tools/networking/networkmanager/libnma/default.nix new file mode 100644 index 000000000000..50fc66a8d68b --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/networkmanager/libnma/default.nix @@ -0,0 +1,91 @@ +{ stdenv +, fetchurl +, meson +, ninja +, gettext +, gtk-doc +, pkg-config +, vala +, networkmanager +, gnome +, isocodes +, libxml2 +, docbook_xsl +, docbook_xml_dtd_43 +, mobile-broadband-provider-info +, gobject-introspection +, gtk3 +, withGnome ? true +, gcr +, glib +, substituteAll +, lib +}: + +stdenv.mkDerivation rec { + pname = "libnma"; + version = "1.8.30"; + + outputs = [ "out" "dev" "devdoc" ]; + + src = fetchurl { + url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz"; + sha256 = "1d5gzn7ss5vi0bhc8s4i5gsrck1ajslajam5jxfqazg094mffcys"; + }; + + patches = [ + # Needed for wingpanel-indicator-network and switchboard-plug-network + ./hardcode-gsettings.patch + ]; + + nativeBuildInputs = [ + meson + ninja + gettext + pkg-config + gobject-introspection + gtk-doc + docbook_xsl + docbook_xml_dtd_43 + libxml2 + vala + ]; + + buildInputs = [ + gtk3 + networkmanager + isocodes + mobile-broadband-provider-info + ] ++ lib.optionals withGnome [ + # advanced certificate chooser + gcr + ]; + + mesonFlags = [ + "-Dgcr=${lib.boolToString withGnome}" + ]; + + postPatch = '' + substituteInPlace src/nma-ws/nma-eap.c --subst-var-by \ + NM_APPLET_GSETTINGS ${glib.makeSchemaPath "$out" "${pname}-${version}"} + ''; + + postInstall = '' + glib-compile-schemas $out/share/glib-2.0/schemas + ''; + + passthru = { + updateScript = gnome.updateScript { + packageName = pname; + versionPolicy = "odd-unstable"; + }; + }; + + meta = with lib; { + homepage = "https://gitlab.gnome.org/GNOME/libnma"; + description = "NetworkManager UI utilities (libnm version)"; + license = licenses.gpl2Plus; # Mix of GPL and LPGL 2+ + maintainers = teams.gnome.members; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/networkmanager/libnma/hardcode-gsettings.patch b/nixpkgs/pkgs/tools/networking/networkmanager/libnma/hardcode-gsettings.patch new file mode 100644 index 000000000000..9b2f5366950c --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/networkmanager/libnma/hardcode-gsettings.patch @@ -0,0 +1,26 @@ +--- a/src/nma-ws/nma-eap.c ++++ b/src/nma-ws/nma-eap.c +@@ -248,11 +248,16 @@ nma_eap_ca_cert_ignore_get (NMAEap *method, NMConnection *connection) + static GSettings * + _get_ca_ignore_settings (NMConnection *connection) + { ++ g_autoptr (GSettingsSchemaSource) *schema_source; ++ g_autoptr (GSettingsSchema) *schema; + GSettings *settings; + char *path = NULL; + const char *uuid; + + g_return_val_if_fail (connection, NULL); + ++ schema_source = g_settings_schema_source_new_from_directory ("@NM_APPLET_GSETTINGS@", g_settings_schema_source_get_default (), TRUE, NULL); ++ schema = g_settings_schema_source_lookup (schema_source, "org.gnome.nm-applet.eap", FALSE); ++ + uuid = nm_connection_get_uuid (connection); + g_return_val_if_fail (uuid && *uuid, NULL); + + path = g_strdup_printf ("/org/gnome/nm-applet/eap/%s/", uuid); +- settings = g_settings_new_with_path ("org.gnome.nm-applet.eap", path); ++ settings = g_settings_new_full (schema, NULL, path); + g_free (path); + + return settings; diff --git a/nixpkgs/pkgs/tools/networking/networkmanager/openconnect/default.nix b/nixpkgs/pkgs/tools/networking/networkmanager/openconnect/default.nix new file mode 100644 index 000000000000..c03a698514a8 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/networkmanager/openconnect/default.nix @@ -0,0 +1,81 @@ +{ lib, stdenv +, fetchurl +, substituteAll +, glib +, libxml2 +, openconnect +, intltool +, pkg-config +, autoreconfHook +, networkmanager +, gcr +, libsecret +, file +, gtk3 +, withGnome ? true +, gnome +, kmod +, fetchpatch +}: + +let + pname = "NetworkManager-openconnect"; + version = "1.2.6"; +in stdenv.mkDerivation { + name = "${pname}${if withGnome then "-gnome" else ""}-${version}"; + + src = fetchurl { + url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz"; + sha256 = "0nlp290nkawc4wqm978n4vhzg3xdqi8kpjjx19l855vab41rh44m"; + }; + + patches = [ + (substituteAll { + src = ./fix-paths.patch; + inherit kmod openconnect; + }) + + # Don't use etc/dbus-1/system.d + (fetchpatch { + url = "https://gitlab.gnome.org/GNOME/NetworkManager-openconnect/merge_requests/9.patch"; + sha256 = "0yd2dmq6gq6y4czr7dqdgaiqvw2vyv2gikznpfdxyfn2v1pcrk9m"; + }) + ]; + + buildInputs = [ + glib + libxml2 + openconnect + networkmanager + ] ++ lib.optionals withGnome [ + gtk3 + gcr + libsecret + ]; + + nativeBuildInputs = [ + intltool + pkg-config + file + ]; + + configureFlags = [ + "--with-gnome=${if withGnome then "yes" else "no"}" + "--enable-absolute-paths" + "--without-libnm-glib" + ]; + + passthru = { + updateScript = gnome.updateScript { + packageName = pname; + attrPath = "networkmanager-openconnect"; + versionPolicy = "odd-unstable"; + }; + }; + + meta = with lib; { + description = "NetworkManager’s OpenConnect plugin"; + inherit (networkmanager.meta) maintainers platforms; + license = licenses.gpl2Plus; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/networkmanager/openconnect/fix-paths.patch b/nixpkgs/pkgs/tools/networking/networkmanager/openconnect/fix-paths.patch new file mode 100644 index 000000000000..9b342f5bd08b --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/networkmanager/openconnect/fix-paths.patch @@ -0,0 +1,20 @@ +--- a/src/nm-openconnect-service.c ++++ b/src/nm-openconnect-service.c +@@ -60,7 +60,7 @@ + + static const char *openconnect_binary_paths[] = + { +- "/usr/bin/openconnect", ++ "@openconnect@/bin/openconnect", + "/usr/sbin/openconnect", + "/usr/local/bin/openconnect", + "/usr/local/sbin/openconnect", +@@ -734,7 +734,7 @@ + + _LOGD ("nm-openconnect-service (version " DIST_VERSION ") starting..."); + +- if (system ("/sbin/modprobe tun") == -1) ++ if (system ("@kmod@/bin/modprobe tun") == -1) + exit (EXIT_FAILURE); + + if (bus_name) diff --git a/nixpkgs/pkgs/tools/networking/networkmanager/openvpn/default.nix b/nixpkgs/pkgs/tools/networking/networkmanager/openvpn/default.nix new file mode 100644 index 000000000000..06df79e47052 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/networkmanager/openvpn/default.nix @@ -0,0 +1,46 @@ +{ lib, stdenv, fetchurl, substituteAll, openvpn, intltool, libxml2, pkg-config, file, networkmanager, libsecret +, gtk3, withGnome ? true, gnome, kmod, libnma }: + +let + pname = "NetworkManager-openvpn"; + version = "1.8.12"; +in stdenv.mkDerivation { + name = "${pname}${if withGnome then "-gnome" else ""}-${version}"; + + src = fetchurl { + url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz"; + sha256 = "062kh4zj7jfbwy4zzcwpq2m457bzbpm3l18s0ysnw3mgia3siz8f"; + }; + + patches = [ + (substituteAll { + src = ./fix-paths.patch; + inherit kmod openvpn; + }) + ]; + + buildInputs = [ openvpn networkmanager ] + ++ lib.optionals withGnome [ gtk3 libsecret libnma ]; + + nativeBuildInputs = [ intltool pkg-config file libxml2 ]; + + configureFlags = [ + "--with-gnome=${if withGnome then "yes" else "no"}" + "--localstatedir=/" # needed for the management socket under /run/NetworkManager + "--enable-absolute-paths" + ]; + + passthru = { + updateScript = gnome.updateScript { + packageName = pname; + attrPath = "networkmanager-openvpn"; + versionPolicy = "odd-unstable"; + }; + }; + + meta = with lib; { + description = "NetworkManager's OpenVPN plugin"; + inherit (networkmanager.meta) maintainers platforms; + license = licenses.gpl2Plus; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/networkmanager/openvpn/fix-paths.patch b/nixpkgs/pkgs/tools/networking/networkmanager/openvpn/fix-paths.patch new file mode 100644 index 000000000000..b735da28dca1 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/networkmanager/openvpn/fix-paths.patch @@ -0,0 +1,34 @@ +--- a/properties/nm-openvpn-editor.c ++++ b/properties/nm-openvpn-editor.c +@@ -775,8 +775,7 @@ + nm_find_openvpn (void) + { + static const char *openvpn_binary_paths[] = { +- "/usr/sbin/openvpn", +- "/sbin/openvpn", ++ "@openvpn@/bin/openvpn", + NULL + }; + const char **openvpn_binary = openvpn_binary_paths; +--- a/src/nm-openvpn-service.c ++++ b/src/nm-openvpn-service.c +@@ -522,9 +522,7 @@ + openvpn_binary_find_exepath (void) + { + static const char *paths[] = { +- "/usr/sbin/openvpn", +- "/sbin/openvpn", +- "/usr/local/sbin/openvpn", ++ "@openvpn@/bin/openvpn", + }; + int i; + +@@ -2326,7 +2324,7 @@ + _LOGD ("nm-openvpn-service (version " DIST_VERSION ") starting..."); + + if ( !g_file_test ("/sys/class/misc/tun", G_FILE_TEST_EXISTS) +- && (system ("/sbin/modprobe tun") == -1)) ++ && (system ("@kmod@/bin/modprobe tun") == -1)) + return EXIT_FAILURE; + + plugin = nm_openvpn_plugin_new (bus_name); diff --git a/nixpkgs/pkgs/tools/networking/networkmanager/sstp/default.nix b/nixpkgs/pkgs/tools/networking/networkmanager/sstp/default.nix new file mode 100644 index 000000000000..f48662344380 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/networkmanager/sstp/default.nix @@ -0,0 +1,64 @@ +{ lib, stdenv +, autoreconfHook +, fetchFromGitHub +, fetchpatch +, file +, glib +, gnome +, gtk3 +, intltool +, libnma +, libsecret +, networkmanager +, pkg-config +, ppp +, sstp +, substituteAll +, withGnome ? true }: + +let + pname = "NetworkManager-sstp"; + version = "unstable-2020-04-20"; +in stdenv.mkDerivation { + name = "${pname}${if withGnome then "-gnome" else ""}-${version}"; + + src = fetchFromGitHub { + owner = "enaess"; + repo = "network-manager-sstp"; + rev = "735d8ca078f933e085029f60a737e3cf1d8c29a8"; + sha256 = "0aahfhy2ch951kzj6gnd8p8hv2s5yd5y10wrmj68djhnx2ml8cd3"; + }; + + buildInputs = [ sstp networkmanager glib ppp ] + ++ lib.optionals withGnome [ gtk3 libsecret libnma ]; + + nativeBuildInputs = [ file intltool autoreconfHook pkg-config ]; + + postPatch = '' + sed -i 's#/sbin/pppd#${ppp}/bin/pppd#' src/nm-sstp-service.c + sed -i 's#/sbin/sstpc#${sstp}/bin/sstpc#' src/nm-sstp-service.c + ''; + + # glib-2.62 deprecations + NIX_CFLAGS_COMPILE = "-DGLIB_DISABLE_DEPRECATION_WARNINGS"; + + preConfigure = "intltoolize"; + configureFlags = [ + "--without-libnm-glib" + "--with-gnome=${if withGnome then "yes" else "no"}" + "--enable-absolute-paths" + ]; + + passthru = { + updateScript = gnome.updateScript { + packageName = pname; + attrPath = "networkmanager-sstp"; + }; + }; + + meta = with lib; { + description = "NetworkManager's sstp plugin"; + inherit (networkmanager.meta) maintainers platforms; + license = licenses.gpl2Plus; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/networkmanager/strongswan/default.nix b/nixpkgs/pkgs/tools/networking/networkmanager/strongswan/default.nix new file mode 100644 index 000000000000..cebcec35a314 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/networkmanager/strongswan/default.nix @@ -0,0 +1,34 @@ +{ lib, stdenv, fetchurl, intltool, pkg-config, networkmanager, strongswanNM +, gtk3, gnome, libsecret, libnma }: + +stdenv.mkDerivation rec { + pname = "NetworkManager-strongswan"; + version = "1.5.2"; + + src = fetchurl { + url = "https://download.strongswan.org/NetworkManager/${pname}-${version}.tar.bz2"; + sha256 = "0sc1yzlxjfvl58hjjw99bchqc4061i3apw254z61v22k4sajnif8"; + }; + + buildInputs = [ networkmanager strongswanNM libsecret gtk3 libnma ]; + + nativeBuildInputs = [ intltool pkg-config ]; + + # glib-2.62 deprecations + NIX_CFLAGS_COMPILE = "-DGLIB_DISABLE_DEPRECATION_WARNINGS"; + + configureFlags = [ + "--without-libnm-glib" + "--with-charon=${strongswanNM}/libexec/ipsec/charon-nm" + "--with-nm-libexecdir=$(out)/libexec" + "--with-nm-plugindir=$(out)/lib/NetworkManager" + ]; + + PKG_CONFIG_LIBNM_VPNSERVICEDIR = "$(out)/lib/NetworkManager/VPN"; + + meta = with lib; { + description = "NetworkManager's strongswan plugin"; + inherit (networkmanager.meta) platforms; + license = licenses.gpl2Plus; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/networkmanager/tray.nix b/nixpkgs/pkgs/tools/networking/networkmanager/tray.nix new file mode 100644 index 000000000000..e8ce8ad342fd --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/networkmanager/tray.nix @@ -0,0 +1,31 @@ +{ lib, mkDerivation, fetchFromGitHub, cmake, qttools, qtbase, networkmanager-qt, modemmanager-qt }: + +mkDerivation rec { + pname = "nm-tray"; + version = "0.4.3"; + + src = fetchFromGitHub { + owner = "palinek"; + repo = pname; + rev = version; + sha256 = "08c86kd613wlvw9571q7a3lb7g6skyyasjw6h1g543rbl4jn2c2v"; + }; + + postPatch = '' + sed -i -e '1i#include <QMetaEnum>' src/nmmodel.cpp + ''; + + nativeBuildInputs = [ cmake qttools ]; + + cmakeFlags = [ "-DWITH_MODEMMANAGER_SUPPORT=ON" ]; + + buildInputs = [ qtbase networkmanager-qt modemmanager-qt ]; + + meta = with lib; { + description = "Simple Network Manager frontend written in Qt"; + homepage = "https://github.com/palinek/nm-tray"; + license = licenses.gpl2Plus; + maintainers = with maintainers; [ dtzWill ]; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/networkmanager/vpnc/default.nix b/nixpkgs/pkgs/tools/networking/networkmanager/vpnc/default.nix new file mode 100644 index 000000000000..70e7104696ee --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/networkmanager/vpnc/default.nix @@ -0,0 +1,50 @@ +{ lib, stdenv, fetchurl, substituteAll, vpnc, intltool, pkg-config, networkmanager, libsecret +, gtk3, withGnome ? true, gnome, glib, kmod, file, fetchpatch, libnma }: +let + pname = "NetworkManager-vpnc"; + version = "1.2.6"; +in stdenv.mkDerivation { + name = "${pname}${if withGnome then "-gnome" else ""}-${version}"; + + src = fetchurl { + url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz"; + sha256 = "1js5lwcsqws4klgypfxl4ikmakv7v7xgddij1fj6b0y0qicx0kyy"; + }; + + patches = [ + (substituteAll { + src = ./fix-paths.patch; + inherit vpnc kmod; + }) + # Don't use etc/dbus-1/system.d + (fetchpatch { + url = "https://gitlab.gnome.org/GNOME/NetworkManager-vpnc/merge_requests/5.patch"; + sha256 = "0z0x5vqmrsap3ynamhya7gh6c6k5grhj2vqpy76alnv9xns8dzi6"; + }) + ]; + + buildInputs = [ vpnc networkmanager glib ] + ++ lib.optionals withGnome [ gtk3 libsecret libnma ]; + + nativeBuildInputs = [ intltool pkg-config file ]; + + configureFlags = [ + "--without-libnm-glib" + "--with-gnome=${if withGnome then "yes" else "no"}" + "--enable-absolute-paths" + ]; + + passthru = { + updateScript = gnome.updateScript { + packageName = pname; + attrPath = "networkmanager-vpnc"; + versionPolicy = "odd-unstable"; + }; + }; + + meta = with lib; { + description = "NetworkManager's VPNC plugin"; + inherit (networkmanager.meta) maintainers platforms; + license = licenses.gpl2Plus; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/networkmanager/vpnc/fix-paths.patch b/nixpkgs/pkgs/tools/networking/networkmanager/vpnc/fix-paths.patch new file mode 100644 index 000000000000..98238ac01f76 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/networkmanager/vpnc/fix-paths.patch @@ -0,0 +1,31 @@ +--- a/properties/nm-vpnc-editor-plugin.c ++++ b/properties/nm-vpnc-editor-plugin.c +@@ -161,7 +161,7 @@ + GError *error = NULL; + + const char *decrypt_possible_paths[] = { +- "/usr/lib/vpnc/cisco-decrypt", ++ "@vpnc@/bin/cisco-decrypt", + "/usr/bin/cisco-decrypt", + NULL + }; +--- a/src/nm-vpnc-service.c ++++ b/src/nm-vpnc-service.c +@@ -610,7 +610,7 @@ + find_vpnc (void) + { + static const char *vpnc_paths[] = { +- "/usr/sbin/vpnc", ++ "@vpnc@/bin/vpnc", + "/sbin/vpnc", + "/usr/local/sbin/vpnc", + NULL +@@ -1308,7 +1308,7 @@ + _LOGD (" vpnc interactive mode is %s", interactive_available ? "enabled" : "disabled"); + _LOGD (" uses%s --bus-name \"%s\"", bus_name_free ? "" : " default", bus_name); + +- if (system ("/sbin/modprobe tun") == -1) ++ if (system ("@kmod@/bin/modprobe tun") == -1) + exit (EXIT_FAILURE); + + plugin = nm_vpnc_plugin_new (bus_name); diff --git a/nixpkgs/pkgs/tools/networking/nfdump/default.nix b/nixpkgs/pkgs/tools/networking/nfdump/default.nix new file mode 100644 index 000000000000..1319e7997dde --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/nfdump/default.nix @@ -0,0 +1,44 @@ +{ lib, stdenv, fetchFromGitHub +, autoconf, automake, libtool, pkg-config +, bzip2, libpcap, flex, bison }: + +let version = "1.6.22"; in + +stdenv.mkDerivation { + pname = "nfdump"; + inherit version; + + src = fetchFromGitHub { + owner = "phaag"; + repo = "nfdump"; + rev = "v${version}"; + sha256 = "14x2k85ard1kp99hhd90zsmvyw24g03m84rn13gb4grm9gjggzrj"; + }; + + nativeBuildInputs = [ autoconf automake flex libtool pkg-config bison ]; + buildInputs = [ bzip2 libpcap ]; + + preConfigure = '' + # The script defaults to glibtoolize on darwin, so we pass the correct + # name explicitly. + LIBTOOLIZE=libtoolize ./autogen.sh + ''; + + configureFlags = [ + "--enable-nsel" + "--enable-sflow" + "--enable-readpcap" + "--enable-nfpcapd" + ]; + + meta = with lib; { + description = "Tools for working with netflow data"; + longDescription = '' + nfdump is a set of tools for working with netflow data. + ''; + homepage = "https://github.com/phaag/nfdump"; + license = licenses.bsd3; + maintainers = [ maintainers.takikawa ]; + platforms = platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/nfstrace/default.nix b/nixpkgs/pkgs/tools/networking/nfstrace/default.nix new file mode 100644 index 000000000000..ca75e50fa527 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/nfstrace/default.nix @@ -0,0 +1,49 @@ +{ cmake, fetchFromGitHub, fetchpatch, json_c, libpcap, ncurses, lib, stdenv, libtirpc }: + +stdenv.mkDerivation rec { + pname = "nfstrace"; + version = "0.4.3.2"; + + src = fetchFromGitHub { + owner = "epam"; + repo = "nfstrace"; + rev = version; + sha256 = "1djsyn7i3xp969rnmsdaf5vwjiik9wylxxrc5nm7by00i76c1vsg"; + }; + + patches = [ + (fetchpatch { + url = "https://salsa.debian.org/debian/nfstrace/raw/debian/0.4.3.1-3/debian/patches/reproducible_build.patch"; + sha256 = "0fd96r8xi142kjwibqkd46s6jwsg5kfc5v28bqsj9rdlc2aqmay5"; + }) + # Fixes build failure with gcc-10 + # Related PR https://github.com/epam/nfstrace/pull/42/commits/4562a895ed3ac0e811bdd489068ad3ebe4d7b501 + (fetchpatch { + url = "https://github.com/epam/nfstrace/commit/4562a895ed3ac0e811bdd489068ad3ebe4d7b501.patch"; + sha256 = "1fbicbllyykjknik7asa81x0ixxmbwqwkiz74cnznagv10jlkj3p"; + }) + ]; + + postPatch = '' + substituteInPlace CMakeLists.txt \ + --replace "-Wno-braced-scalar-init" "" + ''; + + buildInputs = [ json_c libpcap ncurses libtirpc ]; + nativeBuildInputs = [ cmake ]; + + # To build with GCC 8+ it needs: + CXXFLAGS = "-Wno-class-memaccess -Wno-ignored-qualifiers"; + # CMake can't find json_c without: + NIX_CFLAGS_COMPILE = [ "-I${json_c.dev}/include/json-c" "-Wno-error=address-of-packed-member" "-I${libtirpc.dev}/include/tirpc" ]; + NIX_LDFLAGS = [ "-ltirpc" ]; + + doCheck = false; # requires network access + + meta = with lib; { + homepage = "http://epam.github.io/nfstrace/"; + description = "NFS and CIFS tracing/monitoring/capturing/analyzing tool"; + license = licenses.gpl2; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/ngrep/default.nix b/nixpkgs/pkgs/tools/networking/ngrep/default.nix new file mode 100644 index 000000000000..1e57ac75843e --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/ngrep/default.nix @@ -0,0 +1,54 @@ +{ lib, stdenv, fetchFromGitHub, fetchpatch, autoreconfHook, libpcap, pcre }: + +stdenv.mkDerivation rec { + pname = "ngrep"; + version = "1.47"; + + src = fetchFromGitHub { + owner = "jpr5"; + repo = "ngrep"; + rev = "V${lib.replaceStrings ["."] ["_"] version}"; + sha256 = "1x2fyd7wdqlj1r76ilal06cl2wmbz0ws6i3ys204sbjh1cj6dcl7"; + }; + + patches = [ + (fetchpatch { + url = "https://patch-diff.githubusercontent.com/raw/jpr5/ngrep/pull/11.patch"; + sha256 = "0k5qzvj8j3r1409qwwvzp7m3clgs2g7hs4q68bhrqbrsvvb2h5dh"; + }) + ]; + + nativeBuildInputs = [ autoreconfHook ]; + buildInputs = [ libpcap pcre ]; + + configureFlags = [ + "--enable-ipv6" + "--enable-pcre" + "--disable-pcap-restart" + "--with-pcap-includes=${libpcap}/include" + ]; + + preConfigure = '' + sed -i "s|BPF=.*|BPF=${libpcap}/include/pcap/bpf.h|" configure + ''; + + meta = with lib; { + description = "Network packet analyzer"; + longDescription = '' + ngrep strives to provide most of GNU grep's common features, applying + them to the network layer. ngrep is a pcap-aware tool that will allow you + to specify extended regular or hexadecimal expressions to match against + data payloads of packets. It currently recognizes IPv4/6, TCP, UDP, + ICMPv4/6, IGMP and Raw across Ethernet, PPP, SLIP, FDDI, Token Ring and + null interfaces, and understands BPF filter logic in the same fashion as + more common packet sniffing tools, such as tcpdump and snoop. + ''; + homepage = "https://github.com/jpr5/ngrep/"; + # <ngrep>/doc/README.txt says that ngrep itself is licensed under a + # 'BSD-like' license but that the 'regex' library (in the ngrep tarball) is + # GPLv2. + license = "ngrep"; # Some custom BSD-style, see LICENSE.txt + platforms = platforms.linux; + maintainers = [ maintainers.bjornfor ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/ngrok-1/default.nix b/nixpkgs/pkgs/tools/networking/ngrok-1/default.nix new file mode 100644 index 000000000000..82f6ed4760cf --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/ngrok-1/default.nix @@ -0,0 +1,35 @@ +{ buildGoPackage, go-bindata, fetchFromGitHub }: + +buildGoPackage rec { + pname = "ngrok"; + version = "1.7.1"; + rev = version; + + goPackagePath = "ngrok"; + + src = fetchFromGitHub { + inherit rev; + owner = "inconshreveable"; + repo = "ngrok"; + sha256 = "1r4nc9knp0nxg4vglg7v7jbyd1nh1j2590l720ahll8a4fbsx5a4"; + }; + + goDeps = ./deps.nix; + + nativeBuildInputs = [ go-bindata ]; + + preConfigure = '' + sed -e '/jteeuwen\/go-bindata/d' \ + -e '/export GOPATH/d' \ + -e 's/go get/#go get/' \ + -e 's|bin/go-bindata|go-bindata|' -i Makefile + make assets BUILDTAGS=release + export sourceRoot=$sourceRoot/src/ngrok + ''; + + buildFlags = [ "-tags release" ]; + + meta = { + homepage = "https://ngrok.com/"; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/ngrok-1/deps.nix b/nixpkgs/pkgs/tools/networking/ngrok-1/deps.nix new file mode 100644 index 000000000000..1db3c3e65191 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/ngrok-1/deps.nix @@ -0,0 +1,101 @@ +[ + { + goPackagePath = "github.com/gorilla/websocket"; + fetch = { + type = "git"; + url = "https://github.com/gorilla/websocket"; + rev = "a622679ebd7a3b813862379232f645f8e690e43f"; + sha256 = "1nc9jbcmgya1i6dmf6sbcqsnxi9hbjg6dz1z0k7zmc6xdwlq0y4q"; + }; + } + { + goPackagePath = "github.com/rcrowley/go-metrics"; + fetch = { + type = "git"; + url = "https://github.com/rcrowley/go-metrics"; + rev = "1ce93efbc8f9c568886b2ef85ce305b2217b3de3"; + sha256 = "06gg72krlmd0z3zdq6s716blrga95pyj8dc2f2psfbknbkyrkfqa"; + }; + } + { + goPackagePath = "github.com/inconshreveable/go-vhost"; + fetch = { + type = "git"; + url = "https://github.com/inconshreveable/go-vhost"; + rev = "c4c28117502e4bf00960c8282b2d1c51c865fe2c"; + sha256 = "1rway6sls6fl2s2jk20ajj36rrlzh9944ncc9pdd19kifix54z32"; + }; + } + { + goPackagePath = "code.google.com/p/log4go"; + fetch = { + type = "git"; + url = "https://github.com/ccpaging/log4go"; + rev = "cb4cc51cd03958183d3b637d0750497d88c2f7a8"; + sha256 = "0l9f86zzhla9hq35q4xhgs837283qrm4gxbp5lrwwls54ifiq7k2"; + }; + } + { + goPackagePath = "github.com/daviddengcn/go-colortext"; + fetch = { + type = "git"; + url = "https://github.com/daviddengcn/go-colortext"; + rev = "13eaeb896f5985a1ab74ddea58707a73d875ba57"; + sha256 = "0618xs9lc5xfp5zkkb5j47dr7i30ps3zj5fj0zpv8afqh2cc689x"; + }; + } + { + goPackagePath = "gopkg.in/yaml.v1"; + fetch = { + type = "git"; + url = "https://github.com/go-yaml/yaml"; + rev = "b0c168ac0cf9493da1f9bb76c34b26ffef940b4a"; + sha256 = "0jbdy41pplf2d1j24qwr8gc5qsig6ai5ch8rwgvg72kq9q0901cy"; + }; + } + { + goPackagePath = "github.com/inconshreveable/mousetrap"; + fetch = { + type = "git"; + url = "https://github.com/inconshreveable/mousetrap"; + rev = "9dbb96d2c3a964935b0870b5abaea13c98b483aa"; + sha256 = "1f9g8vm18qv1rcb745a4iahql9vfrz0jni9mnzriab2wy1pfdl5b"; + }; + } + { + goPackagePath = "github.com/nsf/termbox-go"; + fetch = { + type = "git"; + url = "https://github.com/nsf/termbox-go"; + rev = "9aecf65084a5754f12d27508fa2e6ed56851953b"; + sha256 = "16sak07bgvmax4zxfrd4jia1dgygk733xa8vk8cdx28z98awbfsh"; + }; + } + { + goPackagePath = "gopkg.in/inconshreveable/go-update.v0"; + fetch = { + type = "git"; + url = "https://github.com/inconshreveable/go-update"; + rev = "d8b0b1d421aa1cbf392c05869f8abbc669bb7066"; + sha256 = "0cvkik2w368fzimx3y29ncfgw7004qkbdf2n3jy5czvzn35q7dpa"; + }; + } + { + goPackagePath = "github.com/kardianos/osext"; + fetch = { + type = "git"; + url = "https://github.com/kardianos/osext"; + rev = "29ae4ffbc9a6fe9fb2bc5029050ce6996ea1d3bc"; + sha256 = "1mawalaz84i16njkz6f9fd5jxhcbxkbsjnav3cmqq2dncv2hyv8a"; + }; + } + { + goPackagePath = "github.com/kr/binarydist"; + fetch = { + type = "git"; + url = "https://github.com/kr/binarydist"; + rev = "9955b0ab8708602d411341e55fffd7e0700f86bd"; + sha256 = "11wncbbbrdcxl5ff3h6w8vqfg4bxsf8709mh6vda0cv236flkyn3"; + }; + } +] diff --git a/nixpkgs/pkgs/tools/networking/ngrok-2/default.nix b/nixpkgs/pkgs/tools/networking/ngrok-2/default.nix new file mode 100644 index 000000000000..fbfab8d2f05a --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/ngrok-2/default.nix @@ -0,0 +1,45 @@ +{ lib, stdenv, fetchurl }: + +with lib; + +let versions = builtins.fromJSON (builtins.readFile ./versions.json); + arch = if stdenv.isi686 then "386" + else if stdenv.isx86_64 then "amd64" + else if stdenv.isAarch32 then "arm" + else if stdenv.isAarch64 then "arm64" + else throw "Unsupported architecture"; + os = if stdenv.isLinux then "linux" + else if (stdenv.isDarwin && stdenv.isx86_64) then "darwin" + else if stdenv.isDarwin then throw "Unsupported architecture" + else throw "Unsupported os"; + versionInfo = versions."${os}-${arch}"; + inherit (versionInfo) version sha256 url; + +in +stdenv.mkDerivation { + name = "ngrok-${version}"; + version = version; + + # run ./update + src = fetchurl { inherit sha256 url; }; + + sourceRoot = "."; + + unpackPhase = "cp $src ngrok"; + + buildPhase = "chmod a+x ngrok"; + + installPhase = '' + install -D ngrok $out/bin/ngrok + ''; + + passthru.updateScript = ./update.sh; + + meta = { + description = "Allows you to expose a web server running on your local machine to the internet"; + homepage = "https://ngrok.com/"; + license = licenses.unfree; + platforms = [ "i686-linux" "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ]; + maintainers = [ maintainers.bobvanderlinden ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/ngrok-2/update.sh b/nixpkgs/pkgs/tools/networking/ngrok-2/update.sh new file mode 100755 index 000000000000..4e2aaf4e5596 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/ngrok-2/update.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env nix-shell +#!nix-shell -p httpie +#!nix-shell -p jq +#!nix-shell -i bash + +set -eu -o pipefail + +get_download_info() { + http --body \ + https://update.equinox.io/check \ + 'Accept:application/json; q=1; version=1; charset=utf-8' \ + 'Content-Type:application/json; charset=utf-8' \ + app_id=app_goVRodbMVm \ + channel=stable \ + os=$1 \ + goarm= \ + arch=$2 \ + | jq --arg sys "$1-$2" '{ + sys: $sys, + url: .download_url, + sha256: .checksum, + version: .release.version + }' +} + +( + get_download_info linux 386 + get_download_info linux amd64 + get_download_info linux arm + get_download_info linux arm64 + get_download_info darwin amd64 + get_download_info darwin arm64 +) | jq --slurp 'map ({ (.sys): . }) | add' \ + > pkgs/tools/networking/ngrok-2/versions.json diff --git a/nixpkgs/pkgs/tools/networking/ngrok-2/versions.json b/nixpkgs/pkgs/tools/networking/ngrok-2/versions.json new file mode 100644 index 000000000000..85b0e47168a2 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/ngrok-2/versions.json @@ -0,0 +1,38 @@ +{ + "linux-386": { + "sys": "linux-386", + "url": "https://bin.equinox.io/a/c4ZY6f7svn7/ngrok-2.3.40-linux-386", + "sha256": "1b645ff0abbb28ca7c0f6a2109653be2dc281860b582b4de6927fde12c99da26", + "version": "2.3.40" + }, + "linux-amd64": { + "sys": "linux-amd64", + "url": "https://bin.equinox.io/a/b5PAmc6L9z2/ngrok-2.3.40-linux-amd64", + "sha256": "218d267cd1195334718bafac14bfdf1c19dc95dcf8a24aaa6a1383c21dc86e76", + "version": "2.3.40" + }, + "linux-arm": { + "sys": "linux-arm", + "url": "https://bin.equinox.io/a/aRh9rdUAJyf/ngrok-2.3.40-linux-arm", + "sha256": "538a7431df141a929a250eaf6ed7afdcce817bcd8cfe60b61f4c6d7a289b1d1c", + "version": "2.3.40" + }, + "linux-arm64": { + "sys": "linux-arm64", + "url": "https://bin.equinox.io/a/2gpRjDRBpJv/ngrok-2.3.40-linux-arm64", + "sha256": "dc7b4465ef95f6d04d1b1996111b3a2631e5f464d7dca7f4994f59ea4edbe21f", + "version": "2.3.40" + }, + "darwin-amd64": { + "sys": "darwin-amd64", + "url": "https://bin.equinox.io/a/fcZQXtHSDgM/ngrok-2.3.40-darwin-amd64", + "sha256": "80c8fb121d6c93350d84351d9516674f4e20a3e003cdd7dcb4c3e7c48b9c5b07", + "version": "2.3.40" + }, + "darwin-arm64": { + "sys": "darwin-arm64", + "url": "https://bin.equinox.io/a/3TEKdZeyAnt/ngrok-2.3.40-darwin-arm64", + "sha256": "c9e6dfec454f9faec92a13dfd3f3857de982007e3b85987bb875aa0d74ca8101", + "version": "2.3.40" + } +} diff --git a/nixpkgs/pkgs/tools/networking/nikto/NIKTODIR-nix-wrapper-fix.patch b/nixpkgs/pkgs/tools/networking/nikto/NIKTODIR-nix-wrapper-fix.patch new file mode 100644 index 000000000000..d3caea1b26fd --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/nikto/NIKTODIR-nix-wrapper-fix.patch @@ -0,0 +1,26 @@ +diff --color -ur a/program/nikto.pl b/program/nikto.pl +--- a/program/nikto.pl 2021-01-30 12:05:54.915072538 +0100 ++++ b/program/nikto.pl 2021-01-30 12:36:42.877729231 +0100 +@@ -223,7 +223,8 @@ + # Guess Nikto current directory + my $NIKTODIR = abs_path($0); + chomp($NIKTODIR); +- $NIKTODIR =~ s#[\\/]nikto.pl$##; ++ $NIKTODIR =~ s#[\\/]bin[\\/]\.nikto-wrapped$##; ++ + + # Guess user's home directory -- to support Windows + foreach my $var (split(/ /, "HOME USERPROFILE")) { +@@ -231,10 +232,10 @@ + } + + # Read the conf files in order (previous values are over-written with each, if multiple found) +- push(@CF,"$NIKTODIR/nikto.conf.default"); ++ push(@CF,"$NIKTODIR/etc/nikto.conf.default"); + push(@CF,"/etc/nikto.conf"); + push(@CF,"$home/nikto.conf"); +- push(@CF,"$NIKTODIR/nikto.conf"); ++ push(@CF,"$NIKTODIR/etc/nikto.conf"); + push(@CF,"nikto.conf"); + push(@CF,"$VARIABLES{'configfile'}"); + diff --git a/nixpkgs/pkgs/tools/networking/nikto/default.nix b/nixpkgs/pkgs/tools/networking/nikto/default.nix new file mode 100644 index 000000000000..e1abcb6c140d --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/nikto/default.nix @@ -0,0 +1,64 @@ +{ lib +, stdenv +, fetchFromGitHub +, perlPackages +, makeWrapper +, installShellFiles +}: + +stdenv.mkDerivation rec { + pname = "nikto"; + version = "2.2.0"; + + src = fetchFromGitHub { + owner = "sullo"; + repo = "nikto"; + rev = "c83d0461edd75c02677dea53da2896644f35ecab"; + sha256 = "0vwq2zdxir67cn78ls11qf1smd54nppy266v7ajm5rqdc47q7fy2"; + }; + + # Nikto searches its configuration file based on its current path + # This fixes the current path regex for the wrapped executable. + patches = [ ./NIKTODIR-nix-wrapper-fix.patch ]; + + postPatch = '' + # EXECDIR needs to be changed to the path where we copy the programs stuff + # Forcing SSLeay is needed for SSL support (the auto mode doesn't seem to work otherwise) + substituteInPlace program/nikto.conf.default \ + --replace "# EXECDIR=/opt/nikto" "EXECDIR=$out/share" \ + --replace "LW_SSL_ENGINE=auto" "LW_SSL_ENGINE=SSLeay" + ''; + + nativeBuildInputs = [ makeWrapper installShellFiles ]; + + propagatedBuildInputs = [ perlPackages.NetSSLeay ]; + + buildInputs = [ + perlPackages.perl + ]; + + installPhase = '' + runHook preInstall + install -d "$out/share" + cp -a program/* "$out/share" + install -Dm 755 "program/nikto.pl" "$out/bin/nikto" + install -Dm 644 program/nikto.conf.default "$out/etc/nikto.conf" + installManPage documentation/nikto.1 + install -Dm 644 program/docs/nikto_manual.html "$out/share/doc/${pname}/manual.html" + install -Dm 644 README.md "$out/share/doc/${pname}/README" + runHook postInstall + ''; + + postInstall = '' + wrapProgram $out/bin/nikto \ + --prefix PERL5LIB : $PERL5LIB + ''; + + meta = with lib; { + description = "Web server scanner"; + license = licenses.gpl2Plus; + homepage = "https://cirt.net/Nikto2"; + maintainers = with maintainers; [ shamilton ]; + platforms = platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/noip/default.nix b/nixpkgs/pkgs/tools/networking/noip/default.nix new file mode 100644 index 000000000000..3425d1e3a82e --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/noip/default.nix @@ -0,0 +1,27 @@ +{lib, stdenv, fetchurl}: + +stdenv.mkDerivation { + name = "noip-2.1.9-1"; + + src = fetchurl { + url = "https://www.noip.com/client/linux/noip-duc-linux.tar.gz"; + sha256 = "82b9bafab96a0c53b21aaef688bf70b3572e26217b5e2072bdb09da3c4a6f593"; + }; + + makeFlags = [ "PREFIX=\${out}" ]; + installPhase = + '' + mkdir -p $out/bin + cp noip2 $out/bin + ''; + + enableParallelBuilding = true; + + meta = with lib; { + description = "Dynamic DNS daemon for no-ip accounts"; + homepage = "http://noip.com/download?page=linux"; + license = lib.licenses.gpl2; + maintainers = [ lib.maintainers.iand675 ]; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/notemap/default.nix b/nixpkgs/pkgs/tools/networking/notemap/default.nix new file mode 100644 index 000000000000..040f26752b51 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/notemap/default.nix @@ -0,0 +1,37 @@ +{ lib +, stdenv +, fetchzip +, pkg-config +, libressl +}: + +stdenv.mkDerivation rec { + pname = "notemap"; + version = "1.3"; + + src = fetchzip { + url = "https://git.causal.agency/notemap/snapshot/notemap-${version}.tar.gz"; + sha256 = "0s9c1xx0iggyzclqw3294bjv7qgvd5l5zgbryks4hvfibr73r6ps"; + }; + + nativeBuildInputs = [ + pkg-config + ]; + + buildInputs = [ + libressl + ]; + + meta = { + description = "Mirror notes to IMAP"; + longDescription = '' + notemap(1) mirrors text files to an IMAP mailbox in a format compatible with the iOS + Notes app. It's intended to make notes managed in git(1) easily accessible + from the phone. + ''; + license = lib.licenses.gpl3Plus; + maintainers = [ lib.maintainers.sternenseemann ]; + homepage = "https://git.causal.agency/notemap/about/"; + platforms = lib.platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/nss-mdns/default.nix b/nixpkgs/pkgs/tools/networking/nss-mdns/default.nix new file mode 100644 index 000000000000..212f7bfc2877 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/nss-mdns/default.nix @@ -0,0 +1,51 @@ +{ fetchurl, lib, stdenv, fetchpatch }: + +stdenv.mkDerivation rec { + name = "nss-mdns-0.10"; + + src = fetchurl { + url = "http://0pointer.de/lennart/projects/nss-mdns/${name}.tar.gz"; + sha256 = "0vgs6j0qsl0mwzh5a0m0bykr7x6bx79vnbyn0r3q289rghp3qs0y"; + }; + + # Note: Although `nss-mdns' works by talking to `avahi-daemon', it + # doesn't depend on the Avahi libraries. Instead, it contains + # hand-written D-Bus code to talk to the Avahi daemon. + + configureFlags = + [ # Try to use the Avahi daemon before resolving on our own. + "--enable-avahi" + + # Connect to the daemon at `/var/run/avahi-daemon/socket'. + "--localstatedir=/var" + ]; + + patches = lib.optional stdenv.hostPlatform.isMusl + ( + fetchpatch + { + url = "https://raw.githubusercontent.com/openembedded/openembedded-core/94f780e889f194b67a48587ac68b3200288bee10/meta/recipes-connectivity/libnss-mdns/libnss-mdns/0001-check-for-nss.h.patch"; + sha256 = "1l1kjbdw8z31br4vib3l5b85jy7kxin760a2f24lww8v6lqdpgds"; + } + ); + + + meta = { + description = "The mDNS Name Service Switch (NSS) plug-in"; + longDescription = '' + `nss-mdns' is a plugin for the GNU Name Service Switch (NSS) + functionality of the GNU C Library (glibc) providing host name + resolution via Multicast DNS (mDNS), effectively allowing name + resolution by common Unix/Linux programs in the ad-hoc mDNS + domain `.local'. + ''; + + homepage = "http://0pointer.de/lennart/projects/nss-mdns/"; + license = lib.licenses.lgpl2Plus; + + # Supports both the GNU and FreeBSD NSS. + platforms = lib.platforms.gnu ++ lib.platforms.linux ++ lib.platforms.freebsd; + + maintainers = [ ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/nss-pam-ldapd/default.nix b/nixpkgs/pkgs/tools/networking/nss-pam-ldapd/default.nix new file mode 100644 index 000000000000..e112b8c1df12 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/nss-pam-ldapd/default.nix @@ -0,0 +1,40 @@ +{ lib, stdenv, fetchurl +, pkg-config, makeWrapper, autoreconfHook +, openldap, python, pam +}: + +stdenv.mkDerivation rec { + pname = "nss-pam-ldapd"; + version = "0.9.11"; + + src = fetchurl { + url = "https://arthurdejong.org/nss-pam-ldapd/${pname}-${version}.tar.gz"; + sha256 = "1dna3r0q6sjhhlkhcp8x2zkslrd4y7701kk6fl5r940sdph1pmyh"; + }; + + nativeBuildInputs = [ pkg-config makeWrapper autoreconfHook ]; + buildInputs = [ openldap pam python ]; + + preConfigure = '' + substituteInPlace Makefile.in --replace "install-data-local: " "# install-data-local: " + ''; + + configureFlags = [ + "--with-bindpw-file=/run/nslcd/bindpw" + "--with-nslcd-socket=/run/nslcd/socket" + "--with-nslcd-pidfile=/run/nslcd/nslcd.pid" + "--with-pam-seclib-dir=$(out)/lib/security" + "--enable-kerberos=no" + ]; + + postInstall = '' + wrapProgram $out/sbin/nslcd --prefix LD_LIBRARY_PATH ":" $out/lib + ''; + + meta = with lib; { + description = "LDAP identity and authentication for NSS/PAM"; + homepage = "https://arthurdejong.org/nss-pam-ldapd/"; + license = licenses.lgpl21; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/ntopng/0001-Undo-weird-modification-of-data_dir.patch b/nixpkgs/pkgs/tools/networking/ntopng/0001-Undo-weird-modification-of-data_dir.patch new file mode 100644 index 000000000000..d794efeac08a --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/ntopng/0001-Undo-weird-modification-of-data_dir.patch @@ -0,0 +1,12 @@ +diff --git a/src/Prefs.cpp b/src/Prefs.cpp +index 76385c4..db8d20d 100755 +--- a/src/Prefs.cpp ++++ b/src/Prefs.cpp +@@ -795,7 +795,6 @@ int Prefs::checkOptions() { + ntop->getTrace()->traceEvent(TRACE_ERROR, "Unable to create log %s", path); + } + +- free(data_dir); data_dir = strdup(ntop->get_install_dir()); + docs_dir = ntop->getValidPath(docs_dir); + scripts_dir = ntop->getValidPath(scripts_dir); + callbacks_dir = ntop->getValidPath(callbacks_dir); diff --git a/nixpkgs/pkgs/tools/networking/ntopng/0002-Remove-requirement-to-have-writeable-callback-dir.patch b/nixpkgs/pkgs/tools/networking/ntopng/0002-Remove-requirement-to-have-writeable-callback-dir.patch new file mode 100644 index 000000000000..50ed1daebd48 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/ntopng/0002-Remove-requirement-to-have-writeable-callback-dir.patch @@ -0,0 +1,14 @@ +diff --git a/src/Ntop.cpp b/src/Ntop.cpp +index 8de92a9..510418f 100644 +--- a/src/Ntop.cpp ++++ b/src/Ntop.cpp +@@ -197,8 +197,7 @@ void Ntop::registerPrefs(Prefs *_prefs) { + } + + if(stat(prefs->get_callbacks_dir(), &statbuf) +- || (!(statbuf.st_mode & S_IFDIR)) /* It's not a directory */ +- || (!(statbuf.st_mode & S_IWRITE)) /* It's not writable */) { ++ || (!(statbuf.st_mode & S_IFDIR)) /* It's not a directory */) { + ntop->getTrace()->traceEvent(TRACE_ERROR, "Invalid directory %s specified", + prefs->get_callbacks_dir()); + _exit(-1); diff --git a/nixpkgs/pkgs/tools/networking/ntopng/0003-New-libpcap-defines-SOCKET.patch b/nixpkgs/pkgs/tools/networking/ntopng/0003-New-libpcap-defines-SOCKET.patch new file mode 100644 index 000000000000..51c9a706f898 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/ntopng/0003-New-libpcap-defines-SOCKET.patch @@ -0,0 +1,34 @@ +From 9cb650ea96c0e5063775071cfdae072e92c553b8 Mon Sep 17 00:00:00 2001 +From: emanuele-f <faranda@ntop.org> +Date: Tue, 18 Sep 2018 12:49:57 +0200 +Subject: [PATCH] Compilation fix with new libpcap + +SOCKET and INVALID_SOCKET are now defined in pcap.h +--- + third-party/mongoose/mongoose.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/third-party/mongoose/mongoose.c b/third-party/mongoose/mongoose.c +index 6a61cea9b..634c142e3 100644 +--- a/third-party/mongoose/mongoose.c ++++ b/third-party/mongoose/mongoose.c +@@ -247,7 +247,9 @@ struct pollfd { + #define mg_rename(x, y) rename(x, y) + #define mg_sleep(x) usleep((x) * 1000) + #define ERRNO errno ++#ifndef INVALID_SOCKET + #define INVALID_SOCKET (-1) ++#endif + + /* ntop */ + #if ((ULONG_MAX) == (UINT_MAX)) +@@ -270,7 +272,9 @@ struct pollfd { + #endif + + //#define INT64_FMT PRId64 ++#ifndef SOCKET + typedef int SOCKET; ++#endif + #define WINCDECL + + #endif // End of Windows and UNIX specific includes diff --git a/nixpkgs/pkgs/tools/networking/ntopng/default.nix b/nixpkgs/pkgs/tools/networking/ntopng/default.nix new file mode 100644 index 000000000000..2ba373a2c61c --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/ntopng/default.nix @@ -0,0 +1,67 @@ +{ lib, stdenv, fetchurl, libpcap,/* gnutls, libgcrypt,*/ libxml2, glib +, geoip, geolite-legacy, sqlite, which, autoreconfHook, git +, pkg-config, groff, curl, json_c, luajit, zeromq, rrdtool +}: + +# ntopng includes LuaJIT, mongoose, rrdtool and zeromq in its third-party/ +# directory, but we use luajit, zeromq, and rrdtool from nixpkgs + +stdenv.mkDerivation rec { + name = "ntopng-2.0"; + + src = fetchurl { + urls = [ + "mirror://sourceforge/project/ntop/ntopng/old/${name}.tar.gz" + "mirror://sourceforge/project/ntop/ntopng/${name}.tar.gz" + ]; + sha256 = "0l82ivh05cmmqcvs26r6y69z849d28njipphqzvnakf43ggddgrw"; + }; + + patches = [ + ./0001-Undo-weird-modification-of-data_dir.patch + ./0002-Remove-requirement-to-have-writeable-callback-dir.patch + ./0003-New-libpcap-defines-SOCKET.patch + ]; + + buildInputs = [ libpcap/* gnutls libgcrypt*/ libxml2 glib geoip geolite-legacy + sqlite which autoreconfHook git pkg-config groff curl json_c luajit zeromq + rrdtool ]; + + + autoreconfPhase = '' + substituteInPlace autogen.sh --replace "/bin/rm" "rm" + substituteInPlace nDPI/autogen.sh --replace "/bin/rm" "rm" + $shell autogen.sh + ''; + + preConfigure = '' + substituteInPlace Makefile.in --replace "/bin/rm" "rm" + ''; + + preBuild = '' + substituteInPlace src/Ntop.cpp --replace "/usr/local" "$out" + + sed -e "s|\(#define CONST_DEFAULT_DATA_DIR\).*|\1 \"/var/lib/ntopng\"|g" \ + -e "s|\(#define CONST_DEFAULT_DOCS_DIR\).*|\1 \"$out/share/ntopng/httpdocs\"|g" \ + -e "s|\(#define CONST_DEFAULT_SCRIPTS_DIR\).*|\1 \"$out/share/ntopng/scripts\"|g" \ + -e "s|\(#define CONST_DEFAULT_CALLBACKS_DIR\).*|\1 \"$out/share/ntopng/scripts/callbacks\"|g" \ + -e "s|\(#define CONST_DEFAULT_INSTALL_DIR\).*|\1 \"$out/share/ntopng\"|g" \ + -i include/ntop_defines.h + + rm -rf httpdocs/geoip + ln -s ${geolite-legacy}/share/GeoIP httpdocs/geoip + '' + lib.optionalString stdenv.isDarwin '' + sed 's|LIBS += -lstdc++.6||' -i Makefile + ''; + + NIX_CFLAGS_COMPILE = "-fpermissive" + + lib.optionalString stdenv.cc.isClang " -Wno-error=reserved-user-defined-literal"; + + meta = with lib; { + description = "High-speed web-based traffic analysis and flow collection tool"; + homepage = "http://www.ntop.org/products/ntop/"; + license = licenses.gpl3Plus; + platforms = platforms.linux ++ platforms.darwin; + maintainers = [ maintainers.bjornfor ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/ntp/default.nix b/nixpkgs/pkgs/tools/networking/ntp/default.nix new file mode 100644 index 000000000000..8c62e3b0d646 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/ntp/default.nix @@ -0,0 +1,52 @@ +{ stdenv, lib, fetchurl, openssl, perl, libcap ? null, libseccomp ? null, pps-tools }: + +assert stdenv.isLinux -> libcap != null; +assert stdenv.isLinux -> libseccomp != null; + +let + withSeccomp = stdenv.isLinux && (stdenv.isi686 || stdenv.isx86_64); +in + +stdenv.mkDerivation rec { + name = "ntp-4.2.8p15"; + + src = fetchurl { + url = "https://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/${name}.tar.gz"; + sha256 = "06cwhimm71safmwvp6nhxp6hvxsg62whnbgbgiflsqb8mgg40n7n"; + }; + + # The hardcoded list of allowed system calls for seccomp is + # insufficient for NixOS, add more to make it work (issue #21136). + patches = [ ./seccomp.patch ]; + + configureFlags = [ + "--sysconfdir=/etc" + "--localstatedir=/var" + "--with-openssl-libdir=${openssl.out}/lib" + "--with-openssl-incdir=${openssl.dev}/include" + "--enable-ignore-dns-errors" + "--with-yielding-select=yes" + ] ++ lib.optional stdenv.isLinux "--enable-linuxcaps" + ++ lib.optional withSeccomp "--enable-libseccomp"; + + buildInputs = [ libcap openssl perl ] + ++ lib.optional withSeccomp libseccomp + ++ lib.optional stdenv.isLinux pps-tools; + + hardeningEnable = [ "pie" ]; + + postInstall = '' + rm -rf $out/share/doc + ''; + + meta = with lib; { + homepage = "http://www.ntp.org/"; + description = "An implementation of the Network Time Protocol"; + license = { + # very close to isc and bsd2 + url = "https://www.eecis.udel.edu/~mills/ntp/html/copyright.html"; + }; + maintainers = with maintainers; [ eelco thoughtpolice ]; + platforms = platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/ntp/seccomp.patch b/nixpkgs/pkgs/tools/networking/ntp/seccomp.patch new file mode 100644 index 000000000000..c75536dac7fb --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/ntp/seccomp.patch @@ -0,0 +1,57 @@ +From 881e427f3236046466bdb8235edf86e6dfa34391 Mon Sep 17 00:00:00 2001 +From: Michael Bishop <cleverca22@gmail.com> +Date: Mon, 11 Jun 2018 08:30:48 -0300 +Subject: [PATCH] fix the seccomp filter to include a few previously missed + syscalls + +--- + ntpd/ntpd.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/ntpd/ntpd.c b/ntpd/ntpd.c +index 2c7f02ec5..4c59dc2ba 100644 +--- a/ntpd/ntpd.c ++++ b/ntpd/ntpd.c +@@ -1140,10 +1140,12 @@ int scmp_sc[] = { + SCMP_SYS(close), + SCMP_SYS(connect), + SCMP_SYS(exit_group), ++ SCMP_SYS(fcntl), + SCMP_SYS(fstat), + SCMP_SYS(fsync), + SCMP_SYS(futex), + SCMP_SYS(getitimer), ++ SCMP_SYS(getpid), + SCMP_SYS(getsockname), + SCMP_SYS(ioctl), + SCMP_SYS(lseek), +@@ -1162,6 +1164,8 @@ int scmp_sc[] = { + SCMP_SYS(sendto), + SCMP_SYS(setitimer), + SCMP_SYS(setsid), ++ SCMP_SYS(setsockopt), ++ SCMP_SYS(openat), + SCMP_SYS(socket), + SCMP_SYS(stat), + SCMP_SYS(time), +@@ -1178,9 +1182,11 @@ int scmp_sc[] = { + SCMP_SYS(clock_settime), + SCMP_SYS(close), + SCMP_SYS(exit_group), ++ SCMP_SYS(fcntl), + SCMP_SYS(fsync), + SCMP_SYS(futex), + SCMP_SYS(getitimer), ++ SCMP_SYS(getpid), + SCMP_SYS(madvise), + SCMP_SYS(mmap), + SCMP_SYS(mmap2), +@@ -1194,6 +1200,8 @@ int scmp_sc[] = { + SCMP_SYS(select), + SCMP_SYS(setitimer), + SCMP_SYS(setsid), ++ SCMP_SYS(setsockopt), ++ SCMP_SYS(openat), + SCMP_SYS(sigprocmask), + SCMP_SYS(sigreturn), + SCMP_SYS(socketcall), diff --git a/nixpkgs/pkgs/tools/networking/nuttcp/default.nix b/nixpkgs/pkgs/tools/networking/nuttcp/default.nix new file mode 100644 index 000000000000..1b9e9fe04e43 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/nuttcp/default.nix @@ -0,0 +1,51 @@ +{ lib, stdenv, fetchurl }: + +stdenv.mkDerivation rec { + pname = "nuttcp"; + version = "8.1.4"; + + src = fetchurl { + urls = [ + "http://nuttcp.net/nuttcp/latest/${pname}-${version}.c" + "http://nuttcp.net/nuttcp/${pname}-${version}/${pname}-${version}.c" + "http://nuttcp.net/nuttcp/beta/${pname}-${version}.c" + ]; + sha256 = "1mygfhwxfi6xg0iycivx98ckak2abc3vwndq74278kpd8g0yyqyh"; + }; + + man = fetchurl { + url = "http://nuttcp.net/nuttcp/${pname}-${version}/nuttcp.8"; + sha256 = "1yang94mcdqg362qbi85b63746hk6gczxrk619hyj91v5763n4vx"; + }; + + dontUnpack = true; + + buildPhase = '' + cc -O2 -o nuttcp $src + ''; + + installPhase = '' + mkdir -p $out/bin + cp nuttcp $out/bin + ''; + + meta = with lib; { + description = "Network performance measurement tool"; + longDescription = '' + nuttcp is a network performance measurement tool intended for use by + network and system managers. Its most basic usage is to determine the raw + TCP (or UDP) network layer throughput by transferring memory buffers from + a source system across an interconnecting network to a destination + system, either transferring data for a specified time interval, or + alternatively transferring a specified number of bytes. In addition to + reporting the achieved network throughput in Mbps, nuttcp also provides + additional useful information related to the data transfer such as user, + system, and wall-clock time, transmitter and receiver CPU utilization, + and loss percentage (for UDP transfers). + ''; + license = licenses.gpl2; + homepage = "http://nuttcp.net/"; + maintainers = with maintainers; [ ]; + platforms = platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/nxdomain/default.nix b/nixpkgs/pkgs/tools/networking/nxdomain/default.nix new file mode 100644 index 000000000000..4e7a708125aa --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/nxdomain/default.nix @@ -0,0 +1,29 @@ +{ lib, buildPythonApplication, fetchPypi, dnspython, pytestCheckHook }: + +buildPythonApplication rec { + pname = "nxdomain"; + version = "1.0.2"; + + src = fetchPypi { + inherit pname version; + sha256 = "0va7nkbdjgzrf7fnbxkh1140pbc62wyj86rdrrh5wmg3phiziqkb"; + }; + + propagatedBuildInputs = [ dnspython ]; + + checkInputs = [ pytestCheckHook ]; + + postCheck = '' + echo example.org > simple.list + python -m nxdomain --format dnsmasq --out dnsmasq.conf --simple ./simple.list + grep -q 'address=/example.org/' dnsmasq.conf + ''; + + meta = with lib; { + homepage = "https://github.com/zopieux/nxdomain"; + description = "A domain (ad) block list creator"; + platforms = platforms.all; + license = licenses.gpl3Only; + maintainers = with maintainers; [ zopieux ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/nylon/configure-use-solib.patch b/nixpkgs/pkgs/tools/networking/nylon/configure-use-solib.patch new file mode 100644 index 000000000000..02491d7660ea --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/nylon/configure-use-solib.patch @@ -0,0 +1,33 @@ +--- nylon-1.21/configure 2006-08-20 00:53:31.000000000 +0200 ++++ nylon-1.21-patch/configure 2015-01-13 22:23:34.509154220 +0100 +@@ -5174,25 +5174,25 @@ + *) + echo "$as_me:$LINENO: result: $withval" >&5 + echo "${ECHO_T}$withval" >&6 +- if test -f $withval/include/event.h -a -f $withval/lib/libevent.a; then ++ if test -f $withval/include/event.h -a -f $withval/lib/libevent.so; then + owd=`pwd` + if cd $withval; then withval=`pwd`; cd $owd; fi + EVENTINC="-I$withval/include" + EVENTLIB="-L$withval/lib -levent" +- elif test -f $withval/event.h -a -f $withval/libevent.a; then ++ elif test -f $withval/event.h -a -f $withval/libevent.so; then + owd=`pwd` + if cd $withval; then withval=`pwd`; cd $owd; fi + EVENTINC="-I$withval" + EVENTLIB="-L$withval -levent" + else +- { { echo "$as_me:$LINENO: error: event.h or libevent.a not found in $withval" >&5 +-echo "$as_me: error: event.h or libevent.a not found in $withval" >&2;} ++ { { echo "$as_me:$LINENO: error: event.h or libevent.so not found in $withval" >&5 ++echo "$as_me: error: event.h or libevent.so not found in $withval" >&2;} + { (exit 1); exit 1; }; } + fi + ;; + esac + else +- if test -f ${prefix}/include/event.h -a -f ${prefix}/lib/libevent.a; ++ if test -f ${prefix}/include/event.h -a -f ${prefix}/lib/libevent.so; + then + EVENTINC="-I${prefix}/include" + EVENTLIB="-L${prefix}/lib -levent" diff --git a/nixpkgs/pkgs/tools/networking/nylon/default.nix b/nixpkgs/pkgs/tools/networking/nylon/default.nix new file mode 100644 index 000000000000..840b714fc9f8 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/nylon/default.nix @@ -0,0 +1,29 @@ +{ lib, stdenv, fetchurl, libevent, buildEnv }: +let + # failed to find a better way to make it work + libevent-comb = buildEnv { + inherit (libevent.out) name; + paths = [ libevent.dev libevent.out ]; + }; +in +stdenv.mkDerivation { + name = "nylon-1.21"; + src = fetchurl { + url = "https://monkey.org/~marius/nylon/nylon-1.21.tar.gz"; + sha256 = "34c132b005c025c1a5079aae9210855c80f50dc51dde719298e1113ad73408a4"; + }; + + patches = [ ./configure-use-solib.patch ]; + + configureFlags = [ "--with-libevent=${libevent-comb}" ]; + + buildInputs = [ libevent ]; + + meta = with lib; { + homepage = "http://monkey.org/~marius/nylon"; + description = "Proxy server, supporting SOCKS 4 and 5, as well as a mirror mode"; + license = licenses.bsdOriginal; + maintainers = with maintainers; [ edwtjo ]; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/nyx/default.nix b/nixpkgs/pkgs/tools/networking/nyx/default.nix new file mode 100644 index 000000000000..6ae81609eec8 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/nyx/default.nix @@ -0,0 +1,25 @@ +{ lib, python3Packages }: + +with python3Packages; + +buildPythonApplication rec { + pname = "nyx"; + version = "2.1.0"; + + src = fetchPypi { + inherit pname version; + sha256 = "02rrlllz2ci6i6cs3iddyfns7ang9a54jrlygd2jw1f9s6418ll8"; + }; + + propagatedBuildInputs = [ stem ]; + + # ./run_tests.py returns `TypeError: testFailure() takes exactly 1 argument` + doCheck = false; + + meta = with lib; { + description = "Command-line monitor for Tor"; + homepage = "https://nyx.torproject.org/"; + license = licenses.gpl3; + maintainers = with maintainers; [ offline ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/nzbget/default.nix b/nixpkgs/pkgs/tools/networking/nzbget/default.nix new file mode 100644 index 000000000000..375896258bc7 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/nzbget/default.nix @@ -0,0 +1,27 @@ +{ lib, stdenv, fetchurl, pkg-config, libxml2, ncurses, libsigcxx, libpar2 +, gnutls, libgcrypt, zlib, openssl }: + +stdenv.mkDerivation rec { + pname = "nzbget"; + version = "21.0"; + + src = fetchurl { + url = "https://github.com/nzbget/nzbget/releases/download/v${version}/nzbget-${version}-src.tar.gz"; + sha256 = "0lwd0pfrs4a5ms193hgz2qiyf7grrc925dw6y0nfc0gkp27db9b5"; + }; + + nativeBuildInputs = [ pkg-config ]; + + buildInputs = [ libxml2 ncurses libsigcxx libpar2 gnutls + libgcrypt zlib openssl ]; + + enableParallelBuilding = true; + + meta = with lib; { + homepage = "https://nzbget.net"; + license = licenses.gpl2Plus; + description = "A command line tool for downloading files from news servers"; + maintainers = with maintainers; [ pSub ]; + platforms = with platforms; unix; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/oapi-codegen/default.nix b/nixpkgs/pkgs/tools/networking/oapi-codegen/default.nix new file mode 100644 index 000000000000..ce490cafef6a --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/oapi-codegen/default.nix @@ -0,0 +1,25 @@ +{ lib, buildGoModule, fetchFromGitHub }: + +buildGoModule rec { + pname = "oapi-codegen"; + version = "1.6.0"; + + src = fetchFromGitHub { + owner = "deepmap"; + repo = pname; + rev = "v${version}"; + sha256 = "sha256-doJ1ceuJ/gL9vlGgV/hKIJeAErAseH0dtHKJX2z7pV0="; + }; + + vendorSha256 = "sha256-Y4WM+o+5jiwj8/99UyNHLpBNbtJkKteIGW2P1Jd9L6M="; + + # Tests use network + doCheck = false; + + meta = with lib; { + description = "Go client and server OpenAPI 3 generator"; + homepage = "https://github.com/deepmap/oapi-codegen"; + license = licenses.asl20; + maintainers = [ maintainers.j4m3s ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/obfs4/default.nix b/nixpkgs/pkgs/tools/networking/obfs4/default.nix new file mode 100644 index 000000000000..0a74deea17d5 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/obfs4/default.nix @@ -0,0 +1,23 @@ +{ lib, fetchgit, buildGoModule }: + +buildGoModule rec { + pname = "obfs4"; + version = "0.0.10"; + + src = fetchgit { + url = meta.repositories.git; + rev = "refs/tags/${pname}proxy-${version}"; + sha256 = "05aqmw8x8s0yqyqmdj5zcsq06gsbcmrlcd52gaqm20m1pg9503ad"; + }; + + vendorSha256 = "0h3gjxv26pc6cysvy1hny2f4abw6i847dk8fx0m113ixx9qghk87"; + + doCheck = false; + + meta = with lib; { + description = "A pluggable transport proxy"; + homepage = "https://www.torproject.org/projects/obfsproxy"; + repositories.git = "https://git.torproject.org/pluggable-transports/obfs4.git"; + maintainers = with maintainers; [ phreedom thoughtpolice ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/ocproxy/default.nix b/nixpkgs/pkgs/tools/networking/ocproxy/default.nix new file mode 100644 index 000000000000..bc21884e6ac8 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/ocproxy/default.nix @@ -0,0 +1,33 @@ +{ lib, stdenv, fetchFromGitHub, autoconf, automake, libevent }: + +stdenv.mkDerivation rec { + version = "1.60"; + pname = "ocproxy"; + + src = fetchFromGitHub { + owner = "cernekee"; + repo = "ocproxy"; + rev = "v${version}"; + sha256 = "03323nnhb4y9nzwva04mq7xg03dvdrgp689g89f69jqc261skcqx"; + }; + + nativeBuildInputs = [ autoconf automake ]; + buildInputs = [ libevent ]; + + preConfigure = '' + patchShebangs autogen.sh + ./autogen.sh + ''; + + meta = with lib; { + description = "OpenConnect proxy"; + longDescription = '' + ocproxy is a user-level SOCKS and port forwarding proxy for OpenConnect + based on lwIP. + ''; + homepage = "https://github.com/cernekee/ocproxy"; + license = licenses.bsd3; + maintainers = [ maintainers.joko ]; + platforms = platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/ocserv/default.nix b/nixpkgs/pkgs/tools/networking/ocserv/default.nix new file mode 100644 index 000000000000..2f5dd14757bc --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/ocserv/default.nix @@ -0,0 +1,26 @@ +{ lib, stdenv, fetchFromGitLab, autoreconfHook, pkg-config, nettle, gnutls +, libev, protobufc, guile, geoip, libseccomp, gperf, readline +, lz4, libgssglue, ronn, pam +}: + +stdenv.mkDerivation rec { + pname = "ocserv"; + version = "0.12.6"; + + src = fetchFromGitLab { + owner = "openconnect"; + repo = "ocserv"; + rev = "ocserv_${lib.replaceStrings [ "." ] [ "_" ] version}"; + sha256 = "0k7sx9sg8akxwfdl51cvdqkdrx9qganqddgri2yhcgznc3f3pz5b"; + }; + + nativeBuildInputs = [ autoreconfHook pkg-config ]; + buildInputs = [ nettle gnutls libev protobufc guile geoip libseccomp gperf readline lz4 libgssglue ronn pam ]; + + meta = with lib; { + homepage = "https://gitlab.com/openconnect/ocserv"; + license = licenses.gpl2; + description = "This program is openconnect VPN server (ocserv), a server for the openconnect VPN client"; + maintainers = with maintainers; [ ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/offlineimap/default.nix b/nixpkgs/pkgs/tools/networking/offlineimap/default.nix new file mode 100644 index 000000000000..0de96169769a --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/offlineimap/default.nix @@ -0,0 +1,40 @@ +{ lib, fetchFromGitHub, python2Packages, + asciidoc, cacert, libxml2, libxslt, docbook_xsl }: + +python2Packages.buildPythonApplication rec { + version = "7.3.3"; + pname = "offlineimap"; + + src = fetchFromGitHub { + owner = "OfflineIMAP"; + repo = "offlineimap"; + rev = "v${version}"; + sha256 = "1gg8ry67i20qapj4z20am9bm67m2q28kixcj7ja75m897vhzarnq"; + }; + + postPatch = '' + # Skip xmllint to stop failures due to no network access + sed -i docs/Makefile -e "s|a2x -v -d |a2x -L -v -d |" + + # Provide CA certificates (Used when "sslcacertfile = OS-DEFAULT" is configured") + sed -i offlineimap/utils/distro.py -e '/def get_os_sslcertfile():/a\ \ \ \ return "${cacert}/etc/ssl/certs/ca-bundle.crt"' + ''; + + doCheck = false; + + nativeBuildInputs = [ asciidoc libxml2 libxslt docbook_xsl ]; + propagatedBuildInputs = with python2Packages; [ six kerberos rfc6555 pysocks ]; + + postInstall = '' + make -C docs man + install -D -m 644 docs/offlineimap.1 ''${!outputMan}/share/man/man1/offlineimap.1 + install -D -m 644 docs/offlineimapui.7 ''${!outputMan}/share/man/man7/offlineimapui.7 + ''; + + meta = { + description = "Synchronize emails between two repositories, so that you can read the same mailbox from multiple computers"; + homepage = "http://offlineimap.org"; + license = lib.licenses.gpl2Plus; + maintainers = with lib.maintainers; [ endocrimes ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/ofono/0001-Search-connectors-in-OFONO_PLUGIN_PATH.patch b/nixpkgs/pkgs/tools/networking/ofono/0001-Search-connectors-in-OFONO_PLUGIN_PATH.patch new file mode 100644 index 000000000000..c1174e1093a8 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/ofono/0001-Search-connectors-in-OFONO_PLUGIN_PATH.patch @@ -0,0 +1,120 @@ +From 0e0994c9716700c9484b3dccb25f98a9a59d1744 Mon Sep 17 00:00:00 2001 +From: Jan Tojnar <jtojnar@gmail.com> +Date: Fri, 23 Aug 2019 18:42:51 +0200 +Subject: [PATCH] Search connectors in OFONO_PLUGIN_PATH + +Previously, the connectors would only be looked for in a single +directory, specified during compilation. This patch allows to +traverse a list of directories provided by an environment variable. +--- + src/plugin.c | 77 ++++++++++++++++++++++++++++++++++------------------ + 1 file changed, 50 insertions(+), 27 deletions(-) + +diff --git a/src/plugin.c b/src/plugin.c +index 924a45ec..f05055c3 100644 +--- a/src/plugin.c ++++ b/src/plugin.c +@@ -99,35 +99,12 @@ static gboolean check_plugin(struct ofono_plugin_desc *desc, + return TRUE; + } + +-#include "builtin.h" +- +-int __ofono_plugin_init(const char *pattern, const char *exclude) +-{ +- gchar **patterns = NULL; +- gchar **excludes = NULL; +- GSList *list; +- GDir *dir; ++static handle_dir(const gchar *plugin_path, const gchar **patterns, const gchar **excludes) { + const gchar *file; + gchar *filename; +- unsigned int i; +- +- DBG(""); +- +- if (pattern) +- patterns = g_strsplit_set(pattern, ":, ", -1); +- +- if (exclude) +- excludes = g_strsplit_set(exclude, ":, ", -1); +- +- for (i = 0; __ofono_builtin[i]; i++) { +- if (check_plugin(__ofono_builtin[i], +- patterns, excludes) == FALSE) +- continue; +- +- add_plugin(NULL, __ofono_builtin[i]); +- } ++ GDir *dir; + +- dir = g_dir_open(PLUGINDIR, 0, NULL); ++ dir = g_dir_open(plugin_path, 0, NULL); + if (dir != NULL) { + while ((file = g_dir_read_name(dir)) != NULL) { + void *handle; +@@ -137,7 +114,7 @@ int __ofono_plugin_init(const char *pattern, const char *exclude) + g_str_has_suffix(file, ".so") == FALSE) + continue; + +- filename = g_build_filename(PLUGINDIR, file, NULL); ++ filename = g_build_filename(plugin_path, file, NULL); + + handle = dlopen(filename, RTLD_NOW); + if (handle == NULL) { +@@ -168,6 +145,52 @@ int __ofono_plugin_init(const char *pattern, const char *exclude) + + g_dir_close(dir); + } ++} ++ ++#include "builtin.h" ++ ++int __ofono_plugin_init(const char *pattern, const char *exclude) ++{ ++ gchar **patterns = NULL; ++ gchar **excludes = NULL; ++ GSList *list; ++ unsigned int i; ++ ++ DBG(""); ++ ++ if (pattern) ++ patterns = g_strsplit_set(pattern, ":, ", -1); ++ ++ if (exclude) ++ excludes = g_strsplit_set(exclude, ":, ", -1); ++ ++ for (i = 0; __ofono_builtin[i]; i++) { ++ if (check_plugin(__ofono_builtin[i], ++ patterns, excludes) == FALSE) ++ continue; ++ ++ add_plugin(NULL, __ofono_builtin[i]); ++ } ++ ++ ++ const gchar *plugin_path; ++ ++ plugin_path = g_getenv ("OFONO_PLUGIN_PATH"); ++ ++ if (plugin_path) { ++ gchar **plugin_path_list; ++ gsize i; ++ ++ plugin_path_list = g_strsplit (plugin_path, G_SEARCHPATH_SEPARATOR_S, 0); ++ ++ for (i = 0; plugin_path_list[i]; i++) { ++ handle_dir(plugin_path_list, patterns, excludes); ++ } ++ ++ g_strfreev(plugin_path_list); ++ } ++ ++ handle_dir(PLUGINDIR, patterns, excludes); + + for (list = plugins; list; list = list->next) { + struct ofono_plugin *plugin = list->data; +-- +2.22.0 + diff --git a/nixpkgs/pkgs/tools/networking/ofono/default.nix b/nixpkgs/pkgs/tools/networking/ofono/default.nix new file mode 100644 index 000000000000..93e1415b91c4 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/ofono/default.nix @@ -0,0 +1,66 @@ +{ lib, stdenv +, fetchgit +, autoreconfHook +, pkg-config +, glib +, dbus +, ell +, systemd +, bluez +, mobile-broadband-provider-info +}: + +stdenv.mkDerivation rec { + pname = "ofono"; + version = "1.32"; + + outputs = [ "out" "dev" ]; + + src = fetchgit { + url = "git://git.kernel.org/pub/scm/network/ofono/ofono.git"; + rev = version; + sha256 = "sha256-bJ7Qgau5soPiptrhcMZ8rWxfprRCTeR7OjQ5HZQ9hbc="; + }; + + patches = [ + ./0001-Search-connectors-in-OFONO_PLUGIN_PATH.patch + ]; + + nativeBuildInputs = [ + autoreconfHook + pkg-config + ]; + + buildInputs = [ + glib + dbus + ell + systemd + bluez + mobile-broadband-provider-info + ]; + + configureFlags = [ + "--with-dbusconfdir=${placeholder "out"}/share" + "--with-systemdunitdir=${placeholder "out"}/lib/systemd/system" + "--enable-external-ell" + ]; + + postInstall = '' + rm -r $out/etc/ofono + ln -s /etc/ofono $out/etc/ofono + ''; + + enableParallelBuilding = true; + enableParallelChecking = false; + + doCheck = true; + + meta = with lib; { + description = "Infrastructure for building mobile telephony (GSM/UMTS) applications"; + homepage = "https://01.org/ofono"; + license = licenses.gpl2; + maintainers = with maintainers; [ jtojnar ]; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/olsrd/default.nix b/nixpkgs/pkgs/tools/networking/olsrd/default.nix new file mode 100644 index 000000000000..4fb8892ec020 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/olsrd/default.nix @@ -0,0 +1,36 @@ +{ lib, stdenv, fetchFromGitHub, fetchpatch, bison, flex }: + +stdenv.mkDerivation rec { + pname = "olsrd"; + version = "0.9.8"; + + src = fetchFromGitHub { + owner = "OLSR"; + repo = pname; + rev = "v${version}"; + sha256 = "1xk355dm5pfjil1j4m724vkdnc178lv6hi6s1g0xgpd59avbx90j"; + }; + + patches = [ + # remove if there's ever an upstream release that incorporates + # https://github.com/OLSR/olsrd/pull/87 + (fetchpatch { + url = "https://raw.githubusercontent.com/openwrt-routing/packages/b3897386771890ba1b15f672c2fed58630beedef/olsrd/patches/011-bison.patch"; + sha256 = "04cl4b8dpr1yjs7wa94jcszmkdzpnrn719a5m9nhm7lvfrn1rzd0"; + }) + ]; + + buildInputs = [ bison flex ]; + + preConfigure = '' + makeFlags="prefix=$out ETCDIR=$out/etc" + ''; + + meta = { + description = "An adhoc wireless mesh routing daemon"; + license = lib.licenses.bsd3; + homepage = "http://olsr.org/"; + maintainers = with lib.maintainers; [viric]; + platforms = with lib.platforms; linux; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/oneshot/default.nix b/nixpkgs/pkgs/tools/networking/oneshot/default.nix new file mode 100644 index 000000000000..48c20643580f --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/oneshot/default.nix @@ -0,0 +1,26 @@ +{ lib, fetchFromGitHub, buildGoModule }: + +buildGoModule rec { + pname = "oneshot"; + version = "1.4.1"; + + src = fetchFromGitHub { + owner = "raphaelreyna"; + repo = "oneshot"; + rev = "v${version}"; + sha256 = "sha256-UD67xYBb1rvGMSPurte5z2Hcd7+JtXDPbgp3BVBdLuk="; + }; + + vendorSha256 = "sha256-d+YE618OywSDOWiiULHENFEqzRmFVUFKPuPXnL1JubM="; + + doCheck = false; + + subPackages = [ "." ]; + + meta = with lib; { + description = "A first-come-first-serve single-fire HTTP server"; + homepage = "https://github.com/raphaelreyna/oneshot"; + license = licenses.mit; + maintainers = with maintainers; [ edibopp ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/openapi-generator-cli/default.nix b/nixpkgs/pkgs/tools/networking/openapi-generator-cli/default.nix new file mode 100644 index 000000000000..b195c655c93f --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/openapi-generator-cli/default.nix @@ -0,0 +1,42 @@ +{ callPackage, lib, stdenv, fetchurl, jre, makeWrapper }: + +let this = stdenv.mkDerivation rec { + version = "5.1.0"; + pname = "openapi-generator-cli"; + + jarfilename = "${pname}-${version}.jar"; + + nativeBuildInputs = [ + makeWrapper + ]; + + src = fetchurl { + url = "mirror://maven/org/openapitools/${pname}/${version}/${jarfilename}"; + sha256 = "06dvy4pwgpyf209n0b27qwkjj7zlgadg2czwxapy94fd1wpq9yb2"; + }; + + phases = [ "installPhase" ]; + + installPhase = '' + runHook preInstall + + install -D "$src" "$out/share/java/${jarfilename}" + + makeWrapper ${jre}/bin/java $out/bin/${pname} \ + --add-flags "-jar $out/share/java/${jarfilename}" + + runHook postInstall + ''; + + meta = with lib; { + description = "Allows generation of API client libraries (SDK generation), server stubs and documentation automatically given an OpenAPI Spec"; + homepage = "https://github.com/OpenAPITools/openapi-generator"; + license = licenses.asl20; + maintainers = [ maintainers.shou ]; + }; + + passthru.tests.example = callPackage ./example.nix { + openapi-generator-cli = this; + }; +}; +in this diff --git a/nixpkgs/pkgs/tools/networking/openapi-generator-cli/example.nix b/nixpkgs/pkgs/tools/networking/openapi-generator-cli/example.nix new file mode 100644 index 000000000000..f59173b9744a --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/openapi-generator-cli/example.nix @@ -0,0 +1,31 @@ +{ openapi-generator-cli, fetchurl, runCommand }: + +runCommand "openapi-generator-cli-test" { + nativeBuildInputs = [ openapi-generator-cli ]; + petstore = fetchurl { + url = "https://raw.githubusercontent.com/OAI/OpenAPI-Specification/14c0908becbccd78252be49bd92be8c53cd2b9e3/examples/v3.0/petstore.yaml"; + sha256 = "sha256:1mgdbzv42alv0b1a18dqbabqyvyhrg3brynr5hqsrm3qljfzaq5b"; + }; + config = builtins.toJSON { + elmVersion = "0.19"; + elmPrefixCustomTypeVariants = false; + }; + passAsFile = [ "config" ]; +} '' + openapi-generator-cli generate \ + --input-spec $petstore \ + --enable-post-process-file \ + --generator-name elm \ + --config "$config" \ + --additional-properties elmEnableCustomBasePaths=true \ + --output "$out" \ + ; + find $out + echo >&2 'Looking for some keywords' + set -x + grep 'module Api.Request.Pets' $out/src/Api/Request/Pets.elm + grep 'createPets' $out/src/Api/Request/Pets.elm + grep '"limit"' $out/src/Api/Request/Pets.elm + set +x + echo "Looks OK!" +'' diff --git a/nixpkgs/pkgs/tools/networking/openapi-generator-cli/unstable.nix b/nixpkgs/pkgs/tools/networking/openapi-generator-cli/unstable.nix new file mode 100644 index 000000000000..306654f05d99 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/openapi-generator-cli/unstable.nix @@ -0,0 +1,42 @@ +{ callPackage, lib, stdenv, fetchurl, jre, makeWrapper }: + +let this = stdenv.mkDerivation rec { + version = "6.0.0-2021-01-18"; # Also update the fetchurl link + pname = "openapi-generator-cli"; + + jarfilename = "${pname}-${version}.jar"; + + nativeBuildInputs = [ + makeWrapper + ]; + + src = fetchurl { + url = "https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/6.0.0-SNAPSHOT/openapi-generator-cli-6.0.0-20210118.082537-4.jar"; + sha256 = "1ji3yw9dp4srlgqxvb21vrcp2bzj4himxsmp8l8zid9nxsc1m71x"; + }; + + phases = [ "installPhase" ]; + + installPhase = '' + runHook preInstall + + install -D "$src" "$out/share/java/${jarfilename}" + + makeWrapper ${jre}/bin/java $out/bin/${pname} \ + --add-flags "-jar $out/share/java/${jarfilename}" + + runHook postInstall + ''; + + meta = with lib; { + description = "Allows generation of API client libraries (SDK generation), server stubs and documentation automatically given an OpenAPI Spec"; + homepage = "https://github.com/OpenAPITools/openapi-generator"; + license = licenses.asl20; + maintainers = [ maintainers.shou ]; + }; + + passthru.tests.example = callPackage ./example.nix { + openapi-generator-cli = this; + }; +}; +in this diff --git a/nixpkgs/pkgs/tools/networking/openconnect/default.nix b/nixpkgs/pkgs/tools/networking/openconnect/default.nix new file mode 100644 index 000000000000..8afe546c4593 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/openconnect/default.nix @@ -0,0 +1,62 @@ +{ lib +, stdenv +, fetchurl +, pkg-config +, openssl ? null +, gnutls ? null +, gmp +, libxml2 +, stoken +, zlib +, fetchgit +, darwin +, head ? false + , fetchFromGitLab + , autoreconfHook +}: + +assert (openssl != null) == (gnutls == null); + +let vpnc = fetchgit { + url = "git://git.infradead.org/users/dwmw2/vpnc-scripts.git"; + rev = "c0122e891f7e033f35f047dad963702199d5cb9e"; + sha256 = "11b1ls012mb704jphqxjmqrfbbhkdjb64j2q4k8wb5jmja8jnd14"; +}; + +in stdenv.mkDerivation rec { + pname = "openconnect${lib.optionalString head "-head"}"; + version = if head then "2021-05-05" else "8.10"; + + src = + if head then fetchFromGitLab { + owner = "openconnect"; + repo = "openconnect"; + rev = "684f6db1aef78e61e01f511c728bf658c30b9114"; + sha256 = "0waclawcymgd8sq9xbkn2q8mnqp4pd0gpyv5wrnb7i0nsv860wz8"; + } + else fetchurl { + url = "ftp://ftp.infradead.org/pub/openconnect/${pname}-${version}.tar.gz"; + sha256 = "1cdsx4nsrwawbsisfkldfc9i4qn60g03vxb13nzppr2br9p4rrih"; + }; + + outputs = [ "out" "dev" ]; + + configureFlags = [ + "--with-vpnc-script=${vpnc}/vpnc-script" + "--disable-nls" + "--without-openssl-version-check" + ]; + + buildInputs = [ openssl gnutls gmp libxml2 stoken zlib ] + ++ lib.optional stdenv.isDarwin darwin.apple_sdk.frameworks.PCSC; + nativeBuildInputs = [ pkg-config ] + ++ lib.optional head autoreconfHook; + + meta = with lib; { + description = "VPN Client for Cisco's AnyConnect SSL VPN"; + homepage = "http://www.infradead.org/openconnect/"; + license = licenses.lgpl21Only; + maintainers = with maintainers; [ pradeepchhetri tricktron ]; + platforms = lib.platforms.linux ++ lib.platforms.darwin; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/openfortivpn/default.nix b/nixpkgs/pkgs/tools/networking/openfortivpn/default.nix new file mode 100644 index 000000000000..e02782cccbfd --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/openfortivpn/default.nix @@ -0,0 +1,48 @@ +{ stdenv, lib, fetchFromGitHub, autoreconfHook, pkg-config +, openssl, ppp +, systemd ? null }: + +let + withSystemd = stdenv.isLinux && !(systemd == null); + +in +stdenv.mkDerivation rec { + pname = "openfortivpn"; + version = "1.16.0"; + + src = fetchFromGitHub { + owner = "adrienverge"; + repo = pname; + rev = "v${version}"; + sha256 = "sha256-wijP9VGKXlxCAU3xN6+cv9+NGwBS55ql8WsZZ592b/k="; + }; + + # we cannot write the config file to /etc and as we don't need the file, so drop it + postPatch = '' + substituteInPlace Makefile.am \ + --replace '$(DESTDIR)$(confdir)' /tmp + ''; + + nativeBuildInputs = [ autoreconfHook pkg-config ]; + + buildInputs = [ + openssl ppp + ] + ++ lib.optional withSystemd systemd; + + configureFlags = [ + "--sysconfdir=/etc" + "--with-pppd=${ppp}/bin/pppd" + ] + ++ lib.optional withSystemd "--with-systemdsystemunitdir=${placeholder "out"}/lib/systemd/system"; + + enableParallelBuilding = true; + + meta = with lib; { + description = "Client for PPP+SSL VPN tunnel services"; + homepage = "https://github.com/adrienverge/openfortivpn"; + license = licenses.gpl3; + maintainers = with maintainers; [ madjar ]; + platforms = with platforms; linux ++ darwin; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/openntpd/default.nix b/nixpkgs/pkgs/tools/networking/openntpd/default.nix new file mode 100644 index 000000000000..e6703c748fce --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/openntpd/default.nix @@ -0,0 +1,42 @@ +{ lib, stdenv, fetchurl, libressl +, privsepPath ? "/var/empty" +, privsepUser ? "ntp" +}: + +stdenv.mkDerivation rec { + pname = "openntpd"; + version = "6.8p1"; + + src = fetchurl { + url = "mirror://openbsd/OpenNTPD/${pname}-${version}.tar.gz"; + sha256 = "0ijsylc7a4jlpxsqa0jq1w1c7333id8pcakzl7a5749ria1xp0l5"; + }; + + prePatch = '' + sed -i '20i#include <sys/cdefs.h>' src/ntpd.h + sed -i '19i#include <sys/cdefs.h>' src/log.c + ''; + + configureFlags = [ + "--with-privsep-path=${privsepPath}" + "--with-privsep-user=${privsepUser}" + "--sysconfdir=/etc" + "--localstatedir=/var" + "--with-cacert=/etc/ssl/certs/ca-certificates.crt" + ]; + + buildInputs = [ libressl ]; + + installFlags = [ + "sysconfdir=\${out}/etc" + "localstatedir=\${TMPDIR}" + ]; + + meta = with lib; { + homepage = "http://www.openntpd.org/"; + license = licenses.bsd3; + description = "OpenBSD NTP daemon (Debian port)"; + platforms = platforms.all; + maintainers = with maintainers; [ thoughtpolice ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/openresolv/default.nix b/nixpkgs/pkgs/tools/networking/openresolv/default.nix new file mode 100644 index 000000000000..f486c903c5d6 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/openresolv/default.nix @@ -0,0 +1,40 @@ +{ lib, stdenv, fetchurl, makeWrapper, coreutils }: + +stdenv.mkDerivation rec { + pname = "openresolv"; + version = "3.12.0"; + + src = fetchurl { + url = "mirror://roy/openresolv/${pname}-${version}.tar.xz"; + sha256 = "sha256-QrMFCOhXoihTXGMeqsk2hi2G7KaMFLXAvzh7oXa5G5c="; + }; + + nativeBuildInputs = [ makeWrapper ]; + + configurePhase = + '' + cat > config.mk <<EOF + PREFIX=$out + SYSCONFDIR=/etc + SBINDIR=$out/sbin + LIBEXECDIR=$out/libexec/resolvconf + VARDIR=/run/resolvconf + MANDIR=$out/share/man + RESTARTCMD=false + EOF + ''; + + installFlags = [ "SYSCONFDIR=$(out)/etc" ]; + + postInstall = '' + wrapProgram "$out/sbin/resolvconf" --set PATH "${coreutils}/bin" + ''; + + meta = { + description = "A program to manage /etc/resolv.conf"; + homepage = "https://roy.marples.name/projects/openresolv"; + license = lib.licenses.bsd2; + maintainers = [ lib.maintainers.eelco ]; + platforms = lib.platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/opensm/default.nix b/nixpkgs/pkgs/tools/networking/opensm/default.nix new file mode 100644 index 000000000000..a21fe68e8163 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/opensm/default.nix @@ -0,0 +1,32 @@ +{ lib, stdenv, fetchFromGitHub, autoconf, automake, libtool, bison, flex, rdma-core }: + +stdenv.mkDerivation rec { + pname = "opensm"; + version = "3.3.23"; + + src = fetchFromGitHub { + owner = "linux-rdma"; + repo = "opensm"; + rev = version; + sha256 = "0r0nw7b2711ca6mrj19ymg97x862hdxv54fhhm4kiqvdh6n75y0s"; + }; + + nativeBuildInputs = [ autoconf automake libtool bison flex ]; + + buildInputs = [ rdma-core ]; + + preConfigure = '' + patchShebangs ./autogen.sh + ./autogen.sh + ''; + + enableParallelBuilding = true; + + meta = with lib; { + description = "Infiniband subnet manager"; + homepage = "https://www.openfabrics.org/"; + license = licenses.gpl2; # dual licensed as 2-clause BSD + maintainers = [ maintainers.aij ]; + platforms = [ "x86_64-linux" ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/opensnitch/daemon.nix b/nixpkgs/pkgs/tools/networking/opensnitch/daemon.nix new file mode 100644 index 000000000000..d7359ea0e70c --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/opensnitch/daemon.nix @@ -0,0 +1,50 @@ +{ buildGoModule +, fetchFromGitHub +, fetchpatch +, pkg-config +, libnetfilter_queue +, libnfnetlink +, lib +}: + +buildGoModule rec { + pname = "opensnitch"; + version = "1.3.6"; + + src = fetchFromGitHub { + owner = "evilsocket"; + repo = "opensnitch"; + rev = "v${version}"; + sha256 = "sha256-Cgo+bVQQeUZuYYhA1WSqlLyQQGAeXbbNno9LS7oNvhI="; + }; + + patches = [ + # https://github.com/evilsocket/opensnitch/pull/384 don't require + # a configuration file in /etc + (fetchpatch { + name = "dont-require-config-in-etc.patch"; + url = "https://github.com/evilsocket/opensnitch/commit/8a3f63f36aa92658217bbbf46d39e6d20b2c0791.patch"; + sha256 = "sha256-WkwjKTQZppR0nqvRO4xiQoKZ307NvuUwoRx+boIpuTg="; + }) + ]; + + modRoot = "daemon"; + + postBuild = '' + mv $GOPATH/bin/daemon $GOPATH/bin/opensnitchd + ''; + + vendorSha256 = "sha256-LMwQBFkHg1sWIUITLOX2FZi5QUfOivvrkcl9ELO3Trk="; + + nativeBuildInputs = [ pkg-config ]; + + buildInputs = [ libnetfilter_queue libnfnetlink ]; + + meta = with lib; { + description = "An application firewall"; + homepage = "https://github.com/evilsocket/opensnitch/wiki"; + license = licenses.gpl3Only; + maintainers = [ maintainers.raboof ]; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/opensnitch/ui.nix b/nixpkgs/pkgs/tools/networking/opensnitch/ui.nix new file mode 100644 index 000000000000..69b26492282d --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/opensnitch/ui.nix @@ -0,0 +1,46 @@ +{ python3Packages +, fetchFromGitHub +, wrapQtAppsHook +, lib +}: + +python3Packages.buildPythonApplication rec { + pname = "opensnitch-ui"; + version = "1.3.6"; + + src = fetchFromGitHub { + owner = "evilsocket"; + repo = "opensnitch"; + rev = "v${version}"; + sha256 = "sha256-Cgo+bVQQeUZuYYhA1WSqlLyQQGAeXbbNno9LS7oNvhI="; + }; + + nativeBuildInputs = [ wrapQtAppsHook ]; + + propagatedBuildInputs = with python3Packages; [ + grpcio-tools + pyqt5 + unidecode + unicode-slugify + pyinotify + ]; + + preConfigure = '' + cd ui + ''; + + preCheck = '' + export PYTHONPATH=opensnitch:$PYTHONPATH + ''; + + dontWrapQtApps = true; + makeWrapperArgs = [ "\${qtWrapperArgs[@]}" ]; + + meta = with lib; { + description = "An application firewall"; + homepage = "https://github.com/evilsocket/opensnitch/wiki"; + license = licenses.gpl3Only; + maintainers = [ maintainers.raboof ]; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/openssh/common.nix b/nixpkgs/pkgs/tools/networking/openssh/common.nix new file mode 100644 index 000000000000..40011a14c893 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/openssh/common.nix @@ -0,0 +1,127 @@ +{ pname +, version +, extraDesc ? "" +, src +, extraPatches ? [] +, extraNativeBuildInputs ? [] +, extraMeta ? {} +}: + +{ lib, stdenv +# This *is* correct, though unusual. as a way of getting krb5-config from the +# package without splicing See: https://github.com/NixOS/nixpkgs/pull/107606 +, pkgs +, fetchurl +, fetchpatch +, zlib +, openssl +, libedit +, pkg-config +, pam +, etcDir ? null +, withKerberos ? !(stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) +, libkrb5 +, libfido2 +, nixosTests +, withFIDO ? stdenv.hostPlatform.isUnix && !stdenv.hostPlatform.isMusl +, linkOpenssl ? true +}: + +with lib; +stdenv.mkDerivation rec { + inherit pname version src; + + patches = [ + ./locale_archive.patch + + # See discussion in https://github.com/NixOS/nixpkgs/pull/16966 + ./dont_create_privsep_path.patch + ] ++ extraPatches; + + postPatch = + # On Hydra this makes installation fail (sometimes?), + # and nix store doesn't allow such fancy permission bits anyway. + '' + substituteInPlace Makefile.in --replace '$(INSTALL) -m 4711' '$(INSTALL) -m 0711' + ''; + + nativeBuildInputs = [ pkg-config ] + # This is not the same as the libkrb5 from the inputs! pkgs.libkrb5 is + # needed here to access krb5-config in order to cross compile. See: + # https://github.com/NixOS/nixpkgs/pull/107606 + ++ optional withKerberos pkgs.libkrb5 + ++ extraNativeBuildInputs; + buildInputs = [ zlib openssl libedit ] + ++ optional withFIDO libfido2 + ++ optional withKerberos libkrb5 + ++ optional stdenv.isLinux pam; + + preConfigure = '' + # Setting LD causes `configure' and `make' to disagree about which linker + # to use: `configure' wants `gcc', but `make' wants `ld'. + unset LD + '' + # Upstream build system does not support static build, so we fall back + # on fragile patching of configure script. + # + # libedit is found by pkg-config, but without --static flag, required + # to get also transitive dependencies for static linkage, hence sed + # expression. + # + # Kerberos can be found either by krb5-config or by fall-back shell + # code in openssh's configure.ac. Neither of them support static + # build, but patching code for krb5-config is simpler, so to get it + # into PATH, libkrb5.dev is added into buildInputs. + + optionalString stdenv.hostPlatform.isStatic '' + sed -i "s,PKGCONFIG --libs,PKGCONFIG --libs --static,g" configure + sed -i 's#KRB5CONF --libs`#KRB5CONF --libs` -lkrb5support -lkeyutils#g' configure + sed -i 's#KRB5CONF --libs gssapi`#KRB5CONF --libs gssapi` -lkrb5support -lkeyutils#g' configure + ''; + + # I set --disable-strip because later we strip anyway. And it fails to strip + # properly when cross building. + configureFlags = [ + "--sbindir=\${out}/bin" + "--localstatedir=/var" + "--with-pid-dir=/run" + "--with-mantype=man" + "--with-libedit=yes" + "--disable-strip" + (if stdenv.isLinux then "--with-pam" else "--without-pam") + ] ++ optional (etcDir != null) "--sysconfdir=${etcDir}" + ++ optional withFIDO "--with-security-key-builtin=yes" + ++ optional withKerberos (assert libkrb5 != null; "--with-kerberos5=${libkrb5}") + ++ optional stdenv.isDarwin "--disable-libutil" + ++ optional (!linkOpenssl) "--without-openssl"; + + buildFlags = [ "SSH_KEYSIGN=ssh-keysign" ]; + + enableParallelBuilding = true; + + hardeningEnable = [ "pie" ]; + + postInstall = '' + # Install ssh-copy-id, it's very useful. + cp contrib/ssh-copy-id $out/bin/ + chmod +x $out/bin/ssh-copy-id + cp contrib/ssh-copy-id.1 $out/share/man/man1/ + ''; + + installTargets = [ "install-nokeys" ]; + installFlags = [ + "sysconfdir=\${out}/etc/ssh" + ]; + + passthru.tests = { + borgbackup-integration = nixosTests.borgbackup; + }; + + meta = { + description = "An implementation of the SSH protocol${extraDesc}"; + homepage = "https://www.openssh.com/"; + changelog = "https://www.openssh.com/releasenotes.html"; + license = licenses.bsd2; + platforms = platforms.unix ++ platforms.windows; + maintainers = with maintainers; [ eelco aneeshusa ]; + } // extraMeta; +} diff --git a/nixpkgs/pkgs/tools/networking/openssh/copyid.nix b/nixpkgs/pkgs/tools/networking/openssh/copyid.nix new file mode 100644 index 000000000000..71baa6a23f1f --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/openssh/copyid.nix @@ -0,0 +1,11 @@ +{ runCommandNoCC, openssh }: + +runCommandNoCC "ssh-copy-id-${openssh.version}" { + meta = openssh.meta // { + description = "A tool to copy SSH public keys to a remote machine"; + priority = (openssh.meta.priority or 0) - 1; + }; +} '' + install -Dm 755 {${openssh},$out}/bin/ssh-copy-id + install -Dm 644 {${openssh},$out}/share/man/man1/ssh-copy-id.1.gz +'' diff --git a/nixpkgs/pkgs/tools/networking/openssh/default.nix b/nixpkgs/pkgs/tools/networking/openssh/default.nix new file mode 100644 index 000000000000..4cc943fc75f5 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/openssh/default.nix @@ -0,0 +1,71 @@ +{ callPackage, fetchurl, fetchpatch, autoreconfHook }: +let + common = opts: callPackage (import ./common.nix opts) {}; +in { + + openssh = common rec { + pname = "openssh"; + version = "8.6p1"; + + src = fetchurl { + url = "mirror://openbsd/OpenSSH/portable/openssh-${version}.tar.gz"; + sha256 = "1bnpivgk98h2f9afpp88jv6g9ps83vnpxd031n2jqxi12vdf9rn3"; + }; + + extraPatches = [ ./ssh-keysign-8.5.patch ]; + }; + + openssh_hpn = common rec { + pname = "openssh-with-hpn"; + version = "8.4p1"; + extraDesc = " with high performance networking patches"; + + src = fetchurl { + url = "https://github.com/rapier1/openssh-portable/archive/hpn-KitchenSink-${builtins.replaceStrings [ "." "p" ] [ "_" "_P" ] version}.tar.gz"; + sha256 = "1x2afjy1isslbg7qlvhhs4zhj2c8q2h1ljz0fc5b4h9pqcm9j540"; + }; + + extraPatches = [ + ./ssh-keysign-8.4.patch + + # See https://github.com/openssh/openssh-portable/pull/206 + ./ssh-copy-id-fix-eof.patch + ]; + + extraNativeBuildInputs = [ autoreconfHook ]; + + extraMeta.knownVulnerabilities = [ + "CVE-2021-28041" + ]; + }; + + openssh_gssapi = common rec { + pname = "openssh-with-gssapi"; + version = "8.4p1"; + extraDesc = " with GSSAPI support"; + + src = fetchurl { + url = "mirror://openbsd/OpenSSH/portable/openssh-${version}.tar.gz"; + sha256 = "091b3pxdlj47scxx6kkf4agkx8c8sdacdxx8m1dw1cby80pd40as"; + }; + + extraPatches = [ + ./ssh-keysign-8.4.patch + + # See https://github.com/openssh/openssh-portable/pull/206 + ./ssh-copy-id-fix-eof.patch + + (fetchpatch { + name = "openssh-gssapi.patch"; + url = "https://salsa.debian.org/ssh-team/openssh/raw/debian/1%25${version}-2/debian/patches/gssapi.patch"; + sha256 = "1z1ckzimlkm1dmr9f5fqjnjg28gsqcwx6xka0klak857548d2lp2"; + }) + ]; + + extraNativeBuildInputs = [ autoreconfHook ]; + + extraMeta.knownVulnerabilities = [ + "CVE-2021-28041" + ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/openssh/dont_create_privsep_path.patch b/nixpkgs/pkgs/tools/networking/openssh/dont_create_privsep_path.patch new file mode 100644 index 000000000000..23f3ab67a087 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/openssh/dont_create_privsep_path.patch @@ -0,0 +1,12 @@ +diff --git i/Makefile.in w/Makefile.in +index 04e1c8e5..9bd5d01b 100644 +--- i/Makefile.in ++++ w/Makefile.in +@@ -329,7 +329,6 @@ install-files: + $(MKDIR_P) $(DESTDIR)$(mandir)/$(mansubdir)5 + $(MKDIR_P) $(DESTDIR)$(mandir)/$(mansubdir)8 + $(MKDIR_P) $(DESTDIR)$(libexecdir) +- $(MKDIR_P) -m 0755 $(DESTDIR)$(PRIVSEP_PATH) + $(INSTALL) -m 0755 $(STRIP_OPT) ssh$(EXEEXT) $(DESTDIR)$(bindir)/ssh$(EXEEXT) + $(INSTALL) -m 0755 $(STRIP_OPT) scp$(EXEEXT) $(DESTDIR)$(bindir)/scp$(EXEEXT) + $(INSTALL) -m 0755 $(STRIP_OPT) ssh-add$(EXEEXT) $(DESTDIR)$(bindir)/ssh-add$(EXEEXT) diff --git a/nixpkgs/pkgs/tools/networking/openssh/locale_archive.patch b/nixpkgs/pkgs/tools/networking/openssh/locale_archive.patch new file mode 100644 index 000000000000..3fe4a21ea47e --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/openssh/locale_archive.patch @@ -0,0 +1,15 @@ +diff --git i/session.c w/session.c +index 58826db1..658dd911 100644 +--- i/session.c ++++ w/session.c +@@ -1053,6 +1053,10 @@ do_setup_env(struct ssh *ssh, Session *s, const char *shell) + if (getenv("TZ")) + child_set_env(&env, &envsize, "TZ", getenv("TZ")); + ++ /* NixOS path to the glibc locale archive, to be set in the systemd job */ ++ if (getenv("LOCALE_ARCHIVE")) ++ child_set_env(&env, &envsize, "LOCALE_ARCHIVE", getenv("LOCALE_ARCHIVE")); ++ + /* Set custom environment options from pubkey authentication. */ + if (options.permit_user_env) { + for (n = 0 ; n < auth_opts->nenv; n++) { diff --git a/nixpkgs/pkgs/tools/networking/openssh/ssh-copy-id-fix-eof.patch b/nixpkgs/pkgs/tools/networking/openssh/ssh-copy-id-fix-eof.patch new file mode 100644 index 000000000000..4ba2b562f556 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/openssh/ssh-copy-id-fix-eof.patch @@ -0,0 +1,21 @@ +diff --git a/contrib/ssh-copy-id b/contrib/ssh-copy-id +index 392f64f..a769077 100644 +--- a/contrib/ssh-copy-id ++++ b/contrib/ssh-copy-id +@@ -247,7 +247,7 @@ installkeys_sh() { + # the -z `tail ...` checks for a trailing newline. The echo adds one if was missing + # the cat adds the keys we're getting via STDIN + # and if available restorecon is used to restore the SELinux context +- INSTALLKEYS_SH=$(tr '\t\n' ' ' <<-EOF) ++ INSTALLKEYS_SH=$(tr '\t\n' ' ' <<-EOF + cd; + umask 077; + mkdir -p $(dirname "${AUTH_KEY_FILE}") && +@@ -258,6 +258,7 @@ installkeys_sh() { + restorecon -F .ssh ${AUTH_KEY_FILE}; + fi + EOF ++ ) + + # to defend against quirky remote shells: use 'exec sh -c' to get POSIX; + printf "exec sh -c '%s'" "${INSTALLKEYS_SH}" diff --git a/nixpkgs/pkgs/tools/networking/openssh/ssh-keysign-8.4.patch b/nixpkgs/pkgs/tools/networking/openssh/ssh-keysign-8.4.patch new file mode 100644 index 000000000000..8ef3ad0126aa --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/openssh/ssh-keysign-8.4.patch @@ -0,0 +1,28 @@ +diff --git a/pathnames.h b/pathnames.h +index cb44caa4..81ce3367 100644 +--- a/pathnames.h ++++ b/pathnames.h +@@ -123,9 +123,7 @@ + #endif + + /* Location of ssh-keysign for hostbased authentication */ +-#ifndef _PATH_SSH_KEY_SIGN +-#define _PATH_SSH_KEY_SIGN "/usr/libexec/ssh-keysign" +-#endif ++#define _PATH_SSH_KEY_SIGN "ssh-keysign" + + /* Location of ssh-pkcs11-helper to support keys in tokens */ + #ifndef _PATH_SSH_PKCS11_HELPER +diff --git a/sshconnect2.c b/sshconnect2.c +index 1675f393..32ed70d1 100644 +--- a/sshconnect2.c ++++ b/sshconnect2.c +@@ -1854,7 +1854,7 @@ ssh_keysign(struct sshkey *key, u_char **sigp, size_t *lenp, + closefrom(sock + 1); + debug3("%s: [child] pid=%ld, exec %s", + __func__, (long)getpid(), _PATH_SSH_KEY_SIGN); +- execl(_PATH_SSH_KEY_SIGN, _PATH_SSH_KEY_SIGN, (char *)NULL); ++ execlp(_PATH_SSH_KEY_SIGN, _PATH_SSH_KEY_SIGN, (char *)NULL); + fatal("%s: exec(%s): %s", __func__, _PATH_SSH_KEY_SIGN, + strerror(errno)); + } diff --git a/nixpkgs/pkgs/tools/networking/openssh/ssh-keysign-8.5.patch b/nixpkgs/pkgs/tools/networking/openssh/ssh-keysign-8.5.patch new file mode 100644 index 000000000000..67c45b6b7d89 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/openssh/ssh-keysign-8.5.patch @@ -0,0 +1,24 @@ +diff --git a/pathnames.h b/pathnames.h +index cb44caa4..354fdf05 100644 +--- a/pathnames.h ++++ b/pathnames.h +@@ -124,7 +124,7 @@ + + /* Location of ssh-keysign for hostbased authentication */ + #ifndef _PATH_SSH_KEY_SIGN +-#define _PATH_SSH_KEY_SIGN "/usr/libexec/ssh-keysign" ++#define _PATH_SSH_KEY_SIGN "ssh-keysign" + #endif + + /* Location of ssh-pkcs11-helper to support keys in tokens */ +--- a/sshconnect2.c ++++ b/sshconnect2.c +@@ -2021,7 +2021,7 @@ + + debug3_f("[child] pid=%ld, exec %s", + (long)getpid(), _PATH_SSH_KEY_SIGN); +- execl(_PATH_SSH_KEY_SIGN, _PATH_SSH_KEY_SIGN, (char *)NULL); ++ execlp(_PATH_SSH_KEY_SIGN, _PATH_SSH_KEY_SIGN, (char *)NULL); + fatal_f("exec(%s): %s", _PATH_SSH_KEY_SIGN, + strerror(errno)); + } diff --git a/nixpkgs/pkgs/tools/networking/openvpn/default.nix b/nixpkgs/pkgs/tools/networking/openvpn/default.nix new file mode 100644 index 000000000000..46375b60fe46 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/openvpn/default.nix @@ -0,0 +1,89 @@ +{ lib, stdenv +, fetchurl +, pkg-config +, makeWrapper +, runtimeShell +, iproute2 +, lzo +, openssl +, pam +, useSystemd ? stdenv.isLinux +, systemd +, util-linux +, pkcs11Support ? false +, pkcs11helper +}: + +with lib; +let + # Check if the script needs to have other binaries wrapped when changing this. + update-resolved = fetchurl { + url = "https://raw.githubusercontent.com/jonathanio/update-systemd-resolved/v1.3.0/update-systemd-resolved"; + sha256 = "021qzv1k0zxgv1rmyfpqj3zlzqr28xa7zff1n7vrbjk36ijylpsc"; + }; + + generic = { version, sha256 }: + let + withIpRoute = stdenv.isLinux && (versionOlder version "2.5"); + in + stdenv.mkDerivation + rec { + pname = "openvpn"; + inherit version; + + src = fetchurl { + url = "https://swupdate.openvpn.net/community/releases/${pname}-${version}.tar.xz"; + inherit sha256; + }; + + nativeBuildInputs = [ makeWrapper pkg-config ]; + + buildInputs = [ lzo openssl ] + ++ optional stdenv.isLinux pam + ++ optional withIpRoute iproute2 + ++ optional useSystemd systemd + ++ optional pkcs11Support pkcs11helper; + + configureFlags = optionals withIpRoute [ + "--enable-iproute2" + "IPROUTE=${iproute2}/sbin/ip" + ] + ++ optional useSystemd "--enable-systemd" + ++ optional pkcs11Support "--enable-pkcs11" + ++ optional stdenv.isDarwin "--disable-plugin-auth-pam"; + + postInstall = '' + mkdir -p $out/share/doc/openvpn/examples + cp -r sample/sample-config-files/ $out/share/doc/openvpn/examples + cp -r sample/sample-keys/ $out/share/doc/openvpn/examples + cp -r sample/sample-scripts/ $out/share/doc/openvpn/examples + '' + optionalString useSystemd '' + install -Dm555 ${update-resolved} $out/libexec/update-systemd-resolved + wrapProgram $out/libexec/update-systemd-resolved \ + --prefix PATH : ${makeBinPath [ runtimeShell iproute2 systemd util-linux ]} + ''; + + enableParallelBuilding = true; + + meta = with lib; { + description = "A robust and highly flexible tunneling application"; + downloadPage = "https://openvpn.net/community-downloads/"; + homepage = "https://openvpn.net/"; + license = licenses.gpl2; + maintainers = with maintainers; [ viric peterhoeg ]; + platforms = platforms.unix; + }; + }; + +in +{ + openvpn_24 = generic { + version = "2.4.11"; + sha256 = "06s4m0xvixjhd3azrzbsf4j86kah4xwr2jp6cmcpc7db33rfyyg5"; + }; + + openvpn = generic { + version = "2.5.2"; + sha256 = "sha256-sSdDg2kB82Xvr4KrJJOWfhshwh60POmo2hACoXycHcg="; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/openvpn/openvpn-auth-ldap.nix b/nixpkgs/pkgs/tools/networking/openvpn/openvpn-auth-ldap.nix new file mode 100644 index 000000000000..70dacddafc37 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/openvpn/openvpn-auth-ldap.nix @@ -0,0 +1,61 @@ +{ lib +, stdenv +, fetchFromGitHub +, autoreconfHook +, gnustep +, re2c +, openldap +, openssl +, openvpn +}: + +stdenv.mkDerivation rec { + pname = "openvpn-auth-ldap"; + version = "2.0.4"; + + src = fetchFromGitHub { + owner = "threerings"; + repo = "openvpn-auth-ldap"; + rev = "auth-ldap-${version}"; + sha256 = "1j30sygj8nm8wjqxzpb7pfzr3dxqxggswzxd7z5yk7y04c0yp1hb"; + }; + + nativeBuildInputs = [ + autoreconfHook + gnustep.base + gnustep.libobjc + gnustep.make + re2c + ]; + + buildInputs = [ + openldap + openssl + openvpn + ]; + + configureFlags = [ + "--with-objc-runtime=GNU" + "--with-openvpn=${openvpn}/include" + "--libdir=$(out)/lib/openvpn" + ]; + + doCheck = true; + + preInstall = '' + mkdir -p $out/lib/openvpn $out/share/doc/openvpn/examples + cp README.md $out/share/doc/openvpn/ + cp auth-ldap.conf $out/share/doc/openvpn/examples/ + ''; + + meta = with lib; { + description = "LDAP authentication plugin for OpenVPN"; + homepage = "https://github.com/threerings/openvpn-auth-ldap"; + license = [ + licenses.asl20 + licenses.bsd3 + ]; + maintainers = [ maintainers.benley ]; + platforms = platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/openvpn/openvpn_learnaddress.nix b/nixpkgs/pkgs/tools/networking/openvpn/openvpn_learnaddress.nix new file mode 100644 index 000000000000..2120679fef3e --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/openvpn/openvpn_learnaddress.nix @@ -0,0 +1,28 @@ +{ lib, stdenv, fetchgit, makeWrapper, coreutils, gawk, util-linux }: + +stdenv.mkDerivation { + name = "openvpn-learnaddress-19b03c3"; + + src = fetchgit { + url = "https://gist.github.com/4058733.git"; + rev = "19b03c3beb0190df46ea07bf4b68244acb8eae80"; + sha256 = "16pcyvyhwsx34i0cjkkx906lmrwdd9gvznvqdwlad4ha8l8f8z42"; + }; + + nativeBuildInputs = [ makeWrapper ]; + buildInputs = [ coreutils gawk util-linux ]; + + installPhase = '' + install -Dm555 ovpn-learnaddress $out/libexec/openvpn/openvpn-learnaddress + + wrapProgram $out/libexec/openvpn/openvpn-learnaddress \ + --prefix PATH : ${lib.makeBinPath [ coreutils gawk util-linux ]} + ''; + + meta = { + description = "Openvpn learn-address script to manage a hosts-like file"; + homepage = "https://gist.github.com/offlinehacker/4058733/"; + maintainers = [ lib.maintainers.offline ]; + platforms = lib.platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/openvpn/update-resolv-conf.nix b/nixpkgs/pkgs/tools/networking/openvpn/update-resolv-conf.nix new file mode 100644 index 000000000000..d71ab72901bc --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/openvpn/update-resolv-conf.nix @@ -0,0 +1,34 @@ +{ stdenv, lib, fetchFromGitHub, makeWrapper, openresolv, coreutils, systemd }: + +let + binPath = lib.makeBinPath [ coreutils openresolv systemd ]; + +in stdenv.mkDerivation { + name = "update-resolv-conf-2017-06-21"; + + src = fetchFromGitHub { + owner = "masterkorp"; + repo = "openvpn-update-resolv-conf"; + rev = "43093c2f970bf84cd374e18ec05ac6d9cae444b8"; + sha256 = "1lf66bsgv2w6nzg1iqf25zpjf4ckcr45adkpgdq9gvhkfnvlp8av"; + }; + + nativeBuildInputs = [ makeWrapper ]; + + installPhase = '' + install -Dm555 update-resolv-conf.sh $out/libexec/openvpn/update-resolv-conf + install -Dm555 update-systemd-network.sh $out/libexec/openvpn/update-systemd-network + + for i in $out/libexec/openvpn/*; do + wrapProgram $i --prefix PATH : ${binPath} + done + ''; + + meta = with lib; { + description = "Script to update your /etc/resolv.conf with DNS settings that come from the received push dhcp-options"; + homepage = "https://github.com/masterkorp/openvpn-update-resolv-conf/"; + maintainers = with maintainers; [ abbradar ]; + license = licenses.gpl2; + platforms = platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/openvpn/update-systemd-resolved.nix b/nixpkgs/pkgs/tools/networking/openvpn/update-systemd-resolved.nix new file mode 100644 index 000000000000..5a34d5a7ffe7 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/openvpn/update-systemd-resolved.nix @@ -0,0 +1,34 @@ +{ lib, stdenv, fetchFromGitHub +, makeWrapper +, iproute2, systemd, coreutils, util-linux }: + +stdenv.mkDerivation rec { + pname = "update-systemd-resolved"; + version = "1.3.0"; + + src = fetchFromGitHub { + owner = "jonathanio"; + repo = "update-systemd-resolved"; + rev = "v${version}"; + sha256 = "19zhbpyms57yb70hi0ws5sbkpk2yqp9nnix3f86r36h1g93m70lm"; + }; + + nativeBuildInputs = [ makeWrapper ]; + + buildFlags = [ + "PREFIX=${placeholder "out"}/libexec/openvpn" + ]; + + installPhase = '' + wrapProgram $out/libexec/openvpn/update-systemd-resolved \ + --prefix PATH : ${lib.makeBinPath [ iproute2 systemd coreutils util-linux ]} + ''; + + meta = with lib; { + description = "Helper script for OpenVPN to directly update the DNS settings of a link through systemd-resolved via DBus"; + homepage = "https://github.com/jonathanio/update-systemd-resolved"; + maintainers = with maintainers; [ eadwu ]; + license = licenses.gpl3; + platforms = platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/p2p/amule/default.nix b/nixpkgs/pkgs/tools/networking/p2p/amule/default.nix new file mode 100644 index 000000000000..96bf7656e8ae --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/p2p/amule/default.nix @@ -0,0 +1,74 @@ +{ monolithic ? true # build monolithic amule +, enableDaemon ? false # build amule daemon +, httpServer ? false # build web interface for the daemon +, client ? false # build amule remote gui +, fetchFromGitHub +, stdenv +, lib +, cmake +, zlib +, wxGTK +, perl +, cryptopp +, libupnp +, gettext +, libpng +, autoreconfHook +, pkg-config +, makeWrapper +, libX11 +}: + +stdenv.mkDerivation rec { + pname = "amule"; + version = "2.3.3"; + + src = fetchFromGitHub { + owner = "amule-project"; + repo = "amule"; + rev = version; + sha256 = "1nm4vxgmisn1b6l3drmz0q04x067j2i8lw5rnf0acaapwlp8qwvi"; + }; + + nativeBuildInputs = [ cmake gettext makeWrapper pkg-config ]; + + buildInputs = [ + zlib wxGTK perl cryptopp.dev libupnp + ] ++ lib.optional httpServer libpng + ++ lib.optional client libX11; + + cmakeFlags = [ + "-DBUILD_MONOLITHIC=${if monolithic then "ON" else "OFF"}" + "-DBUILD_DAEMON=${if enableDaemon then "ON" else "OFF"}" + "-DBUILD_REMOTEGUI=${if client then "ON" else "OFF"}" + "-DBUILD_WEBSERVER=${if httpServer then "ON" else "OFF"}" + ]; + + # aMule will try to `dlopen' libupnp and libixml, so help it + # find them. + postInstall = lib.optionalString monolithic '' + wrapProgram $out/bin/amule \ + --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ libupnp ]} + ''; + + meta = with lib; { + description = "Peer-to-peer client for the eD2K and Kademlia networks"; + longDescription = '' + aMule is an eMule-like client for the eD2k and Kademlia + networks, supporting multiple platforms. Currently aMule + (officially) supports a wide variety of platforms and operating + systems, being compatible with more than 60 different + hardware+OS configurations. aMule is entirely free, its + sourcecode released under the GPL just like eMule, and includes + no adware or spyware as is often found in proprietary P2P + applications. + ''; + + homepage = "https://github.com/amule-project/amule"; + license = licenses.gpl2Plus; + maintainers = with maintainers; [ phreedom ]; + platforms = platforms.unix; + # cmake fails: Cannot specify link libraries for target "wxWidgets::ADV" which is not built by this project. + broken = enableDaemon; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/p2p/azureus/builder.sh b/nixpkgs/pkgs/tools/networking/p2p/azureus/builder.sh new file mode 100644 index 000000000000..9d41dba2e439 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/p2p/azureus/builder.sh @@ -0,0 +1,19 @@ +source $stdenv/setup + +mkdir -p $out/jars +cp $src $out/jars/azureus.jar + +mkdir -p $out/bin +cat > $out/bin/azureus <<EOF +#! $SHELL -e +azureusHome=$out +if test -n "\$HOME"; then + azureusHome=\$HOME/.Azureus +fi +exec $jdk/bin/java -Xms16m -Xmx128m \ + -cp $out/jars/azureus.jar:$swt/jars/swt.jar \ + -Djava.library.path=$swt/lib \ + -Dazureus.install.path=\$azureusHome \ + org.gudy.azureus2.ui.swt.Main +EOF +chmod +x $out/bin/azureus diff --git a/nixpkgs/pkgs/tools/networking/p2p/azureus/default.nix b/nixpkgs/pkgs/tools/networking/p2p/azureus/default.nix new file mode 100644 index 000000000000..1c72be0c5100 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/p2p/azureus/default.nix @@ -0,0 +1,16 @@ +{lib, stdenv, fetchurl, jdk, swt}: + +stdenv.mkDerivation { + name = "azureus-2.3.0.6"; + builder = ./builder.sh; + src = fetchurl { + url = "http://tarballs.nixos.org/Azureus2.3.0.6.jar"; + sha256 = "1hwrh3n0b0jbpsdk15zrs7pw175418phhmg6pn4xi1bvilxq1wrd"; + }; + + inherit jdk swt; + + meta = { + platforms = lib.platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/p2p/gtk-gnutella/default.nix b/nixpkgs/pkgs/tools/networking/p2p/gtk-gnutella/default.nix new file mode 100644 index 000000000000..0c0bc3705263 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/p2p/gtk-gnutella/default.nix @@ -0,0 +1,73 @@ +{ lib, stdenv +, fetchFromGitHub +, fetchpatch +, bison +, pkg-config +, gettext +, desktop-file-utils +, glib +, gtk2 +, libxml2 +, libbfd +, zlib +, binutils +, gnutls +, enableGui ? true +}: + +stdenv.mkDerivation rec { + pname = "gtk-gnutella"; + # NOTE: Please remove hardeningDisable on the next release, see: + # https://sourceforge.net/p/gtk-gnutella/bugs/555/#5c19 + version = "1.2.0"; + + src = fetchFromGitHub { + owner = "gtk-gnutella"; + repo = "gtk-gnutella"; + rev = "v${version}"; + sha256 = "0j596dpajk68bkry0gmpqawsi61rphfciy4vji1dh890jyhkhdgy"; + }; + + nativeBuildInputs = [ + bison + desktop-file-utils + gettext + pkg-config + ]; + buildInputs = [ + glib + gnutls + libbfd + libxml2 + zlib + ] + ++ + lib.optionals (enableGui) [ gtk2 ] + ; + + configureScript = "./build.sh"; + configureFlags = [ + "--configure-only" + # See https://sourceforge.net/p/gtk-gnutella/bugs/555/ + "--disable-malloc" + ] + ++ lib.optionals (!enableGui) [ "--topless" ] + ; + + hardeningDisable = [ "bindnow" "fortify" "pic" "relro" ]; + + enableParallelBuilding = true; + + postInstall = '' + install -Dm0444 src/${pname}.man $out/share/man/man1/${pname}.1 + ''; + + meta = with lib; { + description = "A GTK Gnutella client, optimized for speed and scalability"; + homepage = "http://gtk-gnutella.sourceforge.net/"; # Code: https://github.com/gtk-gnutella/gtk-gnutella + changelog = "https://raw.githubusercontent.com/gtk-gnutella/gtk-gnutella/v${version}/ChangeLog"; + maintainers = [ maintainers.doronbehar ]; + license = licenses.gpl2Plus; + platforms = platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/p2p/libtorrent-jesec/default.nix b/nixpkgs/pkgs/tools/networking/p2p/libtorrent-jesec/default.nix new file mode 100644 index 000000000000..0fd16f4799d6 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/p2p/libtorrent-jesec/default.nix @@ -0,0 +1,38 @@ +{ lib, stdenv, fetchFromGitHub, fetchpatch, cmake, gtest, openssl, zlib }: + +stdenv.mkDerivation rec { + pname = "libtorrent-jesec"; + version = "0.13.8-r2"; + + src = fetchFromGitHub { + owner = "jesec"; + repo = "libtorrent"; + rev = "v${version}"; + sha256 = "sha256-eIXVTbVOCRHcxSsLPvIm9F60t2upk5ORpDSOOYqTCJ4="; + }; + + patches = [ + (fetchpatch { + name = "test-fallback"; + url = "https://github.com/jesec/libtorrent/commit/a38205ce06aadc9908478ec3a9c8aefd9be06344.patch"; + sha256 = "sha256-2TyQ9zYWZw6bzAfVZzTOQSkfIZnDU8ykgpRAFXscEH0="; + }) + ]; + + nativeBuildInputs = [ cmake ]; + buildInputs = [ openssl zlib ]; + + doCheck = true; + preCheck = '' + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}$PWD + ''; + checkInputs = [ gtest ]; + + meta = with lib; { + description = "A BitTorrent library written in C++ for *nix, with focus on high performance and good code (jesec's fork)"; + homepage = "https://github.com/jesec/libtorrent"; + license = licenses.gpl2Plus; + maintainers = with maintainers; [ winterqt ]; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/p2p/libtorrent/default.nix b/nixpkgs/pkgs/tools/networking/p2p/libtorrent/default.nix new file mode 100644 index 000000000000..4d3ccf5fc150 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/p2p/libtorrent/default.nix @@ -0,0 +1,28 @@ +# NOTE: this is rakshava's version of libtorrent, used mainly by rtorrent +# This is NOT libtorrent-rasterbar, used by Deluge, qbitttorent, and others +{ lib, stdenv, fetchFromGitHub, pkg-config, autoreconfHook +, cppunit, openssl, libsigcxx, zlib +}: + +stdenv.mkDerivation rec { + pname = "libtorrent"; + version = "0.13.8"; + + src = fetchFromGitHub { + owner = "rakshasa"; + repo = pname; + rev = "v${version}"; + sha256 = "1h5y6ab3gs20yyprdfwcw8fh1c6czs4yrdj0kf54d2vp9qwz685r"; + }; + + nativeBuildInputs = [ pkg-config autoreconfHook ]; + buildInputs = [ cppunit openssl libsigcxx zlib ]; + + meta = with lib; { + homepage = "https://github.com/rakshasa/libtorrent"; + description = "A BitTorrent library written in C++ for *nix, with focus on high performance and good code"; + + platforms = platforms.unix; + maintainers = with maintainers; [ ebzzry codyopel ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/p2p/rtorrent-jesec/default.nix b/nixpkgs/pkgs/tools/networking/p2p/rtorrent-jesec/default.nix new file mode 100644 index 000000000000..eeff6e91399d --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/p2p/rtorrent-jesec/default.nix @@ -0,0 +1,57 @@ +{ lib +, stdenv +, fetchFromGitHub +, cmake +, gtest +, libtorrent-jesec +, curl +, ncurses +, xmlrpc_c +, nlohmann_json +, xmlRpcSupport ? true +, jsonRpcSupport ? true +}: +let + inherit (lib) optional; +in +stdenv.mkDerivation rec { + pname = "rtorrent-jesec"; + version = "0.9.8-r14"; + + src = fetchFromGitHub { + owner = "jesec"; + repo = "rtorrent"; + rev = "v${version}"; + sha256 = "sha256-AbjzNIha3MkCZi6MuyUfPx9r3zeXeTUzkbD7uHB85lo="; + }; + + nativeBuildInputs = [ cmake ]; + buildInputs = [ libtorrent-jesec curl ncurses ] + ++ optional xmlRpcSupport xmlrpc_c + ++ optional jsonRpcSupport nlohmann_json; + + cmakeFlags = [ "-DUSE_RUNTIME_CA_DETECTION=NO" ] + ++ optional (!xmlRpcSupport) "-DUSE_XMLRPC=NO" + ++ optional (!jsonRpcSupport) "-DUSE_JSONRPC=NO"; + + doCheck = true; + checkInputs = [ gtest ]; + + prePatch = '' + substituteInPlace src/main.cc \ + --replace "/etc/rtorrent/rtorrent.rc" "${placeholder "out"}/etc/rtorrent/rtorrent.rc" + ''; + + postFixup = '' + mkdir -p $out/etc/rtorrent + cp $src/doc/rtorrent.rc $out/etc/rtorrent/rtorrent.rc + ''; + + meta = with lib; { + description = "An ncurses client for libtorrent, ideal for use with screen, tmux, or dtach (jesec's fork)"; + homepage = "https://github.com/jesec/rtorrent"; + license = licenses.gpl2Plus; + maintainers = with maintainers; [ winterqt ]; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/p2p/rtorrent/default.nix b/nixpkgs/pkgs/tools/networking/p2p/rtorrent/default.nix new file mode 100644 index 000000000000..20f9cec6f5fe --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/p2p/rtorrent/default.nix @@ -0,0 +1,52 @@ +{ lib, stdenv, fetchurl, fetchFromGitHub, pkg-config +, libtool, autoconf, automake, cppunit +, libtorrent, ncurses, libsigcxx, curl +, zlib, openssl, xmlrpc_c + +# This no longer works +, colorSupport ? false +}: + +stdenv.mkDerivation rec { + pname = "rtorrent"; + version = "0.9.8"; + + src = fetchFromGitHub { + owner = "rakshasa"; + repo = pname; + rev = "v${version}"; + sha256 = "0hcaf1brk402caa7hhlb2r1c93mjzxkm8gb19xfl33gkp3jpf372"; + }; + + nativeBuildInputs = [ pkg-config ]; + buildInputs = [ + libtool autoconf automake cppunit + libtorrent ncurses libsigcxx curl zlib openssl xmlrpc_c + ]; + + # Optional patch adds support for custom configurable colors + # https://github.com/Chlorm/chlorm_overlay/blob/master/net-p2p/rtorrent/README.md + patches = lib.optional colorSupport (fetchurl { + url = "https://gist.githubusercontent.com/codyopel/a816c2993f8013b5f4d6/raw/b952b32da1dcf14c61820dfcf7df00bc8918fec4/rtorrent-color.patch"; + sha256 = "00gcl7yq6261rrfzpz2k8bd7mffwya0ifji1xqcvhfw50syk8965"; + }); + + preConfigure = "./autogen.sh"; + + configureFlags = [ "--with-xmlrpc-c" "--with-posix-fallocate" ]; + + postInstall = '' + mkdir -p $out/share/man/man1 $out/share/doc/rtorrent + mv doc/old/rtorrent.1 $out/share/man/man1/rtorrent.1 + mv doc/rtorrent.rc $out/share/doc/rtorrent/rtorrent.rc + ''; + + meta = with lib; { + homepage = "https://rakshasa.github.io/rtorrent/"; + description = "An ncurses client for libtorrent, ideal for use with screen, tmux, or dtach"; + + platforms = platforms.unix; + maintainers = with maintainers; [ ebzzry codyopel ]; + license = licenses.gpl2Plus; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/p2p/tahoe-lafs/default.nix b/nixpkgs/pkgs/tools/networking/p2p/tahoe-lafs/default.nix new file mode 100644 index 000000000000..d55a46f609b1 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/p2p/tahoe-lafs/default.nix @@ -0,0 +1,95 @@ +{ fetchurl, lib, nettools, pythonPackages, texinfo }: + +# FAILURES: The "running build_ext" phase fails to compile Twisted +# plugins, because it tries to write them into Twisted's (immutable) +# store path. The problem appears to be non-fatal, but there's probably +# some loss of functionality because of it. + +pythonPackages.buildPythonApplication rec { + version = "1.13.0"; + pname = "tahoe-lafs"; + namePrefix = ""; + + src = fetchurl { + url = "https://tahoe-lafs.org/downloads/tahoe-lafs-${version}.tar.bz2"; + sha256 = "11pfz9yyy6qkkyi0kskxlbn2drfppx6yawqyv4kpkrkj4q7x5m42"; + }; + + outputs = [ "out" "doc" "info" ]; + + postPatch = '' + sed -i "src/allmydata/util/iputil.py" \ + -es"|_linux_path = '/sbin/ifconfig'|_linux_path = '${nettools}/bin/ifconfig'|g" + + # Chroots don't have /etc/hosts and /etc/resolv.conf, so work around + # that. + for i in $(find src/allmydata/test -type f) + do + sed -i "$i" -e"s/localhost/127.0.0.1/g" + done + + sed -i 's/"zope.interface.*"/"zope.interface"/' src/allmydata/_auto_deps.py + sed -i 's/"pycrypto.*"/"pycrypto"/' src/allmydata/_auto_deps.py + ''; + + # Remove broken and expensive tests. + preConfigure = '' + ( + cd src/allmydata/test + + # Buggy? + rm cli/test_create.py test_backupdb.py + + # These require Tor and I2P. + rm test_connections.py test_iputil.py test_hung_server.py test_i2p_provider.py test_tor_provider.py + + # Expensive + rm test_system.py + ) + ''; + + nativeBuildInputs = with pythonPackages; [ sphinx texinfo ]; + + # The `backup' command requires `sqlite3'. + propagatedBuildInputs = with pythonPackages; [ + twisted foolscap nevow simplejson zfec pycryptopp darcsver + setuptoolsTrial setuptoolsDarcs pycrypto pyasn1 zope_interface + service-identity pyyaml magic-wormhole treq characteristic + ]; + + checkInputs = with pythonPackages; [ mock hypothesis twisted ]; + + # Install the documentation. + postInstall = '' + ( + cd docs + + make singlehtml + mkdir -p "$doc/share/doc/${pname}-${version}" + cp -rv _build/singlehtml/* "$doc/share/doc/${pname}-${version}" + + make info + mkdir -p "$info/share/info" + cp -rv _build/texinfo/*.info "$info/share/info" + ) + ''; + + checkPhase = '' + trial --rterrors allmydata + ''; + + meta = { + description = "Tahoe-LAFS, a decentralized, fault-tolerant, distributed storage system"; + longDescription = '' + Tahoe-LAFS is a secure, decentralized, fault-tolerant filesystem. + This filesystem is encrypted and spread over multiple peers in + such a way that it remains available even when some of the peers + are unavailable, malfunctioning, or malicious. + ''; + homepage = "http://tahoe-lafs.org/"; + license = [ lib.licenses.gpl2Plus /* or */ "TGPPLv1+" ]; + maintainers = with lib.maintainers; [ MostAwesomeDude ]; + platforms = lib.platforms.gnu ++ lib.platforms.linux; + broken = true; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/packetdrill/default.nix b/nixpkgs/pkgs/tools/networking/packetdrill/default.nix new file mode 100644 index 000000000000..861e9c0383bb --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/packetdrill/default.nix @@ -0,0 +1,41 @@ +{ lib, stdenv, fetchFromGitHub, bison, flex, cmake, libpcap }: +stdenv.mkDerivation rec { + pname = "packetdrill"; + version = "unstable-2020-08-22"; + + src = fetchFromGitHub { + owner = "google"; + repo = "packetdrill"; + rev = "68a34fa73cf221e5f52d6fa4f203bcd93062be1b"; + sha256 = "0djkwb6l2959f44d98vwb092rghf0qmii8391vrpxqb99j6pv4h6"; + }; + setSourceRoot = '' + export sourceRoot=$(realpath */gtests/net/packetdrill) + ''; + + NIX_CFLAGS_COMPILE = [ + "-Wno-error=unused-result" + "-Wno-error=stringop-truncation" + "-Wno-error=address-of-packed-member" + ]; + nativeBuildInputs = [ bison flex cmake libpcap ]; + buildInputs = [ libpcap ]; + + installPhase = '' + install -m 0755 -t $out/bin -D \ + packetdrill \ + packet_parser_test \ + packet_to_string_test \ + checksum_test + mkdir -p $out/share + cp -r ../tests $out/share/packetdrill-tests + ''; + + meta = { + description = "Quick, precise tests for entire TCP/UDP/IPv4/IPv6 network stacks"; + homepage = "https://github.com/google/packetdrill"; + license = lib.licenses.gpl2; + platforms = lib.platforms.linux; + maintainers = with lib.maintainers; [ dmjio cleverca22 ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/pacparser/default.nix b/nixpkgs/pkgs/tools/networking/pacparser/default.nix new file mode 100644 index 000000000000..ce639a4cbc79 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/pacparser/default.nix @@ -0,0 +1,29 @@ +{ lib, stdenv, fetchurl }: + +stdenv.mkDerivation rec { + pname = "pacparser"; + version = "1.3.7"; + + src = fetchurl { + url = "https://github.com/manugarg/pacparser/releases/download/${version}/${pname}-${version}.tar.gz"; + sha256 = "0jfjm8lqyhdy9ny8a8icyd4rhclhfn608cr1i15jml82q8pyqj7b"; + }; + + makeFlags = [ "NO_INTERNET=1" ]; + + preConfigure = '' + export makeFlags="$makeFlags PREFIX=$out" + patchShebangs tests/runtests.sh + cd src + ''; + + hardeningDisable = [ "format" ]; + + meta = with lib; { + description = "A library to parse proxy auto-config (PAC) files"; + homepage = "http://pacparser.manugarg.com/"; + license = licenses.lgpl3; + platforms = platforms.linux; + maintainers = with maintainers; [ abbradar ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/par2cmdline/default.nix b/nixpkgs/pkgs/tools/networking/par2cmdline/default.nix new file mode 100644 index 000000000000..73e12e128567 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/par2cmdline/default.nix @@ -0,0 +1,28 @@ +{ lib, stdenv, fetchFromGitHub, autoreconfHook }: + +stdenv.mkDerivation rec { + pname = "par2cmdline"; + version = "0.8.1"; + + src = fetchFromGitHub { + owner = "Parchive"; + repo = "par2cmdline"; + rev = "v${version}"; + sha256 = "11mx8q29cr0sryd11awab7y4mhqgbamb1ss77rffjj6in8pb4hdk"; + }; + + nativeBuildInputs = [ autoreconfHook ]; + + meta = with lib; { + homepage = "https://github.com/Parchive/par2cmdline"; + description = "PAR 2.0 compatible file verification and repair tool"; + longDescription = '' + par2cmdline is a program for creating and using PAR2 files to detect + damage in data files and repair them if necessary. It can be used with + any kind of file. + ''; + license = licenses.gpl2Plus; + maintainers = [ maintainers.muflax ]; + platforms = platforms.all; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/passh/default.nix b/nixpkgs/pkgs/tools/networking/passh/default.nix new file mode 100644 index 000000000000..6534d3a1d517 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/passh/default.nix @@ -0,0 +1,25 @@ +{ lib, fetchFromGitHub, stdenv }: +stdenv.mkDerivation rec { + pname = "passh"; + version = "2020-03-18"; + + src = fetchFromGitHub { + owner = "clarkwang"; + repo = pname; + rev = "7112e667fc9e65f41c384f89ff6938d23e86826c"; + sha256 = "1g0rx94vqg36kp46f8v4x6jcmvdk85ds6bkrpayq772hbdm1b5z5"; + }; + + installPhase = '' + mkdir -p $out/bin + cp passh $out/bin + ''; + + meta = with lib; { + homepage = "https://github.com/clarkwang/passh"; + description = "An sshpass alternative for non-interactive ssh auth"; + license = licenses.gpl3; + maintainers = [ maintainers.lovesegfault ]; + platforms = platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/pcapc/default.nix b/nixpkgs/pkgs/tools/networking/pcapc/default.nix new file mode 100644 index 000000000000..48dc96bb3f71 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/pcapc/default.nix @@ -0,0 +1,27 @@ +{ lib, stdenv, fetchFromGitHub, libpcap, cmake }: + +stdenv.mkDerivation rec { + pname = "pcapc"; + version = "1.0.0"; + + src = fetchFromGitHub { + sha256 = "137crs0bb7kh9a8p9g168yj2jrp0h3j3073nwh31jy4nk0g5hlfp"; + rev = "v${version}"; + repo = "pcapc"; + owner = "pfactum"; + }; + + nativeBuildInputs = [ cmake ]; + buildInputs = [ libpcap ]; + + makeFlags = [ "PREFIX=$(out)" ]; + + doCheck = false; + + meta = with lib; { + homepage = "https://github.com/pfactum/pcapc"; + description = "Compile libpcap filter expressions into BPF opcodes"; + license = licenses.gpl3; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/pcapfix/default.nix b/nixpkgs/pkgs/tools/networking/pcapfix/default.nix new file mode 100644 index 000000000000..ee5212b97508 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/pcapfix/default.nix @@ -0,0 +1,20 @@ +{ lib, stdenv, fetchurl }: + +stdenv.mkDerivation rec { + name = "pcapfix-1.1.4"; + + src = fetchurl { + url = "https://f00l.de/pcapfix/${name}.tar.gz"; + sha256 = "0m6308ka33wqs568b7cwa1f5q0bv61j2nwfizdyzrazw673lnh6d"; + }; + + postPatch = ''sed -i "s|/usr|$out|" Makefile''; + + meta = with lib; { + homepage = "https://f00l.de/pcapfix/"; + description = "Repair your broken pcap and pcapng files"; + license = licenses.gpl3; + maintainers = [ maintainers.ehmry ]; + platforms = platforms.all; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/pdnsd/default.nix b/nixpkgs/pkgs/tools/networking/pdnsd/default.nix new file mode 100644 index 000000000000..a08182394b1f --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/pdnsd/default.nix @@ -0,0 +1,27 @@ +{ lib, stdenv, fetchurl }: + +stdenv.mkDerivation { + name = "pdnsd-1.2.9a-par"; + + src = fetchurl { + url = "http://members.home.nl/p.a.rombouts/pdnsd/releases/pdnsd-1.2.9a-par.tar.gz"; + sha256 = "0yragv5zk77a1hfkpnsh17vvsw8b14d6mzfng4bb7i58rb83an5v"; + }; + + patchPhase = '' + sed -i 's/.*(cachedir).*/:/' Makefile.in + ''; + + configureFlags = [ "--enable-ipv6" ]; + + # fix ipv6 on darwin + CPPFLAGS = "-D__APPLE_USE_RFC_3542"; + + meta = with lib; { + description = "Permanent DNS caching"; + homepage = "http://members.home.nl/p.a.rombouts/pdnsd"; + license = licenses.gpl3Plus; + platforms = platforms.unix; + maintainers = with maintainers; [viric]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/pdsh/default.nix b/nixpkgs/pkgs/tools/networking/pdsh/default.nix new file mode 100644 index 000000000000..87601b0ddf37 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/pdsh/default.nix @@ -0,0 +1,47 @@ +{ lib, stdenv, fetchurl, perl, readline, rsh, ssh, slurm, slurmSupport ? false }: + +stdenv.mkDerivation rec { + name = "pdsh-2.34"; + + src = fetchurl { + url = "https://github.com/chaos/pdsh/releases/download/${name}/${name}.tar.gz"; + sha256 = "1s91hmhrz7rfb6h3l5k97s393rcm1ww3svp8dx5z8vkkc933wyxl"; + }; + + buildInputs = [ perl readline ssh ] + ++ (lib.optional slurmSupport slurm); + + preConfigure = '' + configureFlagsArray=( + "--infodir=$out/share/info" + "--mandir=$out/share/man" + "--with-machines=/etc/pdsh/machines" + ${if readline == null then "--without-readline" else "--with-readline"} + ${if ssh == null then "--without-ssh" else "--with-ssh"} + ${if rsh == false then "--without-rsh" else "--with-rsh"} + ${if slurmSupport then "--with-slurm" else "--without-slurm"} + "--with-dshgroups" + "--with-xcpu" + "--disable-debug" + '--with-rcmd-rank-list=ssh,krb4,exec,xcpu,rsh' + ) + ''; + + meta = { + homepage = "https://github.com/chaos/pdsh"; + description = "High-performance, parallel remote shell utility"; + license = lib.licenses.gpl2; + + longDescription = '' + Pdsh is a high-performance, parallel remote shell utility. It has + built-in, thread-safe clients for Berkeley and Kerberos V4 rsh and + can call SSH externally (though with reduced performance). Pdsh + uses a "sliding window" parallel algorithm to conserve socket + resources on the initiating node and to allow progress to continue + while timeouts occur on some connections. + ''; + + platforms = lib.platforms.unix; + maintainers = [ lib.maintainers.peti ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/persepolis/default.nix b/nixpkgs/pkgs/tools/networking/persepolis/default.nix new file mode 100644 index 000000000000..5e4f0542d364 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/persepolis/default.nix @@ -0,0 +1,70 @@ +{ lib, buildPythonApplication, fetchFromGitHub, makeWrapper +, aria +, libnotify +, pulseaudio +, psutil +, pyqt5 +, requests +, setproctitle +, setuptools +, sound-theme-freedesktop +, wrapQtAppsHook +, youtube-dl +}: + +buildPythonApplication rec { + pname = "persepolis"; + version = "3.2.0"; + + src = fetchFromGitHub { + owner = "persepolisdm"; + repo = "persepolis"; + rev = version; + sha256 = "1rh7q432ynbysapsd075nif975ync71icpb71x2mb4j8jx1vzs45"; + }; + + # see: https://github.com/persepolisdm/persepolis/blob/3.2.0/setup.py#L130 + doCheck = false; + + preBuild='' + substituteInPlace setup.py --replace "answer = input(" "answer = 'y'#" + ''; + + postPatch = '' + sed -i 's|/usr/share/sounds/freedesktop/stereo/|${sound-theme-freedesktop}/share/sounds/freedesktop/stereo/|' setup.py + sed -i "s|'persepolis = persepolis.__main__'|'persepolis = persepolis.scripts.persepolis:main'|" setup.py + ''; + + postInstall = '' + mkdir -p $out/share/applications + cp $src/xdg/com.github.persepolisdm.persepolis.desktop $out/share/applications + ''; + + # prevent double wrapping + dontWrapQtApps = true; + nativeBuildInputs = [ wrapQtAppsHook ]; + + # feed args to wrapPythonApp + makeWrapperArgs = [ + "--prefix PATH : ${lib.makeBinPath [aria libnotify ]}" + "\${qtWrapperArgs[@]}" + ]; + + propagatedBuildInputs = [ + pulseaudio + psutil + pyqt5 + requests + setproctitle + setuptools + sound-theme-freedesktop + youtube-dl + ]; + + meta = with lib; { + description = "Persepolis Download Manager is a GUI for aria2"; + homepage = "https://persepolisdm.github.io/"; + license = licenses.gpl3; + maintainers = [ maintainers.linarcx ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/philter/default.nix b/nixpkgs/pkgs/tools/networking/philter/default.nix new file mode 100644 index 000000000000..60bd2f8cc7e8 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/philter/default.nix @@ -0,0 +1,32 @@ +{ lib, stdenv, fetchurl, python }: + +stdenv.mkDerivation rec { + pname = "philter"; + version = "1.1"; + src = fetchurl { + url = "mirror://sourceforge/philter/${pname}-${version}.tar.gz"; + sha256 = "177pqfflhdn2mw9lc1wv9ik32ji69rjqr6dw83hfndwlsva5151l"; + }; + + installPhase = '' + mkdir -p "$out"/{bin,share/philter} + cp .philterrc "$out"/share/philter/philterrc + sed -i 's@/usr/local/bin@${python}/bin@' src/philter.py + cp src/philter.py "$out"/bin/philter + chmod +x "$out"/bin/philter + ''; + + meta = with lib; { + description = "Mail sorter for Maildirs"; + homepage = "http://philter.sourceforge.net"; + maintainers = with maintainers; [ raskin ]; + platforms = platforms.all; + license = licenses.gpl2; + }; + + passthru = { + updateInfo = { + downloadPage = "http://philter.sourceforge.net/"; + }; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/phodav/default.nix b/nixpkgs/pkgs/tools/networking/phodav/default.nix new file mode 100644 index 000000000000..9b1c3d005b97 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/phodav/default.nix @@ -0,0 +1,33 @@ +{ lib, stdenv, fetchurl +, pkg-config, libsoup, meson, ninja }: + +let + version = "2.5"; +in stdenv.mkDerivation rec { + pname = "phodav"; + inherit version; + + src = fetchurl { + url = "http://ftp.gnome.org/pub/GNOME/sources/phodav/${version}/${pname}-${version}.tar.xz"; + sha256 = "045rdzf8isqmzix12lkz6z073b5qvcqq6ad028advm5gf36skw3i"; + }; + + mesonFlags = [ + "-Davahi=disabled" + "-Dsystemd=disabled" + "-Dgtk_doc=disabled" + "-Dudev=disabled" + ]; + + nativeBuildInputs = [ libsoup pkg-config meson ninja ]; + + outputs = [ "out" "dev" "lib" ]; + + meta = with lib; { + description = "WebDav server implementation and library using libsoup"; + homepage = "https://wiki.gnome.org/phodav"; + license = licenses.lgpl21; + maintainers = with maintainers; [ ]; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/photon/default.nix b/nixpkgs/pkgs/tools/networking/photon/default.nix new file mode 100644 index 000000000000..d3f153e44aed --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/photon/default.nix @@ -0,0 +1,34 @@ +{ lib, python3Packages, fetchFromGitHub }: + +python3Packages.buildPythonApplication rec { + pname = "photon"; + version = "1.3.0"; + + src = fetchFromGitHub { + owner = "s0md3v"; + repo = "Photon"; + rev = "v${version}"; + sha256 = "02z1xj72bq35dilr4b6njry4kixz6j2a3ag02nla98q0fvgmgnvy"; + }; + + dontBuild = true; + doCheck = false; + + propagatedBuildInputs = with python3Packages; [ requests urllib3 tld ]; + + installPhase = '' + mkdir -p "$out"/{bin,share/photon} + cp -R photon.py core plugins $out/share/photon + + makeWrapper ${python3Packages.python.interpreter} $out/bin/photon \ + --set PYTHONPATH "$PYTHONPATH:$out/share/photon" \ + --add-flags "-O $out/share/photon/photon.py" + ''; + + meta = with lib; { + description = "a lightning fast web crawler which extracts URLs, files, intel & endpoints from a target"; + homepage = "https://github.com/s0md3v/Photon"; + license = licenses.gpl3; + maintainers = with maintainers; [ ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/photon/destdir.patch b/nixpkgs/pkgs/tools/networking/photon/destdir.patch new file mode 100644 index 000000000000..e6cf997f2e7c --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/photon/destdir.patch @@ -0,0 +1,20 @@ +diff --git a/photon.py.old b/photon.py +index 92498e4..f7e2c3d 100644 +--- a/photon.py.old ++++ b/photon.py +@@ -185,7 +185,7 @@ if args.user_agent: + user_agents = args.user_agent.split(',') + else: + user_agents = [] +- with open(os.getcwd() + '/core/user-agents.txt', 'r') as uas: ++ with open('DESTDIR/core/user-agents.txt', 'r') as uas: + for agent in uas: + user_agents.append(agent.strip('\n')) + +@@ -534,4 +534,4 @@ if args.export: + if not colors: # if colors are disabled + print ('%s Results saved in %s directory' % (good, output_dir)) + else: +- print ('%s Results saved in \033[;1m%s\033[0m directory' % (good, output_dir)) +\ No newline at end of file ++ print ('%s Results saved in \033[;1m%s\033[0m directory' % (good, output_dir)) diff --git a/nixpkgs/pkgs/tools/networking/pingtcp/default.nix b/nixpkgs/pkgs/tools/networking/pingtcp/default.nix new file mode 100644 index 000000000000..5b4cbf10321f --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/pingtcp/default.nix @@ -0,0 +1,29 @@ +{ lib, stdenv, fetchFromGitHub, cmake }: + +stdenv.mkDerivation rec { + pname = "pingtcp"; + version = "0.0.3"; + + src = fetchFromGitHub { + owner = "LanetNetwork"; + repo = "pingtcp"; + sha256 = "1cv84n30y03s1b83apxxyn2jv5ss1pywsahrfrpkb6zcgzzrcqn8"; + rev = "refs/tags/v${version}"; + fetchSubmodules = true; + }; + + nativeBuildInputs = [ cmake ]; + + doCheck = false; + + postInstall = '' + install -Dm644 {..,$out/share/doc/pingtcp}/README.md + ''; + + meta = with lib; { + description = "Measure TCP handshake time"; + homepage = "https://github.com/LanetNetwork/pingtcp"; + license = licenses.gpl3; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/pirate-get/default.nix b/nixpkgs/pkgs/tools/networking/pirate-get/default.nix new file mode 100644 index 000000000000..dc9133229af7 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/pirate-get/default.nix @@ -0,0 +1,23 @@ +{ lib, python3Packages }: + +with python3Packages; + +buildPythonApplication rec { + pname = "pirate-get"; + version = "0.4.0"; + + src = fetchPypi { + inherit pname version; + sha256 = "07s5ss9dxccx1mip7pyga1fagywkqchxmzz55ng47ac9053ffxkq"; + }; + + propagatedBuildInputs = [ colorama veryprettytable pyperclip ]; + + meta = with lib; { + description = "A command line interface for The Pirate Bay"; + homepage = "https://github.com/vikstrous/pirate-get"; + license = licenses.gpl1; + maintainers = with maintainers; [ rnhmjoj ]; + platforms = platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/pixiecore/default.nix b/nixpkgs/pkgs/tools/networking/pixiecore/default.nix new file mode 100644 index 000000000000..c8c5ca118dd4 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/pixiecore/default.nix @@ -0,0 +1,28 @@ +{ lib, buildGoModule, fetchFromGitHub }: + +buildGoModule rec { + pname = "pixiecore"; + version = "2020-03-25"; + rev = "68743c67a60c18c06cd21fd75143e3e069ca3cfc"; + + src = fetchFromGitHub { + owner = "danderson"; + repo = "netboot"; + inherit rev; + sha256 = "14dslmx3gk08h9gqfjw5y27x7d2c6r8ir7mjd7l9ybysagpzr02a"; + }; + + vendorSha256 = "08n3m6fkwh8jmmzky3ygij4gxlcqidqk5ywi8ki8bkyzzs2lqaw7"; + + doCheck = false; + + subPackages = [ "cmd/pixiecore" ]; + + meta = { + description = "A tool to manage network booting of machines"; + homepage = "https://github.com/danderson/netboot/tree/master/pixiecore"; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ bbigras danderson ]; + platforms = lib.platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/pixiewps/default.nix b/nixpkgs/pkgs/tools/networking/pixiewps/default.nix new file mode 100644 index 000000000000..561daacfd530 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/pixiewps/default.nix @@ -0,0 +1,26 @@ +{ lib, stdenv, fetchFromGitHub }: + +stdenv.mkDerivation rec { + pname = "pixiewps"; + version = "1.2.2"; + src = fetchFromGitHub { + owner = "wiire"; + repo = "pixiewps"; + rev = "v${version}"; + sha256 = "09znnj7p8cks7zxzklkdm4zy2qnp92vhngm9r0zfgawnl2b4r2aw"; + }; + + preBuild = '' + cd src + substituteInPlace Makefile --replace "\$(DESTDIR)/usr" "$out" + substituteInPlace Makefile --replace "/local" "" + ''; + + meta = { + description = "An offline WPS bruteforce utility"; + homepage = "https://github.com/wiire/pixiewps"; + license = lib.licenses.gpl3; + maintainers = [ lib.maintainers.nico202 ]; + platforms = lib.platforms.all; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/pmacct/default.nix b/nixpkgs/pkgs/tools/networking/pmacct/default.nix new file mode 100644 index 000000000000..9cb8c0b88f73 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/pmacct/default.nix @@ -0,0 +1,65 @@ +{ lib, stdenv +, fetchFromGitHub +, pkg-config +, autoreconfHook +, libtool +, libpcap + +# Optional Dependencies +, zlib ? null +, withJansson ? true, jansson ? null +, withNflog ? true, libnetfilter_log ? null +, withSQLite ? true, sqlite ? null +, withPgSQL ? true, postgresql ? null +, withMysql ? true, libmysqlclient ? null }: + +assert withJansson -> jansson != null; +assert withNflog -> libnetfilter_log != null; +assert withSQLite -> sqlite != null; +assert withPgSQL -> postgresql != null; +assert withMysql -> libmysqlclient != null; + +let inherit (lib) getDev optional optionalString; in + +stdenv.mkDerivation rec { + version = "1.7.5"; + pname = "pmacct"; + + src = fetchFromGitHub { + owner = "pmacct"; + repo = pname; + rev = "v${version}"; + sha256 = "17p5isrq5w58hvmzhc6akbd37ins3c95g0rvhhdm0v33khzxmran"; + }; + + nativeBuildInputs = [ autoreconfHook pkg-config libtool ]; + buildInputs = [ libpcap ] + ++ optional withJansson jansson + ++ optional withNflog libnetfilter_log + ++ optional withSQLite sqlite + ++ optional withPgSQL postgresql + ++ optional withMysql [ libmysqlclient zlib ]; + + MYSQL_CONFIG = + optionalString withMysql "${getDev libmysqlclient}/bin/mysql_config"; + + configureFlags = [ + "--with-pcap-includes=${libpcap}/include" + ] ++ optional withJansson "--enable-jansson" + ++ optional withNflog "--enable-nflog" + ++ optional withSQLite "--enable-sqlite3" + ++ optional withPgSQL "--enable-pgsql" + ++ optional withMysql "--enable-mysql"; + + meta = with lib; { + description = "A small set of multi-purpose passive network monitoring tools"; + longDescription = '' + pmacct is a small set of multi-purpose passive network monitoring tools + [NetFlow IPFIX sFlow libpcap BGP BMP RPKI IGP Streaming Telemetry] + ''; + homepage = "http://www.pmacct.net/"; + license = licenses.gpl2; + maintainers = with maintainers; [ _0x4A6F ]; + platforms = platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/polygraph/default.nix b/nixpkgs/pkgs/tools/networking/polygraph/default.nix new file mode 100644 index 000000000000..74347ff83957 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/polygraph/default.nix @@ -0,0 +1,20 @@ +{ lib, stdenv, fetchurl, openssl, zlib, ncurses }: + +stdenv.mkDerivation rec { + name = "polygraph-4.13.0"; + + src = fetchurl { + url = "http://www.web-polygraph.org/downloads/srcs/${name}-src.tgz"; + sha256 = "1rwzci3n7q33hw3spd79adnclzwgwlxcisc9szzjmcjqhbkcpj1a"; + }; + + buildInputs = [ openssl zlib ncurses ]; + + meta = with lib; { + homepage = "http://www.web-polygraph.org"; + description = "Performance testing tool for caching proxies, origin server accelerators, L4/7 switches, content filters, and other Web intermediaries"; + platforms = platforms.linux; + license = licenses.asl20; + maintainers = [ ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/polysh/default.nix b/nixpkgs/pkgs/tools/networking/polysh/default.nix new file mode 100644 index 000000000000..69e5d0427e58 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/polysh/default.nix @@ -0,0 +1,25 @@ +{ lib, fetchurl, python2Packages }: + +let + inherit (python2Packages) buildPythonApplication; +in +buildPythonApplication rec { + pname = "polysh"; + version = "0.4"; + src = fetchurl { + url = "http://guichaz.free.fr/polysh/files/${pname}-${version}.tar.bz2"; + sha256 = "0kxhp38c8a8hc8l86y53l2z5zpzxc4b8lx5zyzmq1badcrfc4mh4"; + }; + + meta = with lib; { + description = "A tool to aggregate several remote shells into one"; + longDescription = '' + Polysh is a tool to aggregate several remote shells into one. It + is used to launch an interactive remote shell on many machines + at once. + ''; + maintainers = [ maintainers.astsmtl ]; + homepage = "http://guichaz.free.fr/polysh/"; + license = licenses.gpl2; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/ppp/default.nix b/nixpkgs/pkgs/tools/networking/ppp/default.nix new file mode 100644 index 000000000000..36d156a3994b --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/ppp/default.nix @@ -0,0 +1,75 @@ +{ lib, stdenv, fetchurl, fetchpatch, fetchFromGitHub, substituteAll, libpcap, openssl }: + +stdenv.mkDerivation rec { + version = "2.4.8"; + pname = "ppp"; + + src = fetchFromGitHub { + owner = "paulusmack"; + repo = "ppp"; + rev = "ppp-${version}"; + sha256 = "1i88m79h6g3fzsb4yw3k8bq1grsx3hsyawm7id2vcaab0gfqzjjv"; + }; + + patches = + [ + ( substituteAll { + src = ./nix-purity.patch; + inherit libpcap; + glibc = stdenv.cc.libc.dev or stdenv.cc.libc; + openssl = openssl.dev; + }) + # Without nonpriv.patch, pppd --version doesn't work when not run as + # root. + ./nonpriv.patch + (fetchpatch { + name = "CVE-2015-3310.patch"; + url = "https://github.com/paulusmack/ppp/commit/858976b1fc3107f1261aae337831959b511b83c2.patch"; + sha256 = "0wirmcis67xjwllqhz9lsz1b7dcvl8shvz78lxgybc70j2sv7ih4"; + }) + (fetchurl { + url = "https://www.nikhef.nl/~janjust/ppp/ppp-2.4.7-eaptls-mppe-1.102.patch"; + sha256 = "04war8l5szql53l36043hvzgfwqp3v76kj8brbz7wlf7vs2mlkia"; + }) + (fetchpatch { + name = "CVE-2020-8597.patch"; + url = "https://github.com/paulusmack/ppp/commit/8d7970b8f3db727fe798b65f3377fe6787575426.patch"; + sha256 = "129wnhwxmzvr3y9gzxv82jnb5y8m4yg8vkpa0xl2rwkl8anbzgkh"; + }) + ./musl-fix-headers.patch + ]; + + buildInputs = [ libpcap openssl ]; + + postPatch = '' + # strip is not found when cross compiling with seemingly no way to point + # make to the right place, fixup phase will correctly strip + # everything anyway so we remove it from the Makefiles + for file in $(find -name Makefile.linux); do + substituteInPlace "$file" --replace '$(INSTALL) -s' '$(INSTALL)' + substituteInPlace "$file" --replace '-m 4550' '-m 550' + done + ''; + + installPhase = '' + runHook preInstall + mkdir -p $out/bin + make install + install -D -m 755 scripts/{pon,poff,plog} $out/bin + runHook postInstall + ''; + + postFixup = '' + for tgt in pon poff plog; do + substituteInPlace "$out/bin/$tgt" --replace "/usr/sbin" "$out/bin" + done + ''; + + meta = with lib; { + homepage = "https://ppp.samba.org/"; + description = "Point-to-point implementation for Linux and Solaris"; + license = with licenses; [ bsdOriginal publicDomain gpl2 lgpl2 ]; + platforms = platforms.linux; + maintainers = [ ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/ppp/musl-fix-headers.patch b/nixpkgs/pkgs/tools/networking/ppp/musl-fix-headers.patch new file mode 100644 index 000000000000..d6252a52675b --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/ppp/musl-fix-headers.patch @@ -0,0 +1,137 @@ +diff --git a/include/net/ppp_defs.h b/include/net/ppp_defs.h +index b06eda5..dafa36c 100644 +--- a/include/net/ppp_defs.h ++++ b/include/net/ppp_defs.h +@@ -38,6 +38,8 @@ + #ifndef _PPP_DEFS_H_ + #define _PPP_DEFS_H_ + ++#include <sys/time.h> ++ + /* + * The basic PPP frame. + */ +diff --git a/pppd/Makefile.linux b/pppd/Makefile.linux +index a74c914..7acd2cf 100644 +--- a/pppd/Makefile.linux ++++ b/pppd/Makefile.linux +@@ -126,7 +126,7 @@ LIBS += -lcrypt + endif + + ifdef USE_LIBUTIL +-CFLAGS += -DHAVE_LOGWTMP=1 ++#CFLAGS += -DHAVE_LOGWTMP=1 + LIBS += -lutil + endif + +diff --git a/pppd/magic.h b/pppd/magic.h +index c81213b..305aece 100644 +--- a/pppd/magic.h ++++ b/pppd/magic.h +@@ -42,6 +42,8 @@ + * $Id: magic.h,v 1.5 2003/06/11 23:56:26 paulus Exp $ + */ + ++#include <sys/cdefs.h> ++ + void magic_init (void); /* Initialize the magic number generator */ + u_int32_t magic (void); /* Returns the next magic number */ + +diff --git a/pppd/plugins/rp-pppoe/if.c b/pppd/plugins/rp-pppoe/if.c +index 91e9a57..9c0fac3 100644 +--- a/pppd/plugins/rp-pppoe/if.c ++++ b/pppd/plugins/rp-pppoe/if.c +@@ -30,10 +30,6 @@ static char const RCSID[] = + #include <linux/if_packet.h> + #endif + +-#ifdef HAVE_NET_ETHERNET_H +-#include <net/ethernet.h> +-#endif +- + #ifdef HAVE_ASM_TYPES_H + #include <asm/types.h> + #endif +diff --git a/pppd/plugins/rp-pppoe/plugin.c b/pppd/plugins/rp-pppoe/plugin.c +index a8c2bb4..ca34d79 100644 +--- a/pppd/plugins/rp-pppoe/plugin.c ++++ b/pppd/plugins/rp-pppoe/plugin.c +@@ -46,7 +46,6 @@ static char const RCSID[] = + #include <unistd.h> + #include <fcntl.h> + #include <signal.h> +-#include <net/ethernet.h> + #include <net/if_arp.h> + #include <linux/ppp_defs.h> + #include <linux/if_pppox.h> +diff --git a/pppd/plugins/rp-pppoe/pppoe-discovery.c b/pppd/plugins/rp-pppoe/pppoe-discovery.c +index 3d3bf4e..b5f82d3 100644 +--- a/pppd/plugins/rp-pppoe/pppoe-discovery.c ++++ b/pppd/plugins/rp-pppoe/pppoe-discovery.c +@@ -27,10 +27,6 @@ + #include <linux/if_packet.h> + #endif + +-#ifdef HAVE_NET_ETHERNET_H +-#include <net/ethernet.h> +-#endif +- + #ifdef HAVE_ASM_TYPES_H + #include <asm/types.h> + #endif +@@ -55,6 +51,8 @@ void die(int status) + exit(status); + } + ++#define error(x...) fprintf(stderr, x) ++ + /* Initialize frame types to RFC 2516 values. Some broken peers apparently + use different frame types... sigh... */ + +diff --git a/pppd/plugins/rp-pppoe/pppoe.h b/pppd/plugins/rp-pppoe/pppoe.h +index c4aaa6e..70aef85 100644 +--- a/pppd/plugins/rp-pppoe/pppoe.h ++++ b/pppd/plugins/rp-pppoe/pppoe.h +@@ -88,18 +88,6 @@ typedef unsigned long UINT32_t; + #include <linux/if_ether.h> + #endif + +-#ifdef HAVE_NETINET_IF_ETHER_H +-#include <sys/types.h> +- +-#ifdef HAVE_SYS_SOCKET_H +-#include <sys/socket.h> +-#endif +-#ifndef HAVE_SYS_DLPI_H +-#include <netinet/if_ether.h> +-#endif +-#endif +- +- + /* Ethernet frame types according to RFC 2516 */ + #define ETH_PPPOE_DISCOVERY 0x8863 + #define ETH_PPPOE_SESSION 0x8864 +diff --git a/pppd/sys-linux.c b/pppd/sys-linux.c +index 6d71530..86d224e 100644 +--- a/pppd/sys-linux.c ++++ b/pppd/sys-linux.c +@@ -102,19 +102,11 @@ + #define MAX_ADDR_LEN 7 + #endif + +-#if !defined(__GLIBC__) || __GLIBC__ >= 2 + #include <asm/types.h> /* glibc 2 conflicts with linux/types.h */ + #include <net/if.h> + #include <net/if_arp.h> + #include <net/route.h> + #include <netinet/if_ether.h> +-#else +-#include <linux/types.h> +-#include <linux/if.h> +-#include <linux/if_arp.h> +-#include <linux/route.h> +-#include <linux/if_ether.h> +-#endif + #include <netinet/in.h> + #include <arpa/inet.h> + diff --git a/nixpkgs/pkgs/tools/networking/ppp/nix-purity.patch b/nixpkgs/pkgs/tools/networking/ppp/nix-purity.patch new file mode 100644 index 000000000000..975ea9db6096 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/ppp/nix-purity.patch @@ -0,0 +1,31 @@ +diff --git a/pppd/Makefile.linux b/pppd/Makefile.linux +index 9664f70..d07e01e 100644 +--- a/pppd/Makefile.linux ++++ b/pppd/Makefile.linux +@@ -125,7 +125,7 @@ CFLAGS += -DHAS_SHADOW + #LIBS += -lshadow $(LIBS) + endif + +-ifneq ($(wildcard $(shell $(CC) --print-sysroot)/usr/include/crypt.h),) ++ifneq ($(wildcard @glibc@/include/crypt.h),) + CFLAGS += -DHAVE_CRYPT_H=1 + LIBS += -lcrypt + endif +@@ -137,7 +137,7 @@ endif + + ifdef NEEDDES + ifndef USE_CRYPT +-CFLAGS += -I$(shell $(CC) --print-sysroot)/usr/include/openssl ++CFLAGS += -I@openssl@/include/openssl + LIBS += -lcrypto + else + CFLAGS += -DUSE_CRYPT=1 +@@ -188,7 +188,7 @@ LIBS += -ldl + endif + + ifdef FILTER +-ifneq ($(wildcard /usr/include/pcap-bpf.h),) ++ifneq ($(wildcard @libpcap@/include/pcap-bpf.h),) + LIBS += -lpcap + CFLAGS += -DPPP_FILTER + endif diff --git a/nixpkgs/pkgs/tools/networking/ppp/nonpriv.patch b/nixpkgs/pkgs/tools/networking/ppp/nonpriv.patch new file mode 100644 index 000000000000..df6faaf8383d --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/ppp/nonpriv.patch @@ -0,0 +1,13 @@ +diff --git a/pppd/main.c b/pppd/main.c +index 014d614..6661d33 100644 +--- a/pppd/main.c ++++ b/pppd/main.c +@@ -334,7 +334,7 @@ main(argc, argv) + umask(umask(0777) | 022); + + uid = getuid(); +- privileged = uid == 0; ++ privileged = (uid == 0) || (geteuid() != 0); + slprintf(numbuf, sizeof(numbuf), "%d", uid); + script_setenv("ORIG_UID", numbuf, 0); + diff --git a/nixpkgs/pkgs/tools/networking/pptp/default.nix b/nixpkgs/pkgs/tools/networking/pptp/default.nix new file mode 100644 index 000000000000..7af9e324f2e0 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/pptp/default.nix @@ -0,0 +1,34 @@ +{ lib, stdenv, fetchurl, perl, ppp, iproute2 }: + +stdenv.mkDerivation rec { + pname = "pptp"; + version = "1.10.0"; + + src = fetchurl { + url = "mirror://sourceforge/pptpclient/${pname}-${version}.tar.gz"; + sha256 = "1x2szfp96w7cag2rcvkdqbsl836ja5148zzfhaqp7kl7wjw2sjc2"; + }; + + prePatch = '' + substituteInPlace Makefile --replace 'install -o root' 'install' + ''; + + preConfigure = '' + makeFlagsArray=( IP=${iproute2}/bin/ip PPPD=${ppp}/sbin/pppd \ + BINDIR=$out/sbin MANDIR=$out/share/man/man8 \ + PPPDIR=$out/etc/ppp ) + ''; + + buildInputs = [ perl ]; + + postFixup = '' + patchShebangs $out + ''; + + meta = with lib; { + description = "PPTP client for Linux"; + homepage = "http://pptpclient.sourceforge.net/"; + license = licenses.gpl2; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/pptpd/default.nix b/nixpkgs/pkgs/tools/networking/pptpd/default.nix new file mode 100644 index 000000000000..8a802281192e --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/pptpd/default.nix @@ -0,0 +1,25 @@ +{ lib, stdenv, fetchurl, ppp }: + +stdenv.mkDerivation rec { + pname = "pptpd"; + version = "1.4.0"; + + src = fetchurl { + url = "mirror://sourceforge/poptop/${pname}/${pname}-${version}/${pname}-${version}.tar.gz"; + sha256 = "1h06gyxj51ba6kbbnf6hyivwjia0i6gsmjz8kyggaany8a58pkcg"; + }; + + buildInputs = [ ppp ]; + + postPatch = '' + substituteInPlace plugins/Makefile --replace "install -o root" "install" + ''; + + meta = with lib; { + homepage = "http://poptop.sourceforge.net/dox/"; + description = "The PPTP Server for Linux"; + platforms = platforms.linux; + maintainers = with maintainers; [ obadz ]; + license = licenses.gpl2; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/prettyping/default.nix b/nixpkgs/pkgs/tools/networking/prettyping/default.nix new file mode 100644 index 000000000000..43f32ddb9fb4 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/prettyping/default.nix @@ -0,0 +1,25 @@ +{ stdenv, lib, fetchFromGitHub }: + +stdenv.mkDerivation rec { + name = "${program}-${version}"; + program = "prettyping"; + version = "1.0.1"; + src = fetchFromGitHub { + owner = "denilsonsa"; + repo = program; + rev = "v${version}"; + sha256 = "05vfaq9y52z40245j47yjk1xaiwrazv15sgjq64w91dfyahjffxf"; + }; + + installPhase = '' + install -Dt $out/bin prettyping + ''; + + meta = with lib; { + homepage = "https://github.com/denilsonsa/prettyping"; + description = "A wrapper around the standard ping tool with the objective of making the output prettier, more colorful, more compact, and easier to read"; + license = with licenses; [ mit ]; + platforms = platforms.unix; + maintainers = with maintainers; [ qoelet ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/pritunl-ssh/default.nix b/nixpkgs/pkgs/tools/networking/pritunl-ssh/default.nix new file mode 100644 index 000000000000..586fc780699f --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/pritunl-ssh/default.nix @@ -0,0 +1,29 @@ +{ lib, stdenv, fetchFromGitHub, python3 }: + +stdenv.mkDerivation rec { + pname = "pritunl-ssh"; + version = "1.0.1674.4"; + + src = fetchFromGitHub { + owner = "pritunl"; + repo = "pritunl-zero-client"; + rev = version; + sha256 = "07z60lipbwm0p7s2bxcij21jid8w4nyh6xk2qq5qdm4acq4k1i88"; + }; + + buildInputs = [ python3 ]; + + installPhase = '' + mkdir -p $out/bin + install ssh_client.py $out/bin/pritunl-ssh + install ssh_host_client.py $out/bin/pritunl-ssh-host + ''; + + meta = with lib; { + description = "Pritunl Zero SSH client"; + homepage = "https://github.com/pritunl/pritunl-zero-client"; + license = licenses.unfree; + maintainers = with maintainers; [ Thunderbottom ]; + platforms = platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/privoxy/default.nix b/nixpkgs/pkgs/tools/networking/privoxy/default.nix new file mode 100644 index 000000000000..9fce8d7a5f41 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/privoxy/default.nix @@ -0,0 +1,47 @@ +{ lib, stdenv +, nixosTests +, fetchurl, autoreconfHook +, zlib, pcre, w3m, man +, mbedtls, brotli +}: + +stdenv.mkDerivation rec { + + pname = "privoxy"; + version = "3.0.32"; + + src = fetchurl { + url = "mirror://sourceforge/ijbswa/Sources/${version}%20%28stable%29/${pname}-${version}-stable-src.tar.gz"; + sha256 = "sha256-xh3kAIxiRF7Bjx8nBAfL8jcuq6k76szcnjI4uy3v7tc="; + }; + + hardeningEnable = [ "pie" ]; + + nativeBuildInputs = [ autoreconfHook w3m man ]; + buildInputs = [ zlib pcre mbedtls brotli ]; + + makeFlags = [ "STRIP=" ]; + configureFlags = [ + "--with-mbedtls" + "--with-brotli" + "--enable-external-filters" + "--enable-compression" + ]; + + postInstall = '' + rm -r $out/var + ''; + + passthru.tests.privoxy = nixosTests.privoxy; + + meta = with lib; { + homepage = "https://www.privoxy.org/"; + description = "Non-caching web proxy with advanced filtering capabilities"; + # When linked with mbedtls, the license becomes GPLv3 (or later), otherwise + # GPLv2 (or later). See https://www.privoxy.org/user-manual/copyright.html + license = licenses.gpl3Plus; + platforms = platforms.all; + maintainers = [ maintainers.phreedom ]; + }; + +} diff --git a/nixpkgs/pkgs/tools/networking/proxify/default.nix b/nixpkgs/pkgs/tools/networking/proxify/default.nix new file mode 100644 index 000000000000..6a0bfcc6ee22 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/proxify/default.nix @@ -0,0 +1,31 @@ +{ buildGoModule +, fetchFromGitHub +, lib +}: + +buildGoModule rec { + pname = "proxify"; + version = "0.0.3"; + + src = fetchFromGitHub { + owner = "projectdiscovery"; + repo = "proxify"; + rev = "v${version}"; + sha256 = "15j2q9zrs8bdf72jgldkai3xbi4irk69wyjzv48r74rdgf2k49gn"; + }; + + vendorSha256 = "1x78n88ri8kph827k03x1q06zpbbbp7793xsvc376ljda5n6bqig"; + + meta = with lib; { + description = "Proxy tool for HTTP/HTTPS traffic capture"; + longDescription = '' + This tool supports multiple operations such as request/response dump, filtering + and manipulation via DSL language, upstream HTTP/Socks5 proxy. Additionally a + replay utility allows to import the dumped traffic (request/responses with correct + domain name) into other tools by simply setting the upstream proxy to proxify. + ''; + homepage = "https://github.com/projectdiscovery/proxify"; + license = licenses.mit; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/proxychains/default.nix b/nixpkgs/pkgs/tools/networking/proxychains/default.nix new file mode 100644 index 000000000000..56a553c0c803 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/proxychains/default.nix @@ -0,0 +1,33 @@ +{ lib +, stdenv +, fetchFromGitHub +}: + +stdenv.mkDerivation rec { + pname = "proxychains"; + version = "4.4.0"; + + src = fetchFromGitHub { + owner = "haad"; + repo = pname; + rev = "${pname}-${version}"; + sha256 = "083xdg6fsn8c2ns93lvy794rixxq8va6jdf99w1z0xi4j7f1nyjw"; + }; + + postPatch = '' + # Suppress compiler warning. Remove it when upstream fix arrives + substituteInPlace Makefile --replace "-Werror" "-Werror -Wno-stringop-truncation" + ''; + + postInstall = '' + cp src/proxychains.conf $out/etc + ''; + + meta = with lib; { + description = "Proxifier for SOCKS proxies"; + homepage = "http://proxychains.sourceforge.net"; + license = licenses.gpl2Plus; + maintainers = with maintainers; [ fab ]; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/pssh/default.nix b/nixpkgs/pkgs/tools/networking/pssh/default.nix new file mode 100644 index 000000000000..a17701644c87 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/pssh/default.nix @@ -0,0 +1,34 @@ +{ lib, fetchFromGitHub, pythonPackages, openssh, rsync }: + +pythonPackages.buildPythonApplication rec { + pname = "pssh"; + version = "2.3.1"; + + src = fetchFromGitHub { + owner = "lilydjwg"; + repo = "pssh"; + rev = "v${version}"; + sha256 = "0nawarxczfwajclnlsimhqkpzyqb1byvz9nsl54mi1bp80z5i4jq"; + }; + + postPatch = '' + for f in bin/*; do + substituteInPlace $f \ + --replace "'ssh'" "'${openssh}/bin/ssh'" \ + --replace "'scp'" "'${openssh}/bin/scp'" \ + --replace "'rsync'" "'${rsync}/bin/rsync'" + done + ''; + + meta = with lib; { + description = "Parallel SSH Tools"; + longDescription = '' + PSSH provides parallel versions of OpenSSH and related tools, + including pssh, pscp, prsync, pnuke and pslurp. + ''; + inherit (src.meta) homepage; + license = licenses.bsd3; + platforms = platforms.linux ++ platforms.darwin; + maintainers = with maintainers; [ chris-martin ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/pwnat/default.nix b/nixpkgs/pkgs/tools/networking/pwnat/default.nix new file mode 100644 index 000000000000..780477af2fcb --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/pwnat/default.nix @@ -0,0 +1,28 @@ +{ lib, stdenv, fetchFromGitHub }: + +stdenv.mkDerivation rec { + name = "${pname}-${date}"; + pname = "pwnat"; + date = "2014-09-08"; + + src = fetchFromGitHub { + owner = "samyk"; + repo = pname; + rev = "1d07c2eb53171733831c0cd01e4e96a3204ec446"; + sha256 = "056xhlnf1axa6k90i018xwijkwc9zc7fms35hrkzwgs40g9ybrx5"; + }; + + installPhase = '' + mkdir -p $out/bin $out/share/pwnat + cp pwnat $out/bin + cp README* COPYING* $out/share/pwnat + ''; + + meta = with lib; { + homepage = "http://samy.pl/pwnat/"; + description = "ICMP NAT to NAT client-server communication"; + license = lib.licenses.gpl3Plus; + maintainers = with maintainers; [viric]; + platforms = with platforms; linux; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/py-wmi-client/default.nix b/nixpkgs/pkgs/tools/networking/py-wmi-client/default.nix new file mode 100644 index 000000000000..7a2774002891 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/py-wmi-client/default.nix @@ -0,0 +1,25 @@ +{ lib, pythonPackages, fetchFromGitHub }: + +pythonPackages.buildPythonApplication rec { + pname = "py-wmi-client"; + version = "unstable-20160601"; + + src = fetchFromGitHub { + owner = "dlundgren"; + repo = pname; + rev = "9702b036df85c3e0ecdde84a753b353069f58208"; + sha256 = "1kd12gi1knqv477f1shzqr0h349s5336vzp3fpfp3xl0b502ld8d"; + }; + + propagatedBuildInputs = with pythonPackages; [ impacket natsort pyasn1 pycrypto ]; + + # no tests + doCheck = false; + + meta = with lib; { + description = "Python WMI Client implementation"; + homepage = "https://github.com/dlundgren/py-wmi-client"; + license = licenses.mit; + maintainers = with maintainers; [ peterhoeg ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/pykms/default.nix b/nixpkgs/pkgs/tools/networking/pykms/default.nix new file mode 100644 index 000000000000..d648ff3ec1ed --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/pykms/default.nix @@ -0,0 +1,89 @@ +{ lib +, fetchFromGitHub +, python3 +, writeText +, writeShellScript +, sqlite +}: +let + pypkgs = python3.pkgs; + + dbSql = writeText "create_pykms_db.sql" '' + CREATE TABLE clients( + clientMachineId TEXT, + machineName TEXT, + applicationId TEXT, + skuId TEXT, + licenseStatus TEXT, + lastRequestTime INTEGER, + kmsEpid TEXT, + requestCount INTEGER + ); + ''; + + dbScript = writeShellScript "create_pykms_db.sh" '' + set -eEuo pipefail + + db=''${1:-/var/lib/pykms/clients.db} + + if [ ! -e $db ] ; then + ${lib.getBin sqlite}/bin/sqlite3 $db < ${dbSql} + fi + ''; + +in +pypkgs.buildPythonApplication rec { + pname = "pykms"; + version = "unstable-2021-01-25"; + + src = fetchFromGitHub { + owner = "SystemRage"; + repo = "py-kms"; + rev = "a3b0c85b5b90f63b33dfa5ae6085fcd52c6da2ff"; + sha256 = "sha256-u0R0uJMQxHnJUDenxglhQkZza3/1DcyXCILcZVceygA="; + }; + + sourceRoot = "source/py-kms"; + + propagatedBuildInputs = with pypkgs; [ systemd pytz tzlocal ]; + + postPatch = '' + siteDir=$out/${python3.sitePackages} + + substituteInPlace pykms_DB2Dict.py \ + --replace "'KmsDataBase.xml'" "'$siteDir/KmsDataBase.xml'" + ''; + + format = "other"; + + # there are no tests + doCheck = false; + + installPhase = '' + runHook preInstall + + mkdir -p $siteDir + + mv * $siteDir + for b in Client Server ; do + makeWrapper ${python3.interpreter} $out/bin/''${b,,} \ + --argv0 pykms-''${b,,} \ + --add-flags $siteDir/pykms_$b.py + done + + install -Dm755 ${dbScript} $out/libexec/create_pykms_db.sh + + install -Dm644 ../README.md -t $out/share/doc/pykms + + ${python3.interpreter} -m compileall $siteDir + + runHook postInstall + ''; + + meta = with lib; { + description = "Windows KMS (Key Management Service) server written in Python"; + homepage = "https://github.com/SystemRage/py-kms"; + license = licenses.unlicense; + maintainers = with maintainers; [ peterhoeg ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/qrcp/default.nix b/nixpkgs/pkgs/tools/networking/qrcp/default.nix new file mode 100644 index 000000000000..f417bb496f40 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/qrcp/default.nix @@ -0,0 +1,44 @@ +{ lib +, buildGoModule +, fetchFromGitHub +, installShellFiles +}: + +buildGoModule rec { + pname = "qrcp"; + version = "0.8.4"; + + src = fetchFromGitHub { + owner = "claudiodangelis"; + repo = "qrcp"; + rev = version; + sha256 = "1m1xbb3x526j2v8m5m46km9zzj3dk9fvm5wckyqb8kxm4md12y50"; + }; + + vendorSha256 = "1hn8c72fvih6ws1y2c4963pww3ld64m0yh3pmx62hwcy83bhb0v4"; + + subPackages = [ "." ]; + + nativeBuildInputs = [ + installShellFiles + ]; + + postInstall = '' + installShellCompletion --bash --cmd qrcp <($out/bin/qrcp completion bash) + installShellCompletion --fish --cmd qrcp <($out/bin/qrcp completion fish) + installShellCompletion --zsh --cmd qrcp <($out/bin/qrcp completion zsh) + ''; + + meta = with lib; { + homepage = "https://claudiodangelis.com/qrcp/"; + description = "Transfer files over wifi by scanning a QR code from your terminal"; + longDescription = '' + qrcp binds a web server to the address of your Wi-Fi network + interface on a random port and creates a handler for it. The default + handler serves the content and exits the program when the transfer is + complete. + ''; + license = licenses.mit; + maintainers = with maintainers; [ fgaz ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/quickserve/default.nix b/nixpkgs/pkgs/tools/networking/quickserve/default.nix new file mode 100644 index 000000000000..f23bbcd25371 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/quickserve/default.nix @@ -0,0 +1,35 @@ +{ lib, stdenv, makeWrapper, fetchzip, python3, python3Packages }: +let + threaded_servers = python3Packages.buildPythonPackage { + name = "threaded_servers"; + src = fetchzip { + url = "https://xyne.archlinux.ca/projects/python3-threaded_servers/src/python3-threaded_servers-2018.6.tar.xz"; + sha256 = "1irliz90a1dk4lyl7mrfq8qnnrfad9czvbcw1spc13zyai66iyhf"; + }; + + # stuff we don't care about pacserve + doCheck = false; + }; + wrappedPython = python3.withPackages (_: [ threaded_servers ]); +in stdenv.mkDerivation { + pname = "quickserve"; + version = "2018"; + + dontUnpack = true; + nativeBuildInputs = [ makeWrapper ]; + + installPhase = '' + runHook preInstall + mkdir -p $out/bin + makeWrapper ${wrappedPython}/bin/python $out/bin/quickserve \ + --add-flags -mThreadedServers.PeeredQuickserve + runHook postInstall + ''; + + meta = with lib; { + description = "A simple HTTP server for quickly sharing files"; + homepage = "https://xyne.archlinux.ca/projects/quickserve/"; + license = licenses.gpl2; + maintainers = with maintainers; [ lassulus ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/quicktun/default.nix b/nixpkgs/pkgs/tools/networking/quicktun/default.nix new file mode 100644 index 000000000000..8d227e1fbba1 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/quicktun/default.nix @@ -0,0 +1,32 @@ +{ lib, stdenv, fetchFromGitHub, libsodium }: + +stdenv.mkDerivation { + pname = "quicktun"; + version = "2.2.5"; + + src = fetchFromGitHub { + owner = "UCIS"; + repo = "QuickTun"; + rev = "2d0c6a9cda8c21f921a5d1197aeee92e9568ca39"; + sha256 = "1ydvwasj84qljfbzh6lmhyzjc20yw24a0v2mykp8afsm97zzlqgx"; + }; + + patches = [ ./tar-1.30.diff ]; # quicktun master seems not to need this + + buildInputs = [ libsodium ]; + + buildPhase = "bash build.sh"; + + installPhase = '' + rm out/quicktun*tgz + install -vD out/quicktun* -t $out/bin + ''; + + meta = with lib; { + description = "Very simple, yet secure VPN software"; + homepage = "http://wiki.ucis.nl/QuickTun"; + maintainers = [ maintainers.fpletz ]; + platforms = platforms.unix; + license = licenses.bsd2; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/quicktun/tar-1.30.diff b/nixpkgs/pkgs/tools/networking/quicktun/tar-1.30.diff new file mode 100644 index 000000000000..88498e542807 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/quicktun/tar-1.30.diff @@ -0,0 +1,19 @@ +Fix build with gnutar-1.30 + +Creating source archive... +tar: The following options were used after any non-optional arguments in archive create or update mode. These options are positional and affect only arguments that follow them. Please, rearrange them properly. +tar: --exclude 'debian/data' has no effect +tar: Exiting with failure status due to previous errors +diff --git a/build.sh b/build.sh +index 0ea0403..725178c 100755 +--- a/build.sh ++++ b/build.sh +@@ -25,7 +25,7 @@ rm -rf out/ obj/ tmp/ + mkdir -p out + if [ "$1" != "debian" ]; then + echo Creating source archive... +- $tar --transform "s,^,quicktun-`cat version`/," -czf "out/quicktun-`cat version`.tgz" build.sh clean.sh debian src version --exclude "debian/data" ++ $tar --transform "s,^,quicktun-`cat version`/," -czf "out/quicktun-`cat version`.tgz" --exclude "debian/data" build.sh clean.sh debian src version + fi + + mkdir -p obj tmp tmp/include tmp/lib diff --git a/nixpkgs/pkgs/tools/networking/radsecproxy/default.nix b/nixpkgs/pkgs/tools/networking/radsecproxy/default.nix new file mode 100644 index 000000000000..1a7d895f8102 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/radsecproxy/default.nix @@ -0,0 +1,30 @@ +{ lib, stdenv, fetchFromGitHub, openssl, autoreconfHook, nettle }: + +stdenv.mkDerivation rec { + pname = "radsecproxy"; + version = "1.8.2"; + + src = fetchFromGitHub { + owner = pname; + repo = pname; + rev = version; + sha256 = "1g7q128cip1dac9jad58rd96afx4xz7x7vsiv0af8iyq2ivqvs2m"; + }; + + nativeBuildInputs = [ autoreconfHook ]; + buildInputs = [ openssl nettle ]; + + configureFlags = [ + "--with-ssl=${openssl.dev}" + "--sysconfdir=/etc" + "--localstatedir=/var" + ]; + + meta = with lib; { + homepage = "https://software.nordu.net/radsecproxy/"; + description = "A generic RADIUS proxy that supports both UDP and TLS (RadSec) RADIUS transports"; + license = licenses.bsd3; + maintainers = with maintainers; [ sargon ]; + platforms = with platforms; linux; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/radvd/default.nix b/nixpkgs/pkgs/tools/networking/radvd/default.nix new file mode 100644 index 000000000000..de8b9a0a4f1e --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/radvd/default.nix @@ -0,0 +1,27 @@ +{ lib, stdenv, fetchurl, pkg-config, libdaemon, bison, flex, check }: + +stdenv.mkDerivation rec { + pname = "radvd"; + version = "2.19"; + + src = fetchurl { + url = "http://www.litech.org/radvd/dist/${pname}-${version}.tar.xz"; + sha256 = "0h722f17h7cra1sjgrxhrrvx54mm47fs039909yhbabigxch8kjn"; + }; + + nativeBuildInputs = [ pkg-config bison flex check ]; + buildInputs = [ libdaemon ]; + + # Needed for cross-compilation + makeFlags = [ + "AR=${stdenv.cc.targetPrefix}ar" + ]; + + meta = with lib; { + homepage = "http://www.litech.org/radvd/"; + description = "IPv6 Router Advertisement Daemon"; + platforms = platforms.linux; + license = licenses.bsdOriginal; + maintainers = with maintainers; [ fpletz ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/ratools/default.nix b/nixpkgs/pkgs/tools/networking/ratools/default.nix new file mode 100644 index 000000000000..0eea11bb3f58 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/ratools/default.nix @@ -0,0 +1,28 @@ +{ lib, stdenv, fetchFromGitHub }: + +stdenv.mkDerivation rec { + pname = "ratools"; + version = "0.6.2"; + + src = fetchFromGitHub { + owner = "danrl"; + repo = "ratools"; + rev = "v${version}"; + sha256 = "07m45bn9lzgbfihmxic23wqp73nxg5ihrvkigr450jq6gzvgwawq"; + }; + + makeFlags = [ "-C" "src" ]; + + installPhase = '' + install -vD bin/* -t $out/bin + install -vD man/* -t $out/share/man/man8 + ''; + + meta = with lib; { + description = "A fast, dynamic, multi-threading framework for IPv6 Router Advertisements"; + homepage = "https://github.com/danrl/ratools"; + license = licenses.asl20; + platforms = platforms.linux; + maintainers = [ maintainers.fpletz ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/rcon/default.nix b/nixpkgs/pkgs/tools/networking/rcon/default.nix new file mode 100644 index 000000000000..03c2a1ae1a37 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/rcon/default.nix @@ -0,0 +1,30 @@ +{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, glib, libbsd, check, pcre }: + +stdenv.mkDerivation rec { + pname = "rcon"; + version = "0.6"; + + src = fetchFromGitHub { + owner = "n0la"; + repo = "rcon"; + rev = version; + sha256 = "sha256-bHm6JeWmpg42VZQXikHl+BMx9zimRLBQWemTqOxyLhw="; + }; + + nativeBuildInputs = [ cmake pkg-config ]; + + buildInputs = [ + glib + libbsd + check + pcre + ]; + + meta = with lib; { + homepage = "https://github.com/n0la/rcon"; + description = "Source RCON client for command line"; + maintainers = with maintainers; [ f4814n ]; + platforms = with platforms; linux ++ darwin; + license = licenses.bsd2; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/rdrview/default.nix b/nixpkgs/pkgs/tools/networking/rdrview/default.nix new file mode 100644 index 000000000000..8f5103957053 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/rdrview/default.nix @@ -0,0 +1,26 @@ +{ lib, stdenv, fetchFromGitHub, libxml2, curl, libseccomp }: + +stdenv.mkDerivation { + name = "rdrview"; + version = "unstable-2020-12-22"; + + src = fetchFromGitHub { + owner = "eafer"; + repo = "rdrview"; + rev = "7be01fb36a6ab3311a9ad1c8c2c75bf5c1345d93"; + sha256 = "00hnvrrrkyp5429rzcvabq2z00lp1l8wsqxw4h7qsdms707mjnxs"; + }; + + buildInputs = [ libxml2 curl libseccomp ]; + + installPhase = '' + install -Dm755 rdrview -t $out/bin + ''; + + meta = with lib; { + description = "Command line tool to extract main content from a webpage"; + homepage = "https://github.com/eafer/rdrview"; + license = licenses.asl20; + maintainers = with maintainers; [ djanatyn ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/reaver-wps-t6x/default.nix b/nixpkgs/pkgs/tools/networking/reaver-wps-t6x/default.nix new file mode 100644 index 000000000000..147eb2c3bf24 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/reaver-wps-t6x/default.nix @@ -0,0 +1,26 @@ +{ lib, stdenv, fetchFromGitHub, libpcap, pixiewps, makeWrapper }: + +stdenv.mkDerivation rec { + pname = "reaver-wps-t6x"; + version = "1.6.5"; + + src = fetchFromGitHub { + owner = "t6x"; + repo = "reaver-wps-fork-t6x"; + rev = "v${version}"; + sha256 = "03v5jyb4if74rpg0mcd8700snb120b6w2gnsa3aqdgj5676ic5dn"; + }; + + nativeBuildInputs = [ makeWrapper ]; + buildInputs = [ libpcap pixiewps ]; + + sourceRoot = "source/src"; + + meta = with lib; { + description = "Online and offline brute force attack against WPS"; + homepage = "https://github.com/t6x/reaver-wps-fork-t6x"; + license = licenses.gpl2Plus; + platforms = platforms.linux; + maintainers = with maintainers; [ nico202 volth ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/reaver-wps/default.nix b/nixpkgs/pkgs/tools/networking/reaver-wps/default.nix new file mode 100644 index 000000000000..ec226f50668b --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/reaver-wps/default.nix @@ -0,0 +1,39 @@ +{ lib, stdenv, fetchurl, libpcap, sqlite, makeWrapper }: + +stdenv.mkDerivation rec { + version = "1.4"; + pname = "reaver-wps"; + confdir = "/var/db/${pname}-${version}"; # the sqlite database is at "${confdir}/reaver/reaver.db" + + src = fetchurl { + url = "https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/reaver-wps/reaver-${version}.tar.gz"; + sha256 = "0bdjai4p8xbsw8zdkkk43rgsif79x0nyx4djpyv0mzh59850blxd"; + }; + + nativeBuildInputs = [ makeWrapper ]; + buildInputs = [ libpcap sqlite ]; + + + setSourceRoot = '' + sourceRoot=$(echo */src) + ''; + + configureFlags = [ "--sysconfdir=${confdir}" ]; + + installPhase = '' + mkdir -p $out/{bin,etc} + cp reaver.db $out/etc/ + cp reaver wash $out/bin/ + + wrapProgram $out/bin/reaver --run "[ -s ${confdir}/reaver/reaver.db ] || install -D $out/etc/reaver.db ${confdir}/reaver/reaver.db" + wrapProgram $out/bin/wash --run "[ -s ${confdir}/reaver/reaver.db ] || install -D $out/etc/reaver.db ${confdir}/reaver/reaver.db" + ''; + + meta = with lib; { + description = "Brute force attack against Wifi Protected Setup"; + homepage = "https://code.google.com/archive/p/reaver-wps/"; + license = licenses.gpl2Plus; + platforms = platforms.linux; + maintainers = with maintainers; [ nico202 volth ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/redir/default.nix b/nixpkgs/pkgs/tools/networking/redir/default.nix new file mode 100644 index 000000000000..83d52fdf10d2 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/redir/default.nix @@ -0,0 +1,23 @@ +{ lib, stdenv, fetchFromGitHub, autoreconfHook }: + +stdenv.mkDerivation rec { + pname = "redir"; + version = "3.3"; + + src = fetchFromGitHub { + owner = "troglobit"; + repo = "redir"; + rev = "v${version}"; + sha256 = "13n401i3q0xwpfgr21y47kgihi057wbh59xlsna8b8zpm973qny1"; + }; + + nativeBuildInputs = [ autoreconfHook ]; + + meta = { + description = "A TCP port redirector for UNIX"; + homepage = "https://github.com/troglobit/redir"; + license = lib.licenses.gpl2; + maintainers = with lib.maintainers; [ ]; + platforms = lib.platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/redsocks/default.nix b/nixpkgs/pkgs/tools/networking/redsocks/default.nix new file mode 100644 index 000000000000..b609cce90bc5 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/redsocks/default.nix @@ -0,0 +1,33 @@ +{ lib, stdenv, fetchFromGitHub, libevent }: + +let + pkg = "redsocks"; + version = "0.5"; +in +stdenv.mkDerivation { + name = "${pkg}-${version}"; + + src = fetchFromGitHub { + owner = "darkk"; + repo = pkg; + rev = "release-${version}"; + sha256 = "170cpvvivb6y2kwsqj9ppx5brgds9gkn8mixrnvj8z9c15xhvplm"; + }; + + installPhase = + '' + mkdir -p $out/{bin,share} + mv redsocks $out/bin + mv doc $out/share + ''; + + buildInputs = [ libevent ]; + + meta = { + description = "Transparent redirector of any TCP connection to proxy"; + homepage = "http://darkk.net.ru/redsocks/"; + license = lib.licenses.asl20; + maintainers = [ lib.maintainers.ekleog ]; + platforms = lib.platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/ripmime/default.nix b/nixpkgs/pkgs/tools/networking/ripmime/default.nix new file mode 100644 index 000000000000..0dfeb900c9a8 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/ripmime/default.nix @@ -0,0 +1,31 @@ +{ lib, stdenv, fetchurl, libiconv }: + +stdenv.mkDerivation rec { + pname = "ripmime"; + version = "1.4.0.10"; + src = fetchurl { + url = "http://www.pldaniels.com/${pname}/${pname}-${version}.tar.gz"; + sha256 = "0sj06ibmlzy34n8v0mnlq2gwidy7n2aqcwgjh0xssz3vi941aqc9"; + }; + + buildInputs = [ libiconv ]; + preInstall = '' + sed -i Makefile -e "s@LOCATION=.*@LOCATION=$out@" -e "s@man/man1@share/&@" + mkdir -p "$out/bin" "$out/share/man/man1" + ''; + + NIX_CFLAGS_COMPILE=" -Wno-error "; + + meta = with lib; { + description = "Attachment extractor for MIME messages"; + maintainers = with maintainers; [ raskin ]; + homepage = "http://www.pldaniels.com/ripmime/"; + platforms = platforms.all; + }; + + passthru = { + updateInfo = { + downloadPage = "http://www.pldaniels.com/ripmime/"; + }; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/rp-pppoe/default.nix b/nixpkgs/pkgs/tools/networking/rp-pppoe/default.nix new file mode 100644 index 000000000000..fd3a563c209d --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/rp-pppoe/default.nix @@ -0,0 +1,30 @@ +{ lib, stdenv, fetchurl, ppp } : +let + version = "3.12"; +in +stdenv.mkDerivation { + name = "rp-pppoe-" + version; + src = fetchurl { + url = "https://www.roaringpenguin.com/files/download/rp-pppoe-${version}.tar.gz"; + sha256 = "1hl6rjvplapgsyrap8xj46kc9kqwdlm6ya6gp3lv0ihm0c24wy80"; + }; + + buildInputs = [ ppp ]; + + + preConfigure = '' + cd src + export PPPD=${ppp}/sbin/pppd + ''; + postConfigure = '' + sed -i Makefile -e 's@DESTDIR)/etc/ppp@out)/etc/ppp@' + sed -i Makefile -e 's@PPPOESERVER_PPPD_OPTIONS=@&$(out)@' + ''; + + meta = with lib; { + description = "Roaring Penguin Point-to-Point over Ethernet tool"; + platforms = platforms.linux; + homepage = "https://www.roaringpenguin.com/products/pppoe"; + license = licenses.gpl2Plus; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/rshijack/default.nix b/nixpkgs/pkgs/tools/networking/rshijack/default.nix new file mode 100644 index 000000000000..76a674dead0d --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/rshijack/default.nix @@ -0,0 +1,23 @@ +{ lib, fetchFromGitHub, rustPlatform }: + +rustPlatform.buildRustPackage rec { + pname = "rshijack"; + version = "0.3.0"; + + src = fetchFromGitHub { + owner = "kpcyrd"; + repo = pname; + rev = "v${version}"; + sha256 = "0y01hi3jpfawqlqs8ka0vwfhjw5j5gkhk2nz5m13ns2h27bw20v7"; + }; + + cargoSha256 = "1rbp94wxr8kqjfg35hf44vn3qa0f0jcq8i50a8d0g5y2qf12h04d"; + + meta = with lib; { + description = "TCP connection hijacker"; + homepage = "https://github.com/kpcyrd/rshijack"; + license = licenses.gpl3; + maintainers = with maintainers; [ xrelkd ]; + platforms = platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/rtptools/default.nix b/nixpkgs/pkgs/tools/networking/rtptools/default.nix new file mode 100644 index 000000000000..5d439f183d2f --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/rtptools/default.nix @@ -0,0 +1,16 @@ +{ stdenv, lib, fetchurl }: +stdenv.mkDerivation rec { + pname = "rtptools"; + version = "1.22"; + src = fetchurl { + url = "http://www.cs.columbia.edu/irt/software/rtptools/download/rtptools-${version}.tar.gz"; + sha256 = "0a4c0vmhxibfc58rrxpbav2bsk546chkg50ir4h3i57v4fjb4xic"; + }; + meta = { + description = "A number of small applications that can be used for processing RTP data"; + homepage = "https://www.cs.columbia.edu/irt/software/rtptools/"; + maintainers = [ lib.maintainers.lheckemann ]; + platforms = lib.platforms.unix; + license = lib.licenses.bsd3; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/s3cmd/default.nix b/nixpkgs/pkgs/tools/networking/s3cmd/default.nix new file mode 100644 index 000000000000..15f6ff3dfa0c --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/s3cmd/default.nix @@ -0,0 +1,24 @@ +{ lib, buildPythonApplication, fetchFromGitHub, python_magic, dateutil }: + +buildPythonApplication rec { + pname = "s3cmd"; + version = "2.1.0"; + + src = fetchFromGitHub { + owner = "s3tools"; + repo = "s3cmd"; + rev = "v${version}"; + sha256 = "0p6mbgai7f0c12pkw4s7d649gj1f8hywj60pscxvj9jsna3iifhs"; + }; + + propagatedBuildInputs = [ python_magic dateutil ]; + + dontUseSetuptoolsCheck = true; + + meta = with lib; { + homepage = "https://s3tools.org/s3cmd"; + description = "Command line tool for managing Amazon S3 and CloudFront services"; + license = licenses.gpl2; + maintainers = [ maintainers.spwhitt ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/s3gof3r/default.nix b/nixpkgs/pkgs/tools/networking/s3gof3r/default.nix new file mode 100644 index 000000000000..4623b68ad4cf --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/s3gof3r/default.nix @@ -0,0 +1,17 @@ +{ lib, buildGoPackage, fetchgit }: + +buildGoPackage rec { + pname = "s3gof3r"; + version = "20151109-${lib.strings.substring 0 7 rev}"; + rev = "31603a0dc94aefb822bfe2ceea75a6be6013b445"; + + goPackagePath = "github.com/rlmcpherson/s3gof3r"; + + src = fetchgit { + inherit rev; + url = "https://github.com/rlmcpherson/s3gof3r"; + sha256 = "10banc8hnhxpsdmlkf9nc5fjkh1349bgpd9k7lggw3yih1rvmh7k"; + }; + + goDeps = ./deps.nix; +} diff --git a/nixpkgs/pkgs/tools/networking/s3gof3r/deps.nix b/nixpkgs/pkgs/tools/networking/s3gof3r/deps.nix new file mode 100644 index 000000000000..49c5d600be2f --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/s3gof3r/deps.nix @@ -0,0 +1,11 @@ +[ + { + goPackagePath = "github.com/jessevdk/go-flags"; + fetch = { + type = "git"; + url = "https://github.com/jessevdk/go-flags"; + rev = "1b89bf73cd2c3a911d7b2a279ab085c4a18cf539"; + sha256 = "027nglc5xx1cm03z9sisg0iqrhwcj6gh5z254rrpl8p4fwrxx680"; + }; + } +] diff --git a/nixpkgs/pkgs/tools/networking/s3rs/default.nix b/nixpkgs/pkgs/tools/networking/s3rs/default.nix new file mode 100644 index 000000000000..2e707ed99163 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/s3rs/default.nix @@ -0,0 +1,26 @@ +{ lib, stdenv, rustPlatform, python3, perl, openssl, Security, fetchFromGitHub, pkg-config }: + +rustPlatform.buildRustPackage rec { + pname = "s3rs"; + version = "0.4.8"; + + src = fetchFromGitHub { + owner = "yanganto"; + repo = pname; + rev = "v${version}"; + sha256 = "sha256-lYIE5yR7UNUjpqfwT6R0C0ninNvVZdatYd/n+yyGsms="; + }; + + cargoSha256 = "sha256-vCTJ7TClvuIP9IoqXwNFH7/u9jXt/Ue/Dhefx5rCgmA="; + + nativeBuildInputs = [ python3 perl pkg-config ]; + buildInputs = [ openssl ] + ++ lib.optionals stdenv.isDarwin [ Security ]; + + meta = with lib; { + description = "A s3 cli client with multi configs with diffent provider"; + homepage = "https://github.com/yanganto/s3rs"; + license = licenses.mit; + maintainers = with maintainers; [ yanganto ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/s4cmd/default.nix b/nixpkgs/pkgs/tools/networking/s4cmd/default.nix new file mode 100644 index 000000000000..95dc02cb5cd4 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/s4cmd/default.nix @@ -0,0 +1,35 @@ +{ lib, python3Packages }: + +python3Packages.buildPythonApplication rec { + pname = "s4cmd"; + version = "2.1.0"; + + src = python3Packages.fetchPypi { + inherit pname version; + sha256 = "0d4mx98i3qhvlmr9x898mjvf827smzx6x5ji6daiwgjdlxc60mj2"; + }; + + propagatedBuildInputs = with python3Packages; [ boto3 pytz ]; + + # The upstream package tries to install some bash shell completion scripts in /etc. + # Setuptools is bugged and doesn't handle --prefix properly: https://github.com/pypa/setuptools/issues/130 + patchPhase = '' + sed -i '/ data_files=/d' setup.py + sed -i 's|os.chmod("/etc.*|pass|' setup.py + ''; + + # Replace upstream's s4cmd wrapper script with the built-in Nix wrapper + postInstall = '' + ln -fs $out/bin/s4cmd.py $out/bin/s4cmd + ''; + + # Test suite requires an S3 bucket + doCheck = false; + + meta = with lib; { + homepage = "https://github.com/bloomreach/s4cmd"; + description = "Super S3 command line tool"; + license = licenses.asl20; + maintainers = [ maintainers.bhipple ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/s5cmd/default.nix b/nixpkgs/pkgs/tools/networking/s5cmd/default.nix new file mode 100644 index 000000000000..f4a6c2915be6 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/s5cmd/default.nix @@ -0,0 +1,22 @@ +{ lib, buildGoModule, fetchFromGitHub }: + +buildGoModule rec { + pname = "s5cmd"; + version = "1.2.1"; + + src = fetchFromGitHub { + owner = "peak"; + repo = "s5cmd"; + rev = "v${version}"; + sha256 = "sha256-09vBYwnTfLIuu2SPP7DYB+U6sUkQffglIOHNn4+47qQ="; + }; + + vendorSha256 = null; + + meta = with lib; { + homepage = "https://github.com/peak/s5cmd"; + description = "Parallel S3 and local filesystem execution tool"; + license = licenses.mit; + maintainers = with maintainers; [ tomberek ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/s6-dns/default.nix b/nixpkgs/pkgs/tools/networking/s6-dns/default.nix new file mode 100644 index 000000000000..5036b1a87eaa --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/s6-dns/default.nix @@ -0,0 +1,36 @@ +{ skawarePackages }: + +with skawarePackages; + +buildPackage { + pname = "s6-dns"; + version = "2.3.5.0"; + sha256 = "0h5p5dbkkdadahrp4pqhc3x9ds758i6djy49k5zrn7mm5k4722wz"; + + description = "A suite of DNS client programs and libraries for Unix systems"; + + outputs = [ "bin" "lib" "dev" "doc" "out" ]; + + configureFlags = [ + "--libdir=\${lib}/lib" + "--libexecdir=\${lib}/libexec" + "--dynlibdir=\${lib}/lib" + "--bindir=\${bin}/bin" + "--includedir=\${dev}/include" + "--with-sysdeps=${skalibs.lib}/lib/skalibs/sysdeps" + "--with-include=${skalibs.dev}/include" + "--with-lib=${skalibs.lib}/lib" + "--with-dynlib=${skalibs.lib}/lib" + ]; + + postInstall = '' + # remove all s6-dns executables from build directory + rm $(find -type f -mindepth 1 -maxdepth 1 -executable) + rm libs6dns.* + rm libskadns.* + rm libdcache.* + + mv doc $doc/share/doc/s6-dns/html + ''; + +} diff --git a/nixpkgs/pkgs/tools/networking/s6-networking/default.nix b/nixpkgs/pkgs/tools/networking/s6-networking/default.nix new file mode 100644 index 000000000000..be19656f1c2d --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/s6-networking/default.nix @@ -0,0 +1,66 @@ +{ lib, skawarePackages + +# Whether to build the TLS/SSL tools and what library to use +# acceptable values: "bearssl", "libressl", false +, sslSupport ? "bearssl" , libressl, bearssl +}: + +with skawarePackages; +let + sslSupportEnabled = sslSupport != false; + sslLibs = { + libressl = libressl; + bearssl = bearssl; + }; + +in +assert sslSupportEnabled -> sslLibs ? ${sslSupport}; + + +buildPackage { + pname = "s6-networking"; + version = "2.4.1.0"; + sha256 = "023wnayv1gddklnsh3qv7i5jfy2fisbp24wa0nzjg0nfq3p807yc"; + + description = "A suite of small networking utilities for Unix systems"; + + outputs = [ "bin" "lib" "dev" "doc" "out" ]; + + # TODO: nsss support + configureFlags = [ + "--libdir=\${lib}/lib" + "--libexecdir=\${lib}/libexec" + "--dynlibdir=\${lib}/lib" + "--bindir=\${bin}/bin" + "--includedir=\${dev}/include" + "--with-sysdeps=${skalibs.lib}/lib/skalibs/sysdeps" + "--with-include=${skalibs.dev}/include" + "--with-include=${execline.dev}/include" + "--with-include=${s6.dev}/include" + "--with-include=${s6-dns.dev}/include" + "--with-lib=${skalibs.lib}/lib" + "--with-lib=${execline.lib}/lib" + "--with-lib=${s6.out}/lib" + "--with-lib=${s6-dns.lib}/lib" + "--with-dynlib=${skalibs.lib}/lib" + "--with-dynlib=${execline.lib}/lib" + "--with-dynlib=${s6.out}/lib" + "--with-dynlib=${s6-dns.lib}/lib" + ] + ++ (lib.optionals sslSupportEnabled [ + "--enable-ssl=${sslSupport}" + "--with-include=${lib.getDev sslLibs.${sslSupport}}/include" + "--with-lib=${lib.getLib sslLibs.${sslSupport}}/lib" + "--with-dynlib=${lib.getLib sslLibs.${sslSupport}}/lib" + ]); + + postInstall = '' + # remove all s6 executables from build directory + rm $(find -name "s6-*" -type f -mindepth 1 -maxdepth 1 -executable) + rm minidentd + rm libs6net.* libstls.* libs6tls.* libsbearssl.* + + mv doc $doc/share/doc/s6-networking/html + ''; + +} diff --git a/nixpkgs/pkgs/tools/networking/saldl/default.nix b/nixpkgs/pkgs/tools/networking/saldl/default.nix new file mode 100644 index 000000000000..d02acb3100a7 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/saldl/default.nix @@ -0,0 +1,50 @@ +{ lib, stdenv +, fetchFromGitHub +, pkg-config +, wafHook +, python3 +, asciidoc +, docbook_xml_dtd_45 +, docbook_xsl +, libxml2 +, libxslt +, curl +, libevent +}: + +stdenv.mkDerivation rec { + pname = "saldl"; + version = "41"; + + src = fetchFromGitHub { + owner = pname; + repo = pname; + rev = "v${version}"; + sha256 = "sha256-PAX2MUyBWWU8kGkaeoCJteidgszh7ipwDJbrLXzVsn0="; + }; + + nativeBuildInputs = [ + pkg-config + wafHook + python3 + asciidoc + docbook_xml_dtd_45 + docbook_xsl + libxml2 + libxslt + ]; + + buildInputs = [ curl libevent ]; + + wafConfigureFlags = [ "--saldl-version ${version}" "--no-werror" ]; + + outputs = [ "out" "man" ]; + + meta = with lib; { + description = "CLI downloader optimized for speed and early preview"; + homepage = "https://saldl.github.io"; + license = licenses.agpl3; + maintainers = with maintainers; [ zowoq ]; + platforms = platforms.all; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/samplicator/default.nix b/nixpkgs/pkgs/tools/networking/samplicator/default.nix new file mode 100644 index 000000000000..44546465d9ee --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/samplicator/default.nix @@ -0,0 +1,23 @@ +{ lib, stdenv, fetchFromGitHub, autoreconfHook }: + +stdenv.mkDerivation rec { + pname = "samplicator"; + version = "1.3.8rc1"; + + nativeBuildInputs = [ autoreconfHook ]; + buildInputs = [ ]; + + src = fetchFromGitHub { + owner = "sleinen"; + repo = "samplicator"; + rev = version; + sha256 = "0fv5vldmwd6qrdv2wkk946dk9rn9nrv3c84ldvvqqn1spxfzgirm"; + }; + + meta = { + description = "Send copies of (UDP) datagrams to multiple receivers"; + homepage = "https://github.com/sleinen/samplicator/"; + license = lib.licenses.gpl2Plus; + platforms = lib.platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/servefile/default.nix b/nixpkgs/pkgs/tools/networking/servefile/default.nix new file mode 100644 index 000000000000..a901182635cb --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/servefile/default.nix @@ -0,0 +1,23 @@ +{ buildPythonApplication, lib, fetchurl }: + +buildPythonApplication { + pname = "servefile"; + version = "0.4.4"; + + src = fetchurl { + url = "https://seba-geek.de/proj/servefile/servefile-0.4.4.tar.gz"; + sha256 = "1hibps5w2h922cfblp7jn50lbk3ilbdk9qvpc2h7b9giilaw2hwb"; + }; + + postInstall = '' + mkdir -p $out/share/man/man1 + cp servefile.1 $out/share/man/man1 + ''; + + meta = with lib; { + homepage = "https://seba-geek.de/stuff/servefile/"; + maintainers = with maintainers; [ qyliss ]; + license = licenses.gpl3Plus; + platforms = platforms.all; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/shadowfox/default.nix b/nixpkgs/pkgs/tools/networking/shadowfox/default.nix new file mode 100644 index 000000000000..e6b1c823eb88 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/shadowfox/default.nix @@ -0,0 +1,31 @@ +{ lib, fetchFromGitHub, buildGoModule }: + +buildGoModule rec { + pname = "shadowfox"; + version = "2.2.0"; + + src = fetchFromGitHub { + owner = "SrKomodo"; + repo = "shadowfox-updater"; + rev = "v${version}"; + sha256 = "125mw70jidbp436arhv77201jdp6mpgqa2dzmrpmk55f9bf29sg6"; + }; + + vendorSha256 = "06ar9ivry9b01609izjbl6hqgg0cy7aqd8n2cqpyq0g7my0l0lbj"; + + doCheck = false; + + buildFlagsArray = [ + "-ldflags=-X main.tag=v${version}" + ]; + + meta = with lib; { + description = '' + This project aims at creating a universal dark theme for Firefox while + adhering to the modern design principles set by Mozilla. + ''; + homepage = "https://overdodactyl.github.io/ShadowFox/"; + license = licenses.mit; + maintainers = with maintainers; [ infinisil ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/shadowsocks-libev/default.nix b/nixpkgs/pkgs/tools/networking/shadowsocks-libev/default.nix new file mode 100644 index 000000000000..b0a24b539c2b --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/shadowsocks-libev/default.nix @@ -0,0 +1,40 @@ +{ lib, stdenv, fetchFromGitHub, cmake +, libsodium, mbedtls, libev, c-ares, pcre +, asciidoc, xmlto, docbook_xml_dtd_45, docbook_xsl, libxslt +}: + +stdenv.mkDerivation rec { + pname = "shadowsocks-libev"; + version = "3.3.5"; + + # Git tag includes CMake build files which are much more convenient. + src = fetchFromGitHub { + owner = "shadowsocks"; + repo = pname; + rev = "refs/tags/v${version}"; + sha256 = "1iqpmhxk354db1x08axg6wrdy9p9a4mz0h9351i3mf3pqd1v6fdw"; + fetchSubmodules = true; + }; + + buildInputs = [ libsodium mbedtls libev c-ares pcre ]; + nativeBuildInputs = [ cmake asciidoc xmlto docbook_xml_dtd_45 + docbook_xsl libxslt ]; + + cmakeFlags = [ "-DWITH_STATIC=OFF" "-DCMAKE_BUILD_WITH_INSTALL_NAME_DIR=ON" ]; + + postInstall = '' + cp lib/* $out/lib + ''; + + meta = with lib; { + description = "A lightweight secured SOCKS5 proxy"; + longDescription = '' + Shadowsocks-libev is a lightweight secured SOCKS5 proxy for embedded devices and low-end boxes. + It is a port of Shadowsocks created by @clowwindy, which is maintained by @madeye and @linusyang. + ''; + homepage = "https://github.com/shadowsocks/shadowsocks-libev"; + license = licenses.gpl3Plus; + maintainers = [ maintainers.nfjinjing ]; + platforms = platforms.all; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/shadowsocks-rust/default.nix b/nixpkgs/pkgs/tools/networking/shadowsocks-rust/default.nix new file mode 100644 index 000000000000..971570717331 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/shadowsocks-rust/default.nix @@ -0,0 +1,29 @@ +{ lib, stdenv, fetchFromGitHub, rustPlatform, CoreServices, libiconv }: + +rustPlatform.buildRustPackage rec { + pname = "shadowsocks-rust"; + version = "1.10.7"; + + src = fetchFromGitHub { + rev = "v${version}"; + owner = "shadowsocks"; + repo = pname; + sha256 = "08k5j469750bhlq49qc5nwc2jjgmy9qsm58nf2jfwhxlpflv12sc"; + }; + + cargoSha256 = "1r8w5cdygd26m95q9qpqa85aixx25jr510hpjlllbpfvm7zjpbqk"; + + RUSTC_BOOTSTRAP = 1; + + buildInputs = lib.optionals stdenv.isDarwin [ CoreServices libiconv ]; + + checkFlags = [ "--skip=http_proxy" "--skip=udp_tunnel" ]; + + meta = with lib; { + homepage = "https://github.com/shadowsocks/shadowsocks-rust"; + description = "A Rust port of shadowsocks"; + license = licenses.mit; + maintainers = [ maintainers.marsam ]; + broken = stdenv.isAarch64; # crypto2 crate doesn't build on aarch64 + }; +} diff --git a/nixpkgs/pkgs/tools/networking/shadowsocks-v2ray-plugin/default.nix b/nixpkgs/pkgs/tools/networking/shadowsocks-v2ray-plugin/default.nix new file mode 100644 index 000000000000..be3a2f77d5c4 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/shadowsocks-v2ray-plugin/default.nix @@ -0,0 +1,23 @@ +{ lib, buildGoModule, fetchFromGitHub }: + +buildGoModule rec { + pname = "shadowsocks-v2ray-plugin"; + version = "1.3.1"; + + src = fetchFromGitHub { + owner = "shadowsocks"; + repo = "v2ray-plugin"; + rev = "v${version}"; + sha256 = "0aq445gnqk9dxs1hkw7rvk86wg0iyiy0h740lvyh6d9zsqhf61wb"; + }; + + vendorSha256 = "0vzd9v33p4a32f5ic9ir4g5ckis06wpdf07a649h9qalimxnvzfz"; + + meta = with lib; { + description = "Yet another SIP003 plugin for shadowsocks, based on v2ray"; + homepage = "https://github.com/shadowsocks/v2ray-plugin/"; + license = licenses.mit; + maintainers = [ maintainers.ahrzb ]; + }; +} + diff --git a/nixpkgs/pkgs/tools/networking/shncpd/default.nix b/nixpkgs/pkgs/tools/networking/shncpd/default.nix new file mode 100644 index 000000000000..8cfd1f94252a --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/shncpd/default.nix @@ -0,0 +1,27 @@ +{ lib, stdenv, fetchFromGitHub }: + +stdenv.mkDerivation { + pname = "shncpd"; + version = "2016-06-22"; + + src = fetchFromGitHub { + owner = "jech"; + repo = "shncpd"; + rev = "62ef688db7a6535ce11e66c8c93ab64a1bb09484"; + sha256 = "1sj7a77isc2jmh7gw2naw9l9366kjx6jb909h7spj7daxdwvji8f"; + }; + + hardeningEnable = [ "pie" ]; + + preConfigure = '' + makeFlags=( "PREFIX=$out" ) + ''; + + meta = with lib; { + description = "Simple, stupid and slow HNCP daemon"; + homepage = "https://www.irif.univ-paris-diderot.fr/~jch/software/homenet/shncpd.html"; + license = licenses.mit; + platforms = platforms.linux; + maintainers = [ maintainers.fpletz ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/shorewall/default.nix b/nixpkgs/pkgs/tools/networking/shorewall/default.nix new file mode 100644 index 000000000000..f95fc9d92b18 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/shorewall/default.nix @@ -0,0 +1,130 @@ +{ coreutils +, ebtables +, fetchurl +, gnugrep +, gnused +, iproute2 +, ipset +, iptables +, perl +, perlPackages +, lib, stdenv +, tree +, util-linux +}: +let + PATH = lib.concatStringsSep ":" + [ "${coreutils}/bin" + "${iproute2}/bin" + "${iptables}/bin" + "${ipset}/bin" + "${ebtables}/bin" + "${util-linux}/bin" + "${gnugrep}/bin" + "${gnused}/bin" + ]; +in +stdenv.mkDerivation rec { + pname = "shorewall"; + version = "5.2.3.3"; + + srcs = [ + (fetchurl { + url = "http://www.shorewall.net/pub/shorewall/5.2/shorewall-5.2.3/shorewall-core-${version}.tar.bz2"; + sha256 = "1gg2yfxzm3y9qqjrrg5nq2ggi1c6yfxx0s7fvwjw70b185mwa5p5"; + }) + (fetchurl { + url = "http://www.shorewall.net/pub/shorewall/5.2/shorewall-5.2.3/shorewall-${version}.tar.bz2"; + sha256 = "1ka70pa3s0cnvc83rlm57r05cdv9idnxnq0vmxi6nr7razak5f3b"; + }) + (fetchurl { + url = "http://www.shorewall.net/pub/shorewall/5.2/shorewall-5.2.3/shorewall6-${version}.tar.bz2"; + sha256 = "0mhs4m6agwk082h1n69gnyfsjpycdd8215r4r9rzb3czs5xi087n"; + }) + ]; + sourceRoot = "."; + + buildInputs = [ + coreutils + iproute2 + ipset + iptables + ebtables + util-linux + gnugrep + gnused + perl + ] ++ (with perlPackages; [ + DigestSHA1 + ]); + prePatch = '' + # Patch configure and install.sh files + patchShebangs . + + # Remove hardcoded PATH + sed -i shorewall-core-${version}/lib.cli \ + -e '/^ *PATH=.*/d' + ''; + configurePhase = '' + shorewall-core-${version}/configure \ + HOST=linux \ + PREFIX=$out \ + CONFDIR=\$PREFIX/etc-example \ + SBINDIR=\$PREFIX/sbin \ + SYSCONFDIR= \ + SHAREDIR=\$PREFIX/share \ + LIBEXECDIR=\$SHAREDIR \ + PERLLIBDIR=\$SHAREDIR/shorewall \ + MANDIR=$out/man \ + VARLIB=/var/lib \ + INITSOURCE= \ + INITDIR= \ + INITFILE= \ + DEFAULT_PAGER= + ''; + installPhase = '' + export DESTDIR=/ + shorewall-core-${version}/install.sh + + ln -s ../shorewall-core-${version}/shorewallrc shorewall-${version}/ + shorewall-${version}/install.sh + + ln -s ../shorewall-core-${version}/shorewallrc shorewall6-${version}/ + shorewall6-${version}/install.sh + + # Patch the example shorewall{,6}.conf in case it is included + # in services.shorewall{,6}.configs + sed -i $out/etc-example/shorewall/shorewall.conf \ + $out/etc-example/shorewall6/shorewall6.conf \ + -e 's|^LOGFILE=.*|LOGFILE=/var/log/shorewall.log|' \ + -e 's|^PATH=.*|PATH=${PATH}|' \ + -e 's|^PERL=.*|PERL=${perl}/bin/perl|' \ + -e 's|^SHOREWALL_SHELL=.*|SHOREWALL_SHELL=${stdenv.shell}|' + sed -i $out/etc-example/shorewall6/shorewall6.conf \ + -e 's|^CONFIG_PATH=.*|CONFIG_PATH=:''${CONFDIR}/shorewall6:''${SHAREDIR}/shorewall6:''${SHAREDIR}/shorewall|' + # FIXME: the default GEOIPDIR=/usr/share/xt_geoip/LE may require attention. + + # Redirect CONFDIR to /etc where services.shorewall{,6}.configs + # will generate the config files. + sed -i $out/share/shorewall/shorewallrc \ + -e 's~^CONFDIR=.*~CONFDIR=/etc~' + ''; + + meta = { + homepage = "http://www.shorewall.net/"; + description = "An IP gateway/firewall configuration tool for GNU/Linux"; + longDescription = '' + Shorewall is a high-level tool for configuring Netfilter. You describe your + firewall/gateway requirements using entries in a set of configuration + files. Shorewall reads those configuration files and with the help of the + iptables, iptables-restore, ip and tc utilities, Shorewall configures + Netfilter and the Linux networking subsystem to match your requirements. + Shorewall can be used on a dedicated firewall system, a multi-function + gateway/router/server or on a standalone GNU/Linux system. Shorewall does + not use Netfilter's ipchains compatibility mode and can thus take + advantage of Netfilter's connection state tracking capabilities. + ''; + license = lib.licenses.gpl2Plus; + platforms = lib.platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/siege/default.nix b/nixpkgs/pkgs/tools/networking/siege/default.nix new file mode 100644 index 000000000000..3a7e64623afd --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/siege/default.nix @@ -0,0 +1,40 @@ +{ lib +, stdenv +, fetchurl +, openssl +, zlib +}: + +stdenv.mkDerivation rec { + pname = "siege"; + version = "4.0.9"; + + src = fetchurl { + url = "http://download.joedog.org/siege/${pname}-${version}.tar.gz"; + sha256 = "0xzjfljhv9wcf58qw2c1sbpa5nqz1pb6rjpgvz7bxrv90n31bghx"; + }; + + NIX_LDFLAGS = lib.optionalString stdenv.isLinux "-lgcc_s"; + + buildInputs = [ + openssl + zlib + ]; + + prePatch = '' + sed -i -e 's/u_int32_t/uint32_t/g' -e '1i#include <stdint.h>' src/hash.c + ''; + + configureFlags = [ + "--with-ssl=${openssl.dev}" + "--with-zlib=${zlib.dev}" + ]; + + meta = with lib; { + description = "HTTP load tester"; + homepage = "https://www.joedog.org/siege-home/"; + license = licenses.gpl2Plus; + maintainers = with maintainers; [ raskin ]; + platforms = platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/simpleproxy/default.nix b/nixpkgs/pkgs/tools/networking/simpleproxy/default.nix new file mode 100644 index 000000000000..6c110be05da3 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/simpleproxy/default.nix @@ -0,0 +1,21 @@ +{ lib, stdenv, fetchFromGitHub }: + +stdenv.mkDerivation rec { + pname = "simpleproxy"; + version = "3.5"; + rev = "v.${version}"; + + src = fetchFromGitHub { + inherit rev; + owner = "vzaliva"; + repo = "simpleproxy"; + sha256 = "1my9g4vp19dikx3fsbii4ichid1bs9b9in46bkg05gbljhj340f6"; + }; + + meta = with lib; { + homepage = "https://github.com/vzaliva/simpleproxy"; + description = "A simple TCP proxy"; + license = licenses.gpl2; + maintainers = [ maintainers.montag451 ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/sipcalc/default.nix b/nixpkgs/pkgs/tools/networking/sipcalc/default.nix new file mode 100644 index 000000000000..c9470cd5b8b3 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/sipcalc/default.nix @@ -0,0 +1,19 @@ +{ lib, stdenv, fetchurl }: + +stdenv.mkDerivation rec { + pname = "sipcalc"; + version = "1.1.6"; + + src = fetchurl { + url = "http://www.routemeister.net/projects/sipcalc/files/${pname}-${version}.tar.gz"; + sha256 = "cfd476c667f7a119e49eb5fe8adcfb9d2339bc2e0d4d01a1d64b7c229be56357"; + }; + + meta = with lib; { + description = "Advanced console ip subnet calculator"; + homepage = "http://www.routemeister.net/projects/sipcalc/"; + license = licenses.bsd3; + platforms = platforms.all; + maintainers = [ maintainers.globin ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/sipsak/default.nix b/nixpkgs/pkgs/tools/networking/sipsak/default.nix new file mode 100644 index 000000000000..556204972860 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/sipsak/default.nix @@ -0,0 +1,29 @@ +{ lib, stdenv, fetchurl, autoreconfHook, c-ares, openssl ? null }: + +stdenv.mkDerivation rec { + pname = "sipsak"; + version = "4.1.2.1"; + + buildInputs = [ + autoreconfHook + openssl + c-ares + ]; + + NIX_CFLAGS_COMPILE = "--std=gnu89"; + + src = fetchurl { + url = "https://github.com/sipwise/sipsak/archive/mr${version}.tar.gz"; + sha256 = "769fe59966b1962b67aa35aad7beb9a2110ebdface36558072a05c6405fb5374"; + }; + + meta = with lib; { + homepage = "https://github.com/sipwise/sipsak"; + description = "SIP Swiss army knife"; + license = lib.licenses.gpl2; + maintainers = with maintainers; [ sheenobu ]; + platforms = with platforms; unix; + }; + +} + diff --git a/nixpkgs/pkgs/tools/networking/sish/default.nix b/nixpkgs/pkgs/tools/networking/sish/default.nix new file mode 100644 index 000000000000..181582f5452f --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/sish/default.nix @@ -0,0 +1,25 @@ +{ lib +, buildGoModule +, fetchFromGitHub +}: + +buildGoModule rec { + pname = "sish"; + version = "1.1.5"; + + src = fetchFromGitHub { + owner = "antoniomika"; + repo = pname; + rev = "v${version}"; + sha256 = "06ckgxhnijs7yrj0hhwh1vk2fvapwn6wb44w3g6qs6n6fmqh92mb"; + }; + + vendorSha256 = "0vfazbaiaqka5nd7imh5ls7k3asf1c17y081nzkban98svg3l3sj"; + + meta = with lib; { + description = "HTTP(S)/WS(S)/TCP Tunnels to localhost"; + homepage = "https://github.com/antoniomika/sish"; + license = with licenses; [ mit ]; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/slack-cli/default.nix b/nixpkgs/pkgs/tools/networking/slack-cli/default.nix new file mode 100644 index 000000000000..25e426dc43e3 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/slack-cli/default.nix @@ -0,0 +1,49 @@ +# slack-cli must be configured using the SLACK_CLI_TOKEN environment variable. +# Using `slack init` will not work because it tries to write to the Nix store. +# +# There is no reason that we couldn't change the file path that slack-cli uses +# for token storage, except that it would make the Nix package inconsistent with +# upstream and other distributions. + +{ stdenv, lib, fetchFromGitHub, curl, jq, coreutils, gnugrep, gnused +, runtimeShell }: + +stdenv.mkDerivation rec { + pname = "slack-cli"; + version = "0.18.0"; + + src = fetchFromGitHub { + owner = "rockymadden"; + repo = "slack-cli"; + rev = "v${version}"; + sha256 = "022yr3cpfg0v7cxi62zzk08vp0l3w851qpfh6amyfgjiynnfyddl"; + }; + + dontBuild = true; + + installPhase = '' + mkdir -p "$out/bin" + cp src/slack "$out/bin/.slack-wrapped" + + cat <<-WRAPPER > "$out/bin/slack" + #!${runtimeShell} + [ "\$1" = "init" -a -z "\$SLACK_CLI_TOKEN" ] && cat <<-'MESSAGE' >&2 + WARNING: slack-cli must be configured using the SLACK_CLI_TOKEN + environment variable. Using \`slack init\` will not work because it tries + to write to the Nix store. + + MESSAGE + + export PATH=${lib.makeBinPath [ curl jq coreutils gnugrep gnused ]}:"\$PATH" + exec "$out/bin/.slack-wrapped" "\$@" + WRAPPER + + chmod +x "$out/bin/slack" + ''; + + meta = { + license = lib.licenses.mit; + maintainers = [ lib.maintainers.qyliss ]; + platforms = lib.platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/slirp4netns/default.nix b/nixpkgs/pkgs/tools/networking/slirp4netns/default.nix new file mode 100644 index 000000000000..c24b9a860e17 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/slirp4netns/default.nix @@ -0,0 +1,39 @@ +{ lib +, stdenv +, fetchFromGitHub +, autoreconfHook +, pkg-config +, glib +, libcap +, libseccomp +, libslirp +, nixosTests +}: + +stdenv.mkDerivation rec { + pname = "slirp4netns"; + version = "1.1.10"; + + src = fetchFromGitHub { + owner = "rootless-containers"; + repo = "slirp4netns"; + rev = "v${version}"; + sha256 = "sha256-Qk5a8h9IkLwYRmPL8pFlyVsQ/xMZ2/wkq8zZ7yfrLEQ="; + }; + + nativeBuildInputs = [ autoreconfHook pkg-config ]; + + buildInputs = [ glib libcap libseccomp libslirp ]; + + enableParallelBuilding = true; + + passthru.tests = { inherit (nixosTests) podman; }; + + meta = with lib; { + homepage = "https://github.com/rootless-containers/slirp4netns"; + description = "User-mode networking for unprivileged network namespaces"; + license = licenses.gpl2; + maintainers = with maintainers; [ orivej ] ++ teams.podman.members; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/smartdns/default.nix b/nixpkgs/pkgs/tools/networking/smartdns/default.nix new file mode 100644 index 000000000000..91fcc0e982eb --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/smartdns/default.nix @@ -0,0 +1,37 @@ +{ lib, stdenv, fetchFromGitHub, openssl }: + +stdenv.mkDerivation rec { + pname = "smartdns"; + version = "33"; + + src = fetchFromGitHub { + owner = "pymumu"; + repo = pname; + rev = "Release${version}"; + sha256 = "0cmzpm4y1yi96mg2cz2byqw6vl62dgnikldy08q43vi7jl3y0749"; + }; + + buildInputs = [ openssl ]; + + makeFlags = [ + "PREFIX=${placeholder "out"}" + "SYSTEMDSYSTEMUNITDIR=${placeholder "out"}/lib/systemd/system" + "RUNSTATEDIR=/run" + ]; + + installFlags = [ "SYSCONFDIR=${placeholder "out"}/etc" ]; + + meta = with lib; { + description = + "A local DNS server to obtain the fastest website IP for the best Internet experience"; + longDescription = '' + SmartDNS is a local DNS server. SmartDNS accepts DNS query requests from local clients, obtains DNS query results from multiple upstream DNS servers, and returns the fastest access results to clients. + Avoiding DNS pollution and improving network access speed, supports high-performance ad filtering. + Unlike dnsmasq's all-servers, smartdns returns the fastest access resolution. + ''; + homepage = "https://github.com/pymumu/smartdns"; + maintainers = [ maintainers.lexuge ]; + license = licenses.gpl3Plus; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/smokeping/default.nix b/nixpkgs/pkgs/tools/networking/smokeping/default.nix new file mode 100644 index 000000000000..6d0d52271111 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/smokeping/default.nix @@ -0,0 +1,24 @@ +{ lib, stdenv, fetchurl, fping, rrdtool, perlPackages }: + +stdenv.mkDerivation rec { + pname = "smokeping"; + version = "2.6.11"; + src = fetchurl { + url = "https://oss.oetiker.ch/smokeping/pub/smokeping-${version}.tar.gz"; + sha256 = "1p9hpa2zs33p7hzrds80kwrm5255s0869v3s3qmsyx2sx63c7czj"; + }; + propagatedBuildInputs = [ rrdtool ] ++ + (with perlPackages; [ perl FCGI CGI CGIFast ConfigGrammar DigestHMAC NetTelnet + NetOpenSSH NetSNMP LWP IOTty fping NetDNS perlldap ]); + + postInstall = '' + mv $out/htdocs/smokeping.fcgi.dist $out/htdocs/smokeping.fcgi + ''; + meta = { + description = "Network latency collector"; + homepage = "http://oss.oetiker.ch/smokeping"; + license = lib.licenses.gpl2Plus; + platforms = lib.platforms.all; + maintainers = [ lib.maintainers.erictapen ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/snabb/default.nix b/nixpkgs/pkgs/tools/networking/snabb/default.nix new file mode 100644 index 000000000000..affe6577eb80 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/snabb/default.nix @@ -0,0 +1,63 @@ +{ lib, stdenv, fetchFromGitHub, bash, makeWrapper, git, mariadb, diffutils, which, coreutils, procps, nettools +,supportOpenstack ? true +}: + +with lib; + +stdenv.mkDerivation rec { + pname = "snabb"; + version = "2019.11"; + + src = fetchFromGitHub { + owner = "snabbco"; + repo = "snabb"; + rev = "v${version}"; + sha256 = "1sas9d9kk92mc2wrwgmm0xxz7ycmh388dwvyxf1hy183yvin1nac"; + }; + + nativeBuildInputs = [ makeWrapper ]; + + NIX_CFLAGS_COMPILE = [ "-Wno-error=stringop-truncation" ]; + + patchPhase = '' + patchShebangs . + + # some hardcodeism + for f in $(find src/program/snabbnfv/ -type f); do + substituteInPlace $f --replace "/bin/bash" "${bash}/bin/bash" + done + '' + optionalString supportOpenstack '' + # We need a way to pass $PATH to the scripts + sed -i '2iexport PATH=${git}/bin:${mariadb}/bin:${which}/bin:${procps}/bin:${coreutils}/bin' src/program/snabbnfv/neutron_sync_master/neutron_sync_master.sh.inc + sed -i '2iexport PATH=${git}/bin:${coreutils}/bin:${diffutils}/bin:${nettools}/bin' src/program/snabbnfv/neutron_sync_agent/neutron_sync_agent.sh.inc + ''; + + preBuild = '' + make clean + ''; + + installPhase = '' + mkdir -p $out/bin + cp src/snabb $out/bin + ''; + + # Dependencies are underspecified: "make -C src obj/arch/sse2_c.o" fails with + # "Fatal error: can't create obj/arch/sse2_c.o: No such file or directory". + enableParallelBuilding = false; + + meta = { + homepage = "https://github.com/SnabbCo/snabbswitch"; + description = "Simple and fast packet networking toolkit"; + longDescription = '' + Snabb Switch is a LuaJIT-based toolkit for writing high-speed + packet networking code (such as routing, switching, firewalling, + and so on). It includes both a scripting inteface for creating + new applications and also some built-in applications that are + ready to run. + It is especially intended for ISPs and other network operators. + ''; + platforms = [ "x86_64-linux" ]; + license = licenses.asl20; + maintainers = [ maintainers.lukego ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/sniffglue/default.nix b/nixpkgs/pkgs/tools/networking/sniffglue/default.nix new file mode 100644 index 000000000000..13efa6e999cf --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/sniffglue/default.nix @@ -0,0 +1,27 @@ +{ lib, fetchFromGitHub, rustPlatform, libpcap, libseccomp, pkg-config }: + +rustPlatform.buildRustPackage rec { + pname = "sniffglue"; + version = "0.12.1"; + + src = fetchFromGitHub { + owner = "kpcyrd"; + repo = pname; + rev = "v${version}"; + sha256 = "sha256-2LyCiW1MrAahpbzyxot0INPMzo0Vl/JToMZTinCQdgs="; + }; + + cargoSha256 = "sha256-AGwiyC7Zf8KHQIHfHByL06sdbS4vEXUyj1wGw7Q1N9I="; + + nativeBuildInputs = [ pkg-config ]; + + buildInputs = [ libpcap libseccomp ]; + + meta = with lib; { + description = "Secure multithreaded packet sniffer"; + homepage = "https://github.com/kpcyrd/sniffglue"; + license = licenses.gpl3Plus; + maintainers = with maintainers; [ xrelkd ]; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/socat/2.x.nix b/nixpkgs/pkgs/tools/networking/socat/2.x.nix new file mode 100644 index 000000000000..0105fa322c1a --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/socat/2.x.nix @@ -0,0 +1,24 @@ +{ lib, stdenv, fetchurl, openssl }: + +stdenv.mkDerivation rec { + name = "socat-2.0.0-b9"; + + src = fetchurl { + url = "http://www.dest-unreach.org/socat/download/${name}.tar.bz2"; + sha256 = "1ll395xjv4byvv0k2zjbxk8vp3mg3y2w5paa05wv553bqsjv1vs9"; + }; + + buildInputs = [ openssl ]; + + patches = lib.singleton ./libressl-fixes.patch ; + + meta = with lib; { + description = "A utility for bidirectional data transfer between two independent data channels"; + homepage = "http://www.dest-unreach.org/socat/"; + repositories.git = "git://repo.or.cz/socat.git"; + platforms = platforms.unix; + license = licenses.gpl2; + maintainers = [ maintainers.eelco ]; + broken = true; # broken with openssl 1.1 + }; +} diff --git a/nixpkgs/pkgs/tools/networking/socat/default.nix b/nixpkgs/pkgs/tools/networking/socat/default.nix new file mode 100644 index 000000000000..7a24ccf33b74 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/socat/default.nix @@ -0,0 +1,41 @@ +{ lib +, fetchurl +, nettools +, openssl +, readline +, stdenv +, which +}: + +stdenv.mkDerivation rec { + pname = "socat"; + version = "1.7.4.1"; + + src = fetchurl { + url = "http://www.dest-unreach.org/socat/download/${pname}-${version}.tar.bz2"; + sha256 = "1sbmqqvni3ss9wyay6ik5v81kxffkra80mh4ypgj74g82iba5b1z"; + }; + + postPatch = '' + patchShebangs test.sh + substituteInPlace test.sh \ + --replace /bin/rm rm \ + --replace /sbin/ifconfig ifconfig + ''; + + buildInputs = [ openssl readline ]; + + hardeningEnable = [ "pie" ]; + + checkInputs = [ which nettools ]; + doCheck = false; # fails a bunch, hangs + + meta = with lib; { + description = "Utility for bidirectional data transfer between two independent data channels"; + homepage = "http://www.dest-unreach.org/socat/"; + repositories.git = "git://repo.or.cz/socat.git"; + platforms = platforms.unix; + license = with licenses; [ gpl2Only ]; + maintainers = with maintainers; [ eelco ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/socat/libressl-fixes.patch b/nixpkgs/pkgs/tools/networking/socat/libressl-fixes.patch new file mode 100644 index 000000000000..cf66033584eb --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/socat/libressl-fixes.patch @@ -0,0 +1,173 @@ +Patch from OpenBSD +--- a/sslcls.c Sat Jan 24 03:15:22 2015 ++++ b/sslcls.c Sat Jul 18 20:01:59 2015 +@@ -55,6 +55,7 @@ const SSL_METHOD *sycSSLv2_server_method(void) { + } + #endif + ++#ifdef HAVE_SSLv3_client_method + const SSL_METHOD *sycSSLv3_client_method(void) { + const SSL_METHOD *result; + Debug("SSLv3_client_method()"); +@@ -62,7 +63,9 @@ const SSL_METHOD *sycSSLv3_client_method(void) { + Debug1("SSLv3_client_method() -> %p", result); + return result; + } ++#endif + ++#ifdef HAVE_SSLv3_server_method + const SSL_METHOD *sycSSLv3_server_method(void) { + const SSL_METHOD *result; + Debug("SSLv3_server_method()"); +@@ -70,6 +73,7 @@ const SSL_METHOD *sycSSLv3_server_method(void) { + Debug1("SSLv3_server_method() -> %p", result); + return result; + } ++#endif + + const SSL_METHOD *sycSSLv23_client_method(void) { + const SSL_METHOD *result; +@@ -331,14 +335,6 @@ void sycSSL_free(SSL *ssl) { + return; + } + +-int sycRAND_egd(const char *path) { +- int result; +- Debug1("RAND_egd(\"%s\")", path); +- result = RAND_egd(path); +- Debug1("RAND_egd() -> %d", result); +- return result; +-} +- + DH *sycPEM_read_bio_DHparams(BIO *bp, DH **x, pem_password_cb *cb, void *u) { + DH *result; + Debug4("PEM_read_bio_DHparams(%p, %p, %p, %p)", +@@ -375,7 +371,7 @@ int sycFIPS_mode_set(int onoff) { + } + #endif /* WITH_FIPS */ + +-#if OPENSSL_VERSION_NUMBER >= 0x00908000L ++#if (OPENSSL_VERSION_NUMBER >= 0x00908000L) && !defined(OPENSSL_NO_COMP) + const COMP_METHOD *sycSSL_get_current_compression(SSL *ssl) { + const COMP_METHOD *result; + Debug1("SSL_get_current_compression(%p)", ssl); +--- a/sslcls.h Sat Jan 24 11:15:22 2015 ++++ b/sslcls.h Mon Apr 13 15:06:25 2015 +@@ -47,7 +47,6 @@ X509 *sycSSL_get_peer_certificate(SSL *ssl); + int sycSSL_shutdown(SSL *ssl); + void sycSSL_CTX_free(SSL_CTX *ctx); + void sycSSL_free(SSL *ssl); +-int sycRAND_egd(const char *path); + + DH *sycPEM_read_bio_DHparams(BIO *bp, DH **x, pem_password_cb *cb, void *u); + +@@ -55,7 +54,7 @@ BIO *sycBIO_new_file(const char *filename, const char + + int sycFIPS_mode_set(int onoff); + +-#if OPENSSL_VERSION_NUMBER >= 0x00908000L ++#if (OPENSSL_VERSION_NUMBER >= 0x00908000L) && !defined(OPENSSL_NO_COMP) + const COMP_METHOD *sycSSL_get_current_compression(SSL *ssl); + const COMP_METHOD *sycSSL_get_current_expansion(SSL *ssl); + const char *sycSSL_COMP_get_name(const COMP_METHOD *comp); +@@ -98,7 +97,6 @@ const char *sycSSL_COMP_get_name(const COMP_METHOD *co + #define sycSSL_shutdown(s) SSL_shutdown(s) + #define sycSSL_CTX_free(c) SSL_CTX_free(c) + #define sycSSL_free(s) SSL_free(s) +-#define sycRAND_egd(p) RAND_egd(p) + + #define sycPEM_read_bio_DHparams(b,x,p,u) PEM_read_bio_DHparams(b,x,p,u) + +--- a/xio-openssl.c Sat Jan 24 15:33:42 2015 ++++ b/xio-openssl.c Mon Apr 13 14:59:12 2015 +@@ -108,7 +108,6 @@ const struct optdesc opt_openssl_key = { "open + const struct optdesc opt_openssl_dhparam = { "openssl-dhparam", "dh", OPT_OPENSSL_DHPARAM, GROUP_OPENSSL, PH_SPEC, TYPE_FILENAME, OFUNC_SPEC }; + const struct optdesc opt_openssl_cafile = { "openssl-cafile", "cafile", OPT_OPENSSL_CAFILE, GROUP_OPENSSL, PH_SPEC, TYPE_FILENAME, OFUNC_SPEC }; + const struct optdesc opt_openssl_capath = { "openssl-capath", "capath", OPT_OPENSSL_CAPATH, GROUP_OPENSSL, PH_SPEC, TYPE_FILENAME, OFUNC_SPEC }; +-const struct optdesc opt_openssl_egd = { "openssl-egd", "egd", OPT_OPENSSL_EGD, GROUP_OPENSSL, PH_SPEC, TYPE_FILENAME, OFUNC_SPEC }; + const struct optdesc opt_openssl_pseudo = { "openssl-pseudo", "pseudo", OPT_OPENSSL_PSEUDO, GROUP_OPENSSL, PH_SPEC, TYPE_BOOL, OFUNC_SPEC }; + #if OPENSSL_VERSION_NUMBER >= 0x00908000L + const struct optdesc opt_openssl_compress = { "openssl-compress", "compress", OPT_OPENSSL_COMPRESS, GROUP_OPENSSL, PH_SPEC, TYPE_STRING, OFUNC_SPEC }; +@@ -147,7 +146,7 @@ int xio_reset_fips_mode(void) { + static void openssl_conn_loginfo(SSL *ssl) { + Notice1("SSL connection using %s", SSL_get_cipher(ssl)); + +-#if OPENSSL_VERSION_NUMBER >= 0x00908000L ++#if (OPENSSL_VERSION_NUMBER >= 0x00908000L) && !defined(OPENSSL_NO_COMP) + { + const COMP_METHOD *comp, *expansion; + +@@ -722,7 +721,6 @@ int + char *opt_dhparam = NULL; /* file name of DH params */ + char *opt_cafile = NULL; /* certificate authority file */ + char *opt_capath = NULL; /* certificate authority directory */ +- char *opt_egd = NULL; /* entropy gathering daemon socket path */ + #if OPENSSL_VERSION_NUMBER >= 0x00908000L + char *opt_compress = NULL; /* compression method */ + #endif +@@ -741,7 +739,6 @@ int + retropt_string(opts, OPT_OPENSSL_CAPATH, &opt_capath); + retropt_string(opts, OPT_OPENSSL_KEY, &opt_key); + retropt_string(opts, OPT_OPENSSL_DHPARAM, &opt_dhparam); +- retropt_string(opts, OPT_OPENSSL_EGD, &opt_egd); + retropt_bool(opts,OPT_OPENSSL_PSEUDO, &opt_pseudo); + #if OPENSSL_VERSION_NUMBER >= 0x00908000L + retropt_string(opts, OPT_OPENSSL_COMPRESS, &opt_compress); +@@ -877,10 +874,6 @@ int + } + } + +- if (opt_egd) { +- sycRAND_egd(opt_egd); +- } +- + if (opt_pseudo) { + long int randdata; + /* initialize libc random from actual microseconds */ +@@ -1098,7 +1091,7 @@ static int openssl_SSL_ERROR_SSL(int level, const char + if (e == ((ERR_LIB_RAND<<24)| + (RAND_F_SSLEAY_RAND_BYTES<<12)| + (RAND_R_PRNG_NOT_SEEDED)) /*0x24064064*/) { +- Error("too few entropy; use options \"egd\" or \"pseudo\""); ++ Error("too few entropy; use option \"pseudo\""); + stat = STAT_NORETRY; + } else { + Msg2(level, "%s(): %s", funcname, ERR_error_string(e, buf)); +--- a/xio-openssl.h Sun Jun 23 07:16:48 2013 ++++ b/xio-openssl.h Sat Apr 19 15:58:21 2014 +@@ -21,7 +21,6 @@ extern const struct optdesc opt_openssl_key; + extern const struct optdesc opt_openssl_dhparam; + extern const struct optdesc opt_openssl_cafile; + extern const struct optdesc opt_openssl_capath; +-extern const struct optdesc opt_openssl_egd; + extern const struct optdesc opt_openssl_pseudo; + #if OPENSSL_VERSION_NUMBER >= 0x00908000L + extern const struct optdesc opt_openssl_compress; +--- a/xioopts.c Sat Jan 24 11:15:22 2015 ++++ b/xioopts.c Mon Apr 13 15:06:25 2015 +@@ -412,7 +412,6 @@ const struct optname optionnames[] = { + #ifdef ECHOPRT + IF_TERMIOS("echoprt", &opt_echoprt) + #endif +- IF_OPENSSL("egd", &opt_openssl_egd) + IF_ANY ("end-close", &opt_end_close) + IF_TERMIOS("eof", &opt_veof) + IF_TERMIOS("eol", &opt_veol) +@@ -1102,7 +1101,6 @@ const struct optname optionnames[] = { + IF_OPENSSL("openssl-compress", &opt_openssl_compress) + #endif + IF_OPENSSL("openssl-dhparam", &opt_openssl_dhparam) +- IF_OPENSSL("openssl-egd", &opt_openssl_egd) + #if WITH_FIPS + IF_OPENSSL("openssl-fips", &opt_openssl_fips) + #endif +--- a/xioopts.h Sat Jan 24 11:15:22 2015 ++++ b/xioopts.h Mon Apr 13 15:06:25 2015 +@@ -478,7 +478,6 @@ enum e_optcode { + OPT_OPENSSL_COMPRESS, + #endif + OPT_OPENSSL_DHPARAM, +- OPT_OPENSSL_EGD, + OPT_OPENSSL_FIPS, + OPT_OPENSSL_KEY, + OPT_OPENSSL_METHOD, diff --git a/nixpkgs/pkgs/tools/networking/spiped/default.nix b/nixpkgs/pkgs/tools/networking/spiped/default.nix new file mode 100644 index 000000000000..8b9d4c9e7b89 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/spiped/default.nix @@ -0,0 +1,38 @@ +{ lib, stdenv, fetchurl, openssl, coreutils }: + +stdenv.mkDerivation rec { + pname = "spiped"; + version = "1.6.1"; + + src = fetchurl { + url = "https://www.tarsnap.com/spiped/${pname}-${version}.tgz"; + sha256 = "8d7089979db79a531a0ecc507b113ac6f2cf5f19305571eff1d3413e0ab33713"; + }; + + buildInputs = [ openssl ]; + + postPatch = '' + substituteInPlace libcperciva/cpusupport/Build/cpusupport.sh \ + --replace "dirname" "${coreutils}/bin/dirname" \ + --replace "2>/dev/null" "2>stderr.log" + + substituteInPlace libcperciva/POSIX/posix-l.sh \ + --replace "rm" "${coreutils}/bin/rm" \ + --replace "2>/dev/null" "2>stderr.log" + ''; + + installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/share/man/man1 + make install BINDIR=$out/bin MAN1DIR=$out/share/man/man1 + runHook postInstall + ''; + + meta = { + description = "Utility for secure encrypted channels between sockets"; + homepage = "https://www.tarsnap.com/spiped.html"; + license = lib.licenses.bsd2; + platforms = lib.platforms.unix; + maintainers = [ lib.maintainers.thoughtpolice ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/spoofer/default.nix b/nixpkgs/pkgs/tools/networking/spoofer/default.nix new file mode 100644 index 000000000000..f5c8317d89b8 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/spoofer/default.nix @@ -0,0 +1,41 @@ +{ lib, stdenv, fetchurl, pkg-config, protobuf, openssl, libpcap, traceroute +, withGUI ? false, qt5 }: + +let inherit (lib) optional; +in + +stdenv.mkDerivation rec { + pname = "spoofer"; + version = "1.4.6"; + + src = fetchurl { + url = "https://www.caida.org/projects/spoofer/downloads/${pname}-${version}.tar.gz"; + sha256 = "sha256-+4FNC+rMxIoVXlW7HnBXUg0P4FhNvMTAqJ9c7lXQ6vE="; + }; + + nativeBuildInputs = [ pkg-config ]; + buildInputs = [ openssl protobuf libpcap traceroute ] + ++ optional withGUI qt5.qtbase ; + + dontWrapQtApps = true; + + meta = with lib; { + homepage = "https://www.caida.org/projects/spoofer"; + description = "Assess and report on deployment of source address validation"; + longDescription = '' + Spoofer is a new client-server system for Windows, MacOS, and + UNIX-like systems that periodically tests a network's ability to + both send and receive packets with forged source IP addresses + (spoofed packets). This can be used to produce reports and + visualizations to inform operators, response teams, and policy + analysts. The system measures different types of forged + addresses, including private and neighboring addresses. The + test results allows to analyze characteristics of networks + deploying source address validation (e.g., network location, + business type). + ''; + platforms = platforms.all; + license = licenses.gpl3Plus; + maintainers = with lib.maintainers; [ leenaars]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/srelay/arm.patch b/nixpkgs/pkgs/tools/networking/srelay/arm.patch new file mode 100644 index 000000000000..f56f2c0f2f0a --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/srelay/arm.patch @@ -0,0 +1,12 @@ +diff -ru srelay-0.4.8b4.orig/configure srelay-0.4.8b4/configure +--- srelay-0.4.8b4.orig/configure 2010-12-21 01:11:14.000000000 +1100 ++++ srelay-0.4.8b4/configure 2016-06-22 09:03:42.250000345 +1000 +@@ -1875,7 +1875,7 @@ + ;; + linux*) + case "$host_cpu" in +- i*86|mips*|powerpc*|sparc*|x86_64*) ++ i*86|mips*|powerpc*|sparc*|x86_64*|arm*) + OS=LINUX + cat >>confdefs.h <<\_ACEOF + #define LINUX 1 diff --git a/nixpkgs/pkgs/tools/networking/srelay/default.nix b/nixpkgs/pkgs/tools/networking/srelay/default.nix new file mode 100644 index 000000000000..9ff25d6a17cd --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/srelay/default.nix @@ -0,0 +1,21 @@ +{ lib, stdenv, fetchurl }: + +stdenv.mkDerivation { + name = "srelay-0.4.8"; + + src = fetchurl { + url = "mirror://sourceforge/project/socks-relay/socks-relay/srelay-0.4.8/srelay-0.4.8.tar.gz"; + sha256 = "1sn6005aqyfvrlkm5445cyyaj6h6wfyskfncfmds55x34hfyxpvl"; + }; + + patches = [ ./arm.patch ]; + + installPhase = "install -D srelay $out/bin/srelay"; + + meta = { + description = "A SOCKS proxy and relay"; + homepage = "http://socks-relay.sourceforge.net/"; + platforms = lib.platforms.unix; + license = lib.licenses.bsd3; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/ssh-agents/default.nix b/nixpkgs/pkgs/tools/networking/ssh-agents/default.nix new file mode 100644 index 000000000000..a4e930281a50 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/ssh-agents/default.nix @@ -0,0 +1,43 @@ +{ fetchFromGitHub +, lib +, stdenvNoCC +}: + +stdenvNoCC.mkDerivation rec { + pname = "ssh-agents"; + version = "1.0.1"; + + src = fetchFromGitHub { + owner = "kalbasit"; + repo = "ssh-agents"; + rev = "v${version}"; + sha256 = "1l09zy87033v7hd17lhkxikwikqz5nj9x6c2w80rqpad4lp9ihwz"; + }; + + installFlags = [ "PREFIX=$(out)" ]; + + meta = with lib; { + description = "ssh-agents capable of spawning and maintaining multiple ssh-agents across terminals"; + longDescription = '' + The SSH agent is usually spawned by running eval $(ssh-agent), however this + spawns a new SSH agent at every invocation. This project provides an + ssh-agent wrapper called ssh-agents that is capable of spawning an SSH + agent and caching the environment variables for later invocation. + + Features + - One SSH agent across all terminals + - Add all un-encrypted SSH keys to the agent upon spawning. Please note + that encrypted SSH keys can only be added via ssh-add after having + started the agent. + - Ability to have different keys in different agents for security purposes. + - Multiple SSH agents + - To use multi-SSH agents, start ssh agent with the --name flag. The + given name is expected to be a folder under ~/.ssh/name containing the + keys to include in the agent. + ''; + homepage = "https://github.com/kalbasit/ssh-agents"; + license = licenses.mit; + maintainers = with maintainers; [ kalbasit ]; + platforms = platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/ssh-askpass-fullscreen/default.nix b/nixpkgs/pkgs/tools/networking/ssh-askpass-fullscreen/default.nix new file mode 100644 index 000000000000..05e518371262 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/ssh-askpass-fullscreen/default.nix @@ -0,0 +1,31 @@ +{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config, gtk2, openssh }: + +stdenv.mkDerivation rec { + pname = "ssh-askpass-fullscreen"; + version = "1.2"; + + src = fetchFromGitHub { + owner = "atj"; + repo = pname; + rev = "v${version}"; + sha256 = "1zldhylln412974cnxyqcrrc6b4ry3m9s5ijq3dnwz2g7nz1bx9d"; + }; + + nativeBuildInputs = [ + autoreconfHook + pkg-config + ]; + + buildInputs = [ + gtk2 + openssh + ]; + + meta = with lib; { + description = "A small SSH askpass GUI using GTK+2"; + homepage = "https://github.com/atj/ssh-askpass-fullscreen"; + license = licenses.gpl2; + maintainers = with maintainers; [ caadar ]; + platforms = platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/ssh-ident/default.nix b/nixpkgs/pkgs/tools/networking/ssh-ident/default.nix new file mode 100644 index 000000000000..1822eda26278 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/ssh-ident/default.nix @@ -0,0 +1,31 @@ +{ stdenvNoCC, lib, fetchFromGitHub, python3, openssh}: + +stdenvNoCC.mkDerivation { + pname = "ssh-ident"; + version = "2016-04-21"; + src = fetchFromGitHub { + owner = "ccontavalli"; + repo = "ssh-ident"; + rev = "ebf8282728211dc4448d50f7e16e546ed03c22d2"; + sha256 = "1jf19lz1gwn7cyp57j8d4zs5bq13iw3kw31m8nvr8h6sib2pf815"; + }; + + postPatch = '' + substituteInPlace ssh-ident \ + --replace 'ssh-agent >' '${openssh}/bin/ssh-agent >' + ''; + buildInputs = [ python3 ]; + + installPhase = '' + mkdir -p $out/bin + install -m 755 ssh-ident $out/bin/ssh-ident + ''; + + meta = with lib; { + homepage = "https://github.com/ccontavalli/ssh-ident"; + description = "Start and use ssh-agent and load identities as necessary"; + license = licenses.bsd2; + maintainers = with maintainers; [ telotortium ]; + platforms = with platforms; unix; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/sshoogr/default.nix b/nixpkgs/pkgs/tools/networking/sshoogr/default.nix new file mode 100644 index 000000000000..f3c9c1a31fb8 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/sshoogr/default.nix @@ -0,0 +1,36 @@ +{ lib, stdenv, fetchzip, jdk, makeWrapper }: + +stdenv.mkDerivation rec { + pname = "sshoogr"; + version = "0.9.26"; + + src = fetchzip { + url = "https://repo1.maven.org/maven2/com/aestasit/infrastructure/${pname}/${pname}/${version}/${pname}-${version}.zip"; + sha256 = "134qlx90y82g1rfxhyn12z9r2imm1l3fz09hrrn3pgcdcq5jz2s1"; + }; + + nativeBuildInputs = [ makeWrapper ]; + + installPhase = '' + rm bin/sshoogr.bat + cp -r . $out + wrapProgram $out/bin/sshoogr \ + --prefix JAVA_HOME : ${jdk} + ''; + + meta = with lib; { + description = '' + A Groovy-based DSL for working with remote SSH servers + ''; + longDescription = '' + The sshoogr (pronounced [ʃʊgə]) is a Groovy-based DSL library for working + with remote servers through SSH. The DSL allows: connecting, executing + remote commands, copying files and directories, creating tunnels in a + simple and concise way. + ''; + homepage = "https://github.com/aestasit/sshoogr"; + license = licenses.asl20; + platforms = platforms.all; + maintainers = with maintainers; [ moaxcp ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/sshpass/default.nix b/nixpkgs/pkgs/tools/networking/sshpass/default.nix new file mode 100644 index 000000000000..60c9ab97a8b3 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/sshpass/default.nix @@ -0,0 +1,19 @@ +{lib, stdenv, fetchurl}: + +stdenv.mkDerivation rec { + pname = "sshpass"; + version = "1.06"; + + src = fetchurl { + url = "mirror://sourceforge/sshpass/sshpass-${version}.tar.gz"; + sha256 = "0q7fblaczb7kwbsz0gdy9267z0sllzgmf0c7z5c9mf88wv74ycn6"; + }; + + meta = with lib; { + homepage = "https://sourceforge.net/projects/sshpass/"; + description = "Non-interactive ssh password auth"; + license = licenses.gpl2; + maintainers = [ maintainers.madjar ]; + platforms = platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/sshping/default.nix b/nixpkgs/pkgs/tools/networking/sshping/default.nix new file mode 100644 index 000000000000..13abba539ac5 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/sshping/default.nix @@ -0,0 +1,31 @@ +{lib, stdenv, fetchFromGitHub, libssh}: + +stdenv.mkDerivation rec { + pname = "sshping"; + version = "0.1.4"; + + src = fetchFromGitHub { + owner = "spook"; + repo = "sshping"; + rev = "v${version}"; + sha256 = "0p1fvpgrsy44yvj44xp9k9nf6z1fh0sqcjvy75pcb9f5icgms815"; + }; + + buildInputs = [ libssh ]; + + buildPhase = '' + $CXX -Wall -I ext/ -o bin/sshping src/sshping.cxx -lssh + ''; + + installPhase = '' + install -Dm755 bin/sshping $out/bin/sshping + ''; + + meta = with lib; { + homepage = "https://github.com/spook/sshping"; + description = "Measure character-echo latency and bandwidth for an interactive ssh session"; + license = licenses.mit; + platforms = platforms.unix; + maintainers = with maintainers; [ jqueiroz ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/ssldump/default.nix b/nixpkgs/pkgs/tools/networking/ssldump/default.nix new file mode 100644 index 000000000000..fc92f43981b6 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/ssldump/default.nix @@ -0,0 +1,30 @@ +{ lib, stdenv, fetchFromGitHub, openssl, libpcap }: + +stdenv.mkDerivation { + pname = "ssldump"; + version = "1.1"; + + src = fetchFromGitHub { + owner = "adulau"; + repo = "ssldump"; + rev = "7491b9851505acff95b2c68097e9b9f630d418dc"; + sha256 = "1j3rln86khdnc98v50hclvqaq83a24c1rfzbcbajkbfpr4yxpnpd"; + }; + + buildInputs = [ libpcap openssl ]; + prePatch = '' + sed -i -e 's|#include.*net/bpf.h|#include <pcap/bpf.h>|' \ + base/pcap-snoop.c + ''; + configureFlags = [ "--with-pcap-lib=${libpcap}/lib" + "--with-pcap-inc=${libpcap}/include" + "--with-openssl-lib=${openssl}/lib" + "--with-openssl-inc=${openssl}/include" ]; + meta = { + description = "An SSLv3/TLS network protocol analyzer"; + homepage = "http://ssldump.sourceforge.net"; + license = "BSD-style"; + maintainers = with lib.maintainers; [ aycanirican ]; + platforms = lib.platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/sslsplit/default.nix b/nixpkgs/pkgs/tools/networking/sslsplit/default.nix new file mode 100644 index 000000000000..c3a343d7fa1e --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/sslsplit/default.nix @@ -0,0 +1,31 @@ +{ lib, stdenv, fetchFromGitHub, openssl, libevent, libpcap, libnet, zlib }: + +stdenv.mkDerivation rec { + pname = "sslsplit"; + version = "0.5.5"; + + src = fetchFromGitHub { + owner = "droe"; + repo = pname; + rev = version; + sha256 = "1p43z9ln5rbc76v0j1k3r4nhvfw71hq8jzsallb54z9hvwfvqp3l"; + }; + + buildInputs = [ openssl libevent libpcap libnet zlib ]; + + makeFlags = [ + "PREFIX=$(out)" + "OPENSSL_BASE=${openssl.dev}" + "LIBEVENT_BASE=${libevent.dev}" + "LIBPCAP_BASE=${libpcap}" + "LIBNET_BASE=${libnet}" + ]; + + meta = with lib; { + description = "Transparent SSL/TLS interception"; + homepage = "https://www.roe.ch/SSLsplit"; + platforms = platforms.all; + maintainers = with maintainers; [ contrun ]; + license = with licenses; [ bsd2 mit unlicense free ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/ssmtp/default.nix b/nixpkgs/pkgs/tools/networking/ssmtp/default.nix new file mode 100644 index 000000000000..6957d43e7913 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/ssmtp/default.nix @@ -0,0 +1,46 @@ +{lib, stdenv, fetchurl, tlsSupport ? true, openssl ? null}: + +assert tlsSupport -> openssl != null; + +stdenv.mkDerivation { + name = "ssmtp-2.64"; + + src = fetchurl { + url = "mirror://debian/pool/main/s/ssmtp/ssmtp_2.64.orig.tar.bz2"; + sha256 = "0dps8s87ag4g3jr6dk88hs9zl46h3790marc5c2qw7l71k4pvhr2"; + }; + + # A request has been made to merge this patch into ssmtp. + # See: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=858781 + patches = [ ./ssmtp_support_AuthPassFile_parameter.patch ]; + + configureFlags = [ + "--sysconfdir=/etc" + (lib.enableFeature tlsSupport "ssl") + ]; + + postConfigure = + '' + # Don't run the script that interactively generates a config file. + # Also don't install the broken, cyclic symlink /lib/sendmail. + sed -e '/INSTALLED_CONFIGURATION_FILE/d' \ + -e 's|/lib/sendmail|$(TMPDIR)/sendmail|' \ + -i Makefile + substituteInPlace Makefile \ + --replace '$(INSTALL) -s' '$(INSTALL) -s --strip-program $(STRIP)' + ''; + + installFlags = [ "etcdir=$(out)/etc" ]; + + installTargets = [ "install" "install-sendmail" ]; + + buildInputs = lib.optional tlsSupport openssl; + + NIX_LDFLAGS = lib.optionalString tlsSupport "-lcrypto"; + + meta = with lib; { + platforms = platforms.linux; + license = licenses.gpl2; + maintainers = with maintainers; [ basvandijk ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/ssmtp/ssmtp_support_AuthPassFile_parameter.patch b/nixpkgs/pkgs/tools/networking/ssmtp/ssmtp_support_AuthPassFile_parameter.patch new file mode 100644 index 000000000000..371c0f6de2b3 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/ssmtp/ssmtp_support_AuthPassFile_parameter.patch @@ -0,0 +1,69 @@ +diff -Naurb a/ssmtp.c b/ssmtp.c +--- a/ssmtp.c 2009-11-23 10:55:11.000000000 +0100 ++++ b/ssmtp.c 2017-03-25 03:00:26.508283016 +0100 +@@ -57,6 +57,7 @@ + char arpadate[ARPADATE_LENGTH]; + char *auth_user = (char)NULL; + char *auth_pass = (char)NULL; ++char *auth_passfile = (char)NULL; + char *auth_method = (char)NULL; /* Mechanism for SMTP authentication */ + char *mail_domain = (char)NULL; + char *from = (char)NULL; /* Use this as the From: address */ +@@ -1053,6 +1054,15 @@ + log_event(LOG_INFO, "Set AuthPass=\"%s\"\n", auth_pass); + } + } ++ else if(strcasecmp(p, "AuthPassFile") == 0 && !auth_passfile) { ++ if((auth_passfile = strdup(q)) == (char *)NULL) { ++ die("parse_config() -- strdup() failed"); ++ } ++ ++ if(log_level > 0) { ++ log_event(LOG_INFO, "Set AuthPassFile=\"%s\"\n", auth_passfile); ++ } ++ } + else if(strcasecmp(p, "AuthMethod") == 0 && !auth_method) { + if((auth_method = strdup(q)) == (char *)NULL) { + die("parse_config() -- strdup() failed"); +@@ -1415,6 +1425,8 @@ + struct passwd *pw; + int i, sock; + uid_t uid; ++ FILE *fp; ++ char pass_buf[BUF_SZ+1]; + bool_t minus_v_save, leadingdot, linestart = True; + int timeout = 0; + int bufsize = sizeof(b)-1; +@@ -1433,6 +1445,17 @@ + log_event(LOG_INFO, "%s not found", config_file); + } + ++ if(auth_passfile != (char *)NULL) { ++ if((fp = fopen(auth_passfile, "r")) == (FILE *)NULL) { ++ die("Could not open the AuthPassFile %s", auth_passfile); ++ } ++ if (fgets(pass_buf, BUF_SZ, fp) == NULL) { ++ die("Error while reading a line from the AuthPassFile %s, or it is empty", auth_passfile); ++ } ++ fclose(fp); ++ auth_pass = strdup(pass_buf); ++ } ++ + if((p = strtok(pw->pw_gecos, ";,"))) { + if((gecos = strdup(p)) == (char *)NULL) { + die("ssmtp() -- strdup() failed"); +diff -Naurb a/ssmtp.conf.5 b/ssmtp.conf.5 +--- a/ssmtp.conf.5 2008-02-29 03:50:15.000000000 +0100 ++++ b/ssmtp.conf.5 2017-03-25 01:45:52.890165426 +0100 +@@ -61,6 +61,11 @@ + .Pp + .It Cm AuthPass + The password to use for SMTP AUTH. ++It is recommended to use AuthPassFile which also takes precedence over AuthPass. ++.Pp ++.It Cm AuthPassFile ++A file that should contain the password to use for SMTP AUTH. ++This takes precedence over AuthPass. + .Pp + .It Cm AuthMethod + The authorization method to use. diff --git a/nixpkgs/pkgs/tools/networking/sstp/default.nix b/nixpkgs/pkgs/tools/networking/sstp/default.nix new file mode 100644 index 000000000000..97e35949b15a --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/sstp/default.nix @@ -0,0 +1,34 @@ +{ lib, stdenv, fetchurl, pkg-config, ppp, libevent, openssl }: + +stdenv.mkDerivation rec { + pname = "sstp-client"; + version = "1.0.13"; + + src = fetchurl { + url = "mirror://sourceforge/sstp-client/sstp-client/sstp-client-${version}.tar.gz"; + sha256 = "06rjyncmgdy212xf9l9z6mfh4gdmgk7l4y841gb8lpbrl3y5h4ln"; + }; + + patchPhase = + '' + sed 's,/usr/sbin/pppd,${ppp}/sbin/pppd,' -i src/sstp-pppd.c + sed "s,sstp-pppd-plugin.so,$out/lib/pppd/sstp-pppd-plugin.so," -i src/sstp-pppd.c + ''; + + configureFlags = [ + "--with-openssl=${openssl.dev}" + "--with-runtime-dir=/run/sstpc" + "--with-pppd-plugin-dir=$(out)/lib/pppd" + ]; + + nativeBuildInputs = [ pkg-config ]; + buildInputs = [ libevent openssl ppp ]; + + meta = { + description = "SSTP client for Linux"; + homepage = "http://sstp-client.sourceforge.net/"; + platforms = lib.platforms.linux; + maintainers = [ lib.maintainers.ktosiek ]; + license = lib.licenses.gpl2; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/stevenblack-blocklist/default.nix b/nixpkgs/pkgs/tools/networking/stevenblack-blocklist/default.nix new file mode 100644 index 000000000000..29faa448a3d0 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/stevenblack-blocklist/default.nix @@ -0,0 +1,20 @@ +{ lib, fetchFromGitHub }: + +let + version = "3.7.8"; +in +fetchFromGitHub { + name = "stevenblack-blocklist-${version}"; + + owner = "StevenBlack"; + repo = "hosts"; + rev = version; + sha256 = "sha256-z+AkjWmqP4ASnpIAG/OyZC4W5xU5YOeFTsmdkLvPixQ="; + + meta = with lib; { + description = "Unified hosts file with base extensions"; + homepage = "https://github.com/StevenBlack/hosts"; + license = licenses.mit; + maintainers = with maintainers; [ fortuneteller2k ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/strongswan/default.nix b/nixpkgs/pkgs/tools/networking/strongswan/default.nix new file mode 100644 index 000000000000..67df00b8e694 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/strongswan/default.nix @@ -0,0 +1,114 @@ +{ lib, stdenv, fetchurl, fetchpatch +, pkg-config, autoreconfHook +, gmp, python3, iptables, ldns, unbound, openssl, pcsclite, glib +, openresolv +, systemd, pam +, curl +, enableTNC ? false, trousers, sqlite, libxml2 +, enableNetworkManager ? false, networkmanager +, darwin +}: + +# Note on curl support: If curl is built with gnutls as its backend, the +# strongswan curl plugin may break. +# See https://wiki.strongswan.org/projects/strongswan/wiki/Curl for more info. + +with lib; + +stdenv.mkDerivation rec { + pname = "strongswan"; + version = "5.8.1"; # Make sure to also update <nixpkgs/nixos/modules/services/networking/strongswan-swanctl/swanctl-params.nix> when upgrading! + + src = fetchurl { + url = "https://download.strongswan.org/${pname}-${version}.tar.bz2"; + sha256 = "034rd6kr1bmnvj8rg2kcxdjb0cgj3dn9310mmm94j1awxan71byr"; + }; + + dontPatchELF = true; + + nativeBuildInputs = [ pkg-config autoreconfHook ]; + buildInputs = + [ curl gmp python3 ldns unbound openssl pcsclite ] + ++ optionals enableTNC [ trousers sqlite libxml2 ] + ++ optionals stdenv.isLinux [ systemd.dev pam iptables ] + ++ optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ SystemConfiguration ]) + ++ optionals enableNetworkManager [ networkmanager glib ]; + + patches = [ + ./ext_auth-path.patch + ./firewall_defaults.patch + ./updown-path.patch + + # Don't use etc/dbus-1/system.d + (fetchpatch { + url = "https://patch-diff.githubusercontent.com/raw/strongswan/strongswan/pull/150.patch"; + sha256 = "1irfxb99blb8v3hs0kmlhzkkwbmds1p0gq319z8lmacz36cgyj2c"; + }) + ]; + + postPatch = optionalString stdenv.isLinux '' + # glibc-2.26 reorganized internal includes + sed '1i#include <stdint.h>' -i src/libstrongswan/utils/utils/memory.h + + substituteInPlace src/libcharon/plugins/resolve/resolve_handler.c --replace "/sbin/resolvconf" "${openresolv}/sbin/resolvconf" + ''; + + configureFlags = + [ "--enable-swanctl" + "--enable-cmd" + "--enable-openssl" + "--enable-eap-sim" "--enable-eap-sim-file" "--enable-eap-simaka-pseudonym" + "--enable-eap-simaka-reauth" "--enable-eap-identity" "--enable-eap-md5" + "--enable-eap-gtc" "--enable-eap-aka" "--enable-eap-aka-3gpp2" + "--enable-eap-mschapv2" "--enable-eap-radius" "--enable-xauth-eap" "--enable-ext-auth" + "--enable-acert" + "--enable-pkcs11" "--enable-eap-sim-pcsc" "--enable-dnscert" "--enable-unbound" + "--enable-chapoly" + "--enable-curl" ] + ++ optionals stdenv.isLinux [ + "--enable-farp" "--enable-dhcp" + "--enable-systemd" "--with-systemdsystemunitdir=${placeholder "out"}/etc/systemd/system" + "--enable-xauth-pam" + "--enable-forecast" + "--enable-connmark" + "--enable-af-alg" ] + ++ optionals stdenv.isx86_64 [ "--enable-aesni" "--enable-rdrand" ] + ++ optional (stdenv.hostPlatform.system == "i686-linux") "--enable-padlock" + ++ optionals enableTNC [ + "--disable-gmp" "--disable-aes" "--disable-md5" "--disable-sha1" "--disable-sha2" "--disable-fips-prf" + "--enable-eap-tnc" "--enable-eap-ttls" "--enable-eap-dynamic" "--enable-tnccs-20" + "--enable-tnc-imc" "--enable-imc-os" "--enable-imc-attestation" + "--enable-tnc-imv" "--enable-imv-attestation" + "--enable-tnc-ifmap" "--enable-tnc-imc" "--enable-tnc-imv" + "--with-tss=trousers" + "--enable-aikgen" + "--enable-sqlite" ] + ++ optionals enableNetworkManager [ + "--enable-nm" + "--with-nm-ca-dir=/etc/ssl/certs" ] + # Taken from: https://wiki.strongswan.org/projects/strongswan/wiki/MacOSX + ++ optionals stdenv.isDarwin [ + "--disable-systemd" + "--disable-xauth-pam" + "--disable-kernel-netlink" + "--enable-kernel-pfkey" + "--enable-kernel-pfroute" + "--enable-kernel-libipsec" + "--enable-osx-attr" + "--disable-scripts" + ]; + + postInstall = '' + # this is needed for l2tp + echo "include /etc/ipsec.secrets" >> $out/etc/ipsec.secrets + ''; + + NIX_LDFLAGS = optionalString stdenv.cc.isGNU "-lgcc_s" ; + + meta = { + description = "OpenSource IPsec-based VPN Solution"; + homepage = "https://www.strongswan.org"; + license = licenses.gpl2Plus; + platforms = platforms.all; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/strongswan/ext_auth-path.patch b/nixpkgs/pkgs/tools/networking/strongswan/ext_auth-path.patch new file mode 100644 index 000000000000..397537ad8d84 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/strongswan/ext_auth-path.patch @@ -0,0 +1,13 @@ +Index: strongswan-5.2.1/src/libcharon/plugins/ext_auth/ext_auth_listener.c +=================================================================== +--- strongswan-5.2.1.orig/src/libcharon/plugins/ext_auth/ext_auth_listener.c ++++ strongswan-5.2.1/src/libcharon/plugins/ext_auth/ext_auth_listener.c +@@ -101,6 +101,8 @@ METHOD(listener_t, authorize, bool, + + *success = FALSE; + ++ push_env(envp, countof(envp), "PATH=%s", getenv("PATH")); ++ + push_env(envp, countof(envp), "IKE_UNIQUE_ID=%u", + ike_sa->get_unique_id(ike_sa)); + push_env(envp, countof(envp), "IKE_NAME=%s", diff --git a/nixpkgs/pkgs/tools/networking/strongswan/firewall_defaults.patch b/nixpkgs/pkgs/tools/networking/strongswan/firewall_defaults.patch new file mode 100644 index 000000000000..12c446c8c9aa --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/strongswan/firewall_defaults.patch @@ -0,0 +1,32 @@ +Index: strongswan-5.2.1/src/starter/confread.c +=================================================================== +--- strongswan-5.2.1.orig/src/starter/confread.c ++++ strongswan-5.2.1/src/starter/confread.c +@@ -43,7 +43,7 @@ + static const char ike_defaults[] = "aes128-sha1-modp2048,3des-sha1-modp1536"; + static const char esp_defaults[] = "aes128-sha1,3des-sha1"; + +-static const char firewall_defaults[] = IPSEC_SCRIPT " _updown iptables"; ++static const char firewall_defaults[] = IPSEC_SBINDIR "/" IPSEC_SCRIPT " _updown iptables"; + + /** + * Provided by GPERF +Index: strongswan-5.2.1/src/starter/Makefile.am +=================================================================== +--- strongswan-5.2.1.orig/src/starter/Makefile.am ++++ strongswan-5.2.1/src/starter/Makefile.am +@@ -18,10 +18,12 @@ AM_CPPFLAGS = \ + -I$(top_srcdir)/src/libhydra \ + -I$(top_srcdir)/src/starter \ + -I$(top_srcdir)/src/stroke \ +- -DIPSEC_DIR=\"${ipsecdir}\" \ ++ -DIPSEC_BINDIR=\"${bindir}\" \ + -DIPSEC_CONFDIR=\"${sysconfdir}\" \ +- -DIPSEC_PIDDIR=\"${piddir}\" \ ++ -DIPSEC_DIR=\"${ipsecdir}\" \ + -DIPSEC_EAPDIR=\"${eapdir}\" \ ++ -DIPSEC_PIDDIR=\"${piddir}\" \ ++ -DIPSEC_SBINDIR=\"${sbindir}\" \ + -DIPSEC_SCRIPT=\"${ipsec_script}\" \ + -DDEV_RANDOM=\"${random_device}\" \ + -DDEV_URANDOM=\"${urandom_device}\" \ diff --git a/nixpkgs/pkgs/tools/networking/strongswan/updown-path.patch b/nixpkgs/pkgs/tools/networking/strongswan/updown-path.patch new file mode 100644 index 000000000000..f01da7d7bce6 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/strongswan/updown-path.patch @@ -0,0 +1,26 @@ +Index: strongswan-5.2.1/src/_updown/_updown.in +=================================================================== +--- strongswan-5.2.1.orig/src/_updown/_updown.in ++++ strongswan-5.2.1/src/_updown/_updown.in +@@ -125,7 +125,7 @@ + # + + # define a minimum PATH environment in case it is not set +-PATH="/sbin:/bin:/usr/sbin:/usr/bin:@sbindir@" ++PATH="${PATH:-/sbin:/bin:/usr/sbin:/usr/bin}" + export PATH + + # uncomment to log VPN connections +Index: strongswan-5.2.1/src/libcharon/plugins/updown/updown_listener.c +=================================================================== +--- strongswan-5.2.1.orig/src/libcharon/plugins/updown/updown_listener.c ++++ strongswan-5.2.1/src/libcharon/plugins/updown/updown_listener.c +@@ -240,6 +240,8 @@ static void invoke_once(private_updown_l + process_t *process; + char *envp[128] = {}; + ++ push_env(envp, countof(envp), "PATH=%s", getenv("PATH")); ++ + me = ike_sa->get_my_host(ike_sa); + other = ike_sa->get_other_host(ike_sa); + diff --git a/nixpkgs/pkgs/tools/networking/stubby/default.nix b/nixpkgs/pkgs/tools/networking/stubby/default.nix new file mode 100644 index 000000000000..abe11b7bcb91 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/stubby/default.nix @@ -0,0 +1,33 @@ +{ lib, stdenv, fetchFromGitHub, getdns, doxygen, libyaml, darwin, cmake, systemd }: + +stdenv.mkDerivation rec { + pname = "stubby"; + version = "0.3.0"; + + src = fetchFromGitHub { + owner = "getdnsapi"; + repo = pname; + rev = "v${version}"; + sha256 = "04izd1v4fv9l7r75aafkrp6svczbx4cvv1vnfyx5n9105pin11mx"; + }; + + nativeBuildInputs = [ cmake libyaml ]; + + buildInputs = [ doxygen getdns systemd ] + ++ lib.optionals stdenv.isDarwin [ darwin.Security ]; + + meta = with lib; { + description = "A local DNS Privacy stub resolver (using DNS-over-TLS)"; + longDescription = '' + Stubby is an application that acts as a local DNS Privacy stub + resolver (using RFC 7858, aka DNS-over-TLS). Stubby encrypts DNS + queries sent from a client machine (desktop or laptop) to a DNS + Privacy resolver increasing end user privacy. Stubby is developed by + the getdns team. + ''; + homepage = "https://dnsprivacy.org/wiki/x/JYAT"; + downloadPage = "https://github.com/getdnsapi/stubby"; + maintainers = with maintainers; [ leenaars ehmry ]; + license = licenses.bsd3; platforms = platforms.all; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/stun/default.nix b/nixpkgs/pkgs/tools/networking/stun/default.nix new file mode 100644 index 000000000000..c74c73ec6a0e --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/stun/default.nix @@ -0,0 +1,41 @@ +{ lib, stdenv, fetchurl }: + +stdenv.mkDerivation rec { + pname = "stun"; + version = "0.97"; + + src = fetchurl { + url = "mirror://sourceforge/${pname}/stund-${version}.tgz"; + sha256 = "1mxirnnqfqdwb9x8hfjjsscp6lx3468ph6ddx32l94ir46fbzqc3"; + }; + + srcManpages = fetchurl { + url = "mirror://ubuntu/pool/universe/s/stun/stun_0.97~dfsg-2.debian.tar.xz"; + name = "stun-debian.tar.xz"; + sha256 = "1pr6zrdhia0aafsvywl1hrhlgl00vahp63bw1z2mzvdxri7q88f0"; + }; + + outputs = [ "out" "server" ]; + + preBuild = '' + tar Jxvf ${srcManpages} debian/manpages + gzip -9n debian/manpages/stun.1 + gzip -9n debian/manpages/stund.8 + ''; + + installPhase = '' + mkdir -p $out/bin $server/bin $out/man/man1 $server/man/man8 + cp -v client $out/bin/stun + cp -v server $server/bin/stund + cp -v debian/manpages/stun.1.gz $out/man/man1 + cp -v debian/manpages/stund.8.gz $server/man/man8 + ''; + + meta = with lib; { + description = "Stun server and test client"; + homepage = "https://sourceforge.net/projects/stun/"; + license = licenses.vsl10; + maintainers = with maintainers; [ marcweber obadz ]; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/stunnel/default.nix b/nixpkgs/pkgs/tools/networking/stunnel/default.nix new file mode 100644 index 000000000000..f8b6c845a52e --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/stunnel/default.nix @@ -0,0 +1,38 @@ +{ lib, stdenv, fetchurl, openssl }: + +stdenv.mkDerivation rec { + pname = "stunnel"; + version = "5.58"; + + src = fetchurl { + url = "https://www.stunnel.org/downloads/${pname}-${version}.tar.gz"; + sha256 = "d4c14cc096577edca3f6a2a59c2f51869e35350b3988018ddf808c88e5973b79"; + # please use the contents of "https://www.stunnel.org/downloads/${name}.tar.gz.sha256", + # not the output of `nix-prefetch-url` + }; + + buildInputs = [ openssl ]; + configureFlags = [ + "--with-ssl=${openssl.dev}" + "--sysconfdir=/etc" + "--localstatedir=/var" + ]; + + postInstall = '' + # remove legacy compatibility-wrapper that would require perl + rm $out/bin/stunnel3 + ''; + + installFlags = [ + "sysconfdir=\${out}/etc" + "localstatedir=\${TMPDIR}" + ]; + + meta = { + description = "Universal tls/ssl wrapper"; + homepage = "https://www.stunnel.org/"; + license = lib.licenses.gpl2Plus; + platforms = lib.platforms.unix; + maintainers = [ lib.maintainers.thoughtpolice ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/subfinder/default.nix b/nixpkgs/pkgs/tools/networking/subfinder/default.nix new file mode 100644 index 000000000000..ae87d02fe236 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/subfinder/default.nix @@ -0,0 +1,36 @@ +{ lib +, buildGoModule +, fetchFromGitHub +}: + +buildGoModule rec { + pname = "subfinder"; + version = "2.4.8"; + + src = fetchFromGitHub { + owner = "projectdiscovery"; + repo = pname; + rev = "v${version}"; + sha256 = "1g1j3il1a595g7z8blhvyd5l03h6kccl7mzrx51c33jz74cms5kn"; + }; + + vendorSha256 = "1jmik0zmfy1n3g4yjkskiqzd28dpywf0hw6adgz2jshlhka58iw0"; + + modRoot = "./v2"; + + subPackages = [ + "cmd/subfinder/" + ]; + + meta = with lib; { + description = "Subdomain discovery tool"; + longDescription = '' + SubFinder is a subdomain discovery tool that discovers valid + subdomains for websites. Designed as a passive framework to be + useful for bug bounties and safe for penetration testing. + ''; + homepage = "https://github.com/projectdiscovery/subfinder"; + license = licenses.mit; + maintainers = with maintainers; [ fpletz Br1ght0ne ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/surfraw/default.nix b/nixpkgs/pkgs/tools/networking/surfraw/default.nix new file mode 100644 index 000000000000..70bb5453518a --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/surfraw/default.nix @@ -0,0 +1,24 @@ +{lib, stdenv, fetchurl, perl}: + +stdenv.mkDerivation { + name = "surfraw-2.3.0"; + + src = fetchurl { + url = "https://gitlab.com/surfraw/Surfraw/uploads/2de827b2786ef2fe43b6f07913ca7b7f/surfraw-2.3.0.tar.gz"; + sha256 = "099nbif0x5cbcf18snc58nx1a3q7z0v9br9p2jiq9pcc7ic2015d"; + }; + + configureFlags = [ + "--disable-opensearch" + ]; + + nativeBuildInputs = [ perl ]; + + meta = { + description = "Provides a fast unix command line interface to a variety of popular WWW search engines and other artifacts of power"; + homepage = "https://gitlab.com/surfraw/Surfraw"; + maintainers = []; + platforms = lib.platforms.all; + license = lib.licenses.publicDomain; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/swagger-codegen/default.nix b/nixpkgs/pkgs/tools/networking/swagger-codegen/default.nix new file mode 100644 index 000000000000..f2847703bdba --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/swagger-codegen/default.nix @@ -0,0 +1,33 @@ +{ lib, stdenv, fetchurl, jre, makeWrapper }: + +stdenv.mkDerivation rec { + version = "2.4.19"; + pname = "swagger-codegen"; + + jarfilename = "${pname}-cli-${version}.jar"; + + nativeBuildInputs = [ + makeWrapper + ]; + + src = fetchurl { + url = "https://repo1.maven.org/maven2/io/swagger/${pname}-cli/${version}/${jarfilename}"; + sha256 = "04wl5k8k1ziqz7k5w0g7i6zdfn41pbh3k0m8vq434k1886inf8yn"; + }; + + dontUnpack = true; + + installPhase = '' + install -D $src $out/share/java/${jarfilename} + + makeWrapper ${jre}/bin/java $out/bin/${pname} \ + --add-flags "-jar $out/share/java/${jarfilename}" + ''; + + meta = with lib; { + description = "Allows generation of API client libraries (SDK generation), server stubs and documentation automatically given an OpenAPI Spec"; + homepage = "https://github.com/swagger-api/swagger-codegen"; + license = licenses.asl20; + maintainers = [ maintainers.jraygauthier ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/swagger-codegen3/default.nix b/nixpkgs/pkgs/tools/networking/swagger-codegen3/default.nix new file mode 100644 index 000000000000..8fc908a1f2c2 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/swagger-codegen3/default.nix @@ -0,0 +1,33 @@ +{ lib, stdenv, fetchurl, jre, makeWrapper }: + +stdenv.mkDerivation rec { + version = "3.0.25"; + pname = "swagger-codegen"; + + jarfilename = "${pname}-cli-${version}.jar"; + + nativeBuildInputs = [ + makeWrapper + ]; + + src = fetchurl { + url = "https://repo1.maven.org/maven2/io/swagger/codegen/v3/${pname}-cli/${version}/${jarfilename}"; + sha256 = "1rdz45kmmg60fs7ddnla1xq30nah6s6rd18fqbjbjxng8r92brnd"; + }; + + dontUnpack = true; + + installPhase = '' + install -D $src $out/share/java/${jarfilename} + + makeWrapper ${jre}/bin/java $out/bin/${pname}3 \ + --add-flags "-jar $out/share/java/${jarfilename}" + ''; + + meta = with lib; { + description = "Allows generation of API client libraries (SDK generation), server stubs and documentation automatically given an OpenAPI Spec"; + homepage = "https://github.com/swagger-api/swagger-codegen/tree/3.0.0"; + license = licenses.asl20; + maintainers = [ maintainers._1000101 ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/swaks/default.nix b/nixpkgs/pkgs/tools/networking/swaks/default.nix new file mode 100644 index 000000000000..49ef0afc0603 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/swaks/default.nix @@ -0,0 +1,33 @@ +{ lib, stdenv, fetchurl, perl, perlPackages, makeWrapper }: + +stdenv.mkDerivation rec { + pname = "swaks"; + version = "20201014.0"; + + src = fetchurl { + url = "https://www.jetmore.org/john/code/swaks/files/${pname}-${version}.tar.gz"; + sha256 = "0c2sx4nrh4whsqzj6m5ay8d7yqan3aqgg436p8jb25bs91ykn2pv"; + }; + + nativeBuildInputs = [ makeWrapper ]; + buildInputs = [ perl ]; + + installPhase = '' + mkdir -p $out/bin + mv swaks $out/bin/ + + wrapProgram $out/bin/swaks --set PERL5LIB \ + "${with perlPackages; makePerlPath [ + NetSSLeay AuthenSASL NetDNS IOSocketInet6 + ]}" + ''; + + meta = with lib; { + homepage = "http://www.jetmore.org/john/code/swaks/"; + description = "A featureful, flexible, scriptable, transaction-oriented SMTP test tool"; + license = licenses.gpl2Plus; + maintainers = with maintainers; []; + platforms = platforms.all; + }; + +} diff --git a/nixpkgs/pkgs/tools/networking/swec/default.nix b/nixpkgs/pkgs/tools/networking/swec/default.nix new file mode 100644 index 000000000000..c98a3417d1c4 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/swec/default.nix @@ -0,0 +1,73 @@ +{ fetchurl, lib, stdenv, makeWrapper, perlPackages }: + +stdenv.mkDerivation rec { + name = "swec-0.4"; + + src = fetchurl { + url = "http://files.zerodogg.org/swec/${name}.tar.bz2"; + sha256 = "1m3971z4z1wr0paggprfz0n8ng8vsnkc9m6s3bdplgyz7qjk6jwx"; + }; + + nativeBuildInputs = [ makeWrapper ]; + buildInputs = [ perlPackages.perl perlPackages.LWP perlPackages.URI perlPackages.HTMLParser ]; + checkInputs = [ perlPackages.HTTPServerSimple perlPackages.Parent ]; + + configurePhase = '' + for i in swec tests/{runTests,testServer} + do + sed -i "$i" -e's|/usr/bin/perl|${perlPackages.perl}/bin/perl|g' + done + ''; + + dontBuild = true; + + installPhase = '' + make install prefix="$out" + + mkdir -p "$out/share/${name}" + cp -v default.sdf "$out/share/${name}" + sed -i "$out/bin/swec" -e"s|realpath(\$0)|'$out/share/${name}/swec'|g" + + wrapProgram "$out/bin/swec" \ + --prefix PERL5LIB : ${with perlPackages; makePerlPath [ LWP URI HTMLParser ]} + ''; + + doCheck = true; + checkPhase = "make test"; + + meta = { + homepage = "https://random.zerodogg.org/swec/"; + + description = "Simple Web Error Checker (SWEC)"; + + longDescription = + '' SWEC (Simple Web Error Checker) is a program that automates testing + of dynamic websites. It parses each HTML file it finds for links, + and if those links are within the site specified (ie. local, not + external), it will check that page as well. In this respect it + works a lot like a crawler, in that it'll click on any link it finds + (more notes about this later). + + In addition to parsing and locating links, it will also parse the + pages looking for known errors and report those (such as Mason or + PHP errors), and will report if a page can not be read (by either + returning a 404, 500 or similar). + + Since you may often want SWEC to be logged in on your site, you have + to be careful. When logged in, SWEC will still click on all links + it finds, including things like 'join group' or 'delete account' + (though it has some magic trying to avoid the latter). Therefore it + is highly recommended that when you run SWEC as a logged-in user on + a site, use a test server, not the live one. + + Running SWEC on a live site without being logged in as a user is + perfectly fine, it won't do anything a normal crawler wouldn't do + (well, not exactly true, SWEC will ignore robots.txt). + ''; + + license = lib.licenses.gpl3Plus; + + maintainers = [ ]; + platforms = lib.platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/tayga/default.nix b/nixpkgs/pkgs/tools/networking/tayga/default.nix new file mode 100644 index 000000000000..8d0de6a6c188 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/tayga/default.nix @@ -0,0 +1,26 @@ +{ lib, stdenv, fetchurl }: + +stdenv.mkDerivation rec { + version = "0.9.2"; + pname = "tayga"; + + src = fetchurl { + url= "http://www.litech.org/${pname}/${pname}-${version}.tar.bz2"; + sha256 = "1700y121lhvpna49bjpssb7jq1abj9qw5wxgjn8gzp6jm4kpj7rb"; + }; + + meta = with lib; { + description = "Userland stateless NAT64 daemon"; + longDescription = '' + TAYGA is an out-of-kernel stateless NAT64 implementation + for Linux that uses the TUN driver to exchange IPv4 and + IPv6 packets with the kernel. + It is intended to provide production-quality NAT64 service + for networks where dedicated NAT64 hardware would be overkill. + ''; + homepage = "http://www.litech.org/tayga"; + license = licenses.gpl2; + maintainers = with maintainers; [ _0x4A6F ]; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/tcp-cutter/default.nix b/nixpkgs/pkgs/tools/networking/tcp-cutter/default.nix new file mode 100644 index 000000000000..ade825dbe103 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/tcp-cutter/default.nix @@ -0,0 +1,23 @@ +{ lib, stdenv, fetchurl }: + +stdenv.mkDerivation rec { + pname = "tcp-cutter"; + version = "1.04"; + + src = fetchurl { + url = "http://www.digitage.co.uk/digitage/files/cutter/${pname}-${version}.tgz"; + sha256 = "100iy31a3njif6vh9gfsqrm14hac05rrflla275gd4rkxdlnqcqv"; + }; + + installPhase = '' + install -D -m 0755 cutter $out/bin/tcp-cutter + ''; + + meta = with lib; { + description = "TCP/IP Connection cutting on Linux Firewalls and Routers"; + homepage = "http://www.digitage.co.uk/digitage/software/linux-security/cutter"; + license = licenses.gpl2; + platforms = platforms.linux; + maintainers = [ maintainers.offline ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/tcpdump/default.nix b/nixpkgs/pkgs/tools/networking/tcpdump/default.nix new file mode 100644 index 000000000000..f1fe05276396 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/tcpdump/default.nix @@ -0,0 +1,31 @@ +{ lib, stdenv, fetchurl, libpcap, perl }: + +stdenv.mkDerivation rec { + pname = "tcpdump"; + version = "4.99.0"; + + src = fetchurl { + url = "http://www.tcpdump.org/release/${pname}-${version}.tar.gz"; + sha256 = "0hmqh2fx8rgs9v1mk3vpywj61xvkifz260q685xllxr8jmxg3wlc"; + }; + + postPatch = '' + patchShebangs tests + ''; + + checkInputs = [ perl ]; + + buildInputs = [ libpcap ]; + + configureFlags = lib.optional + (stdenv.hostPlatform != stdenv.buildPlatform) + "ac_cv_linux_vers=2"; + + meta = with lib; { + description = "Network sniffer"; + homepage = "https://www.tcpdump.org/"; + license = licenses.bsd3; + maintainers = with maintainers; [ globin ]; + platforms = platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/tcpflow/default.nix b/nixpkgs/pkgs/tools/networking/tcpflow/default.nix new file mode 100644 index 000000000000..cc923c0daf65 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/tcpflow/default.nix @@ -0,0 +1,46 @@ +{ stdenv, lib, fetchFromGitHub, automake, autoconf +, openssl, zlib, libpcap, boost +, useCairo ? false, cairo +}: + +stdenv.mkDerivation rec { + pname = "tcpflow"; + version = "1.6.1"; + + src = fetchFromGitHub { + owner = "simsong"; + repo = pname; + rev = "${pname}-${version}"; + sha256 = "0vbm097jhi5n8pg08ia1yhzc225zv9948blb76f4br739l9l22vq"; + fetchSubmodules = true; + }; + + nativeBuildInputs = [ automake autoconf ]; + buildInputs = [ openssl zlib libpcap boost ] + ++ lib.optional useCairo cairo; + + prePatch = '' + substituteInPlace bootstrap.sh \ + --replace ".git" "" \ + --replace "/bin/rm" "rm" + # Temporary fix for a build error: + # https://src.fedoraproject.org/rpms/tcpflow/blob/979e250032b90de2d6b9e5b94b5203d98cccedad/f/tcpflow-1.6.1-format.patch + substituteInPlace src/datalink.cpp \ + --replace 'DEBUG(6)(s.c_str());' 'DEBUG(6) ("%s", s.c_str());' + ''; + + preConfigure = "bash ./bootstrap.sh"; + + meta = with lib; { + description = "TCP stream extractor"; + longDescription = '' + tcpflow is a program that captures data transmitted as part of TCP + connections (flows), and stores the data in a way that is convenient for + protocol analysis and debugging. + ''; + inherit (src.meta) homepage; + license = licenses.gpl3; + maintainers = with maintainers; [ raskin obadz ]; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/tcpreplay/default.nix b/nixpkgs/pkgs/tools/networking/tcpreplay/default.nix new file mode 100644 index 000000000000..ed83e4d45549 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/tcpreplay/default.nix @@ -0,0 +1,35 @@ +{ lib, stdenv, fetchurl, libpcap, tcpdump, Carbon, CoreServices }: + +stdenv.mkDerivation rec { + pname = "tcpreplay"; + version = "4.3.4"; + + src = fetchurl { + url = "https://github.com/appneta/tcpreplay/releases/download/v${version}/tcpreplay-${version}.tar.gz"; + sha256 = "sha256-7gZTEIBsIuL9NvAU4euzMbmKfsTblY6Rw9nL2gZA2Sw="; + }; + + buildInputs = [ libpcap ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + Carbon CoreServices + ]; + + + configureFlags = [ + "--disable-local-libopts" + "--disable-libopts-install" + "--enable-dynamic-link" + "--enable-shared" + "--enable-tcpreplay-edit" + "--with-libpcap=${libpcap}" + "--with-tcpdump=${tcpdump}/bin" + ]; + + meta = with lib; { + description = "A suite of utilities for editing and replaying network traffic"; + homepage = "https://tcpreplay.appneta.com/"; + license = with licenses; [ bsdOriginalUC gpl3Only ]; + maintainers = with maintainers; [ eleanor ]; + platforms = platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/tcptraceroute/default.nix b/nixpkgs/pkgs/tools/networking/tcptraceroute/default.nix new file mode 100644 index 000000000000..1eacd685463e --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/tcptraceroute/default.nix @@ -0,0 +1,28 @@ +{ lib, stdenv , fetchurl, libpcap, libnet +}: + +stdenv.mkDerivation rec { + pkgname = "tcptraceroute"; + name = "${pkgname}-${version}"; + version = "1.5beta7"; + + src = fetchurl { + url = "https://github.com/mct/${pkgname}/archive/${name}.tar.gz"; + sha256 = "1rz8bgc6r1isb40awv1siirpr2i1paa2jc1cd3l5pg1m9522xzap"; + }; + + # for reasons unknown --disable-static configure flag doesn't disable static + # linking.. we instead override CFLAGS with -static omitted + preBuild = '' + makeFlagsArray=(CFLAGS=" -g -O2 -Wall") + ''; + + buildInputs = [ libpcap libnet ]; + + meta = { + description = "A traceroute implementation using TCP packets"; + homepage = "https://github.com/mct/tcptraceroute"; + license = lib.licenses.gpl2; + maintainers = [ ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/tdns-cli/default.nix b/nixpkgs/pkgs/tools/networking/tdns-cli/default.nix new file mode 100644 index 000000000000..9f1ac89ce8ec --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/tdns-cli/default.nix @@ -0,0 +1,22 @@ +{ lib, fetchFromGitHub, rustPlatform }: + +rustPlatform.buildRustPackage rec { + name = "tdns-cli"; + version = "0.0.5"; + + src = fetchFromGitHub { + owner = "rotty"; + repo = name; + rev = "v${version}"; + sha256 = "0nn036in5j1h0vxkwif0lf7fn900zy4f4kxlzy6qdx3jakgmxvwh"; + }; + + cargoSha256 = "14mmfj5my8gbsdhlhz17w8wjcc085c6dkj78kwr2hhsbcxp1vjgg"; + + meta = with lib; { + description = "DNS tool that aims to replace dig and nsupdate"; + homepage = "https://github.com/rotty/tdns-cli"; + license = licenses.gpl3; + maintainers = with maintainers; [ astro ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/telepresence/default.nix b/nixpkgs/pkgs/tools/networking/telepresence/default.nix new file mode 100644 index 000000000000..5d1966114b78 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/telepresence/default.nix @@ -0,0 +1,58 @@ +{ lib, pythonPackages, fetchFromGitHub, makeWrapper, git +, sshfs-fuse, torsocks, sshuttle, conntrack-tools , openssh, coreutils +, iptables, bash }: + +let + sshuttle-telepresence = + let + sshuttleTelepresenceRev = "32226ff14d98d58ccad2a699e10cdfa5d86d6269"; + in + lib.overrideDerivation sshuttle (p: { + src = fetchFromGitHub { + owner = "datawire"; + repo = "sshuttle"; + rev = sshuttleTelepresenceRev; + sha256 = "1lp5b0h9v59igf8wybjn42w6ajw08blhiqmjwp4r7qnvmvmyaxhh"; + }; + + SETUPTOOLS_SCM_PRETEND_VERSION="${sshuttleTelepresenceRev}"; + + postPatch = "rm sshuttle/tests/client/test_methods_nat.py"; + postInstall = "mv $out/bin/sshuttle $out/bin/sshuttle-telepresence"; + }); +in pythonPackages.buildPythonPackage rec { + pname = "telepresence"; + version = "0.108"; + + src = fetchFromGitHub { + owner = "telepresenceio"; + repo = "telepresence"; + rev = version; + sha256 = "6V0sM0Z+2xNDgL0wIzJOdaUp2Ol4ejNTk9K/pllVa7g="; + }; + + nativeBuildInputs = [ makeWrapper ]; + + postInstall = '' + wrapProgram $out/bin/telepresence \ + --prefix PATH : ${lib.makeBinPath [ + sshfs-fuse + torsocks + conntrack-tools + sshuttle-telepresence + openssh + coreutils + iptables + bash + ]} + ''; + + doCheck = false; + + meta = { + homepage = "https://www.telepresence.io/"; + description = "Local development against a remote Kubernetes or OpenShift cluster"; + license = with lib.licenses; [ asl20 ]; + maintainers = with lib.maintainers; [ offline ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/telepresence2/default.nix b/nixpkgs/pkgs/tools/networking/telepresence2/default.nix new file mode 100644 index 000000000000..97c758e19b4d --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/telepresence2/default.nix @@ -0,0 +1,28 @@ +{ lib, buildGoModule, fetchFromGitHub }: + +buildGoModule rec { + pname = "telepresence2"; + version = "2.2.1"; + + src = fetchFromGitHub { + owner = "telepresenceio"; + repo = "telepresence"; + rev = "v${version}"; + sha256 = "0pr6vm68jr5ld7hy2b4dwmjziir59vg137c74rdn1wlhq3n8vr41"; + }; + + vendorSha256 = "0d0p879zchhrzrf6f5zc3vdcd5zi1ind7ibvb46y6wx6lp0f1nrp"; + + buildFlagsArray = '' + -ldflags=-s -w -X=github.com/telepresenceio/telepresence/v2/pkg/version.Version=${src.rev} + ''; + + subPackages = [ "cmd/telepresence" ]; + + meta = with lib; { + description = "Local development against a remote Kubernetes or OpenShift cluster"; + homepage = "https://www.getambassador.io/docs/telepresence/2.1/quick-start/"; + license = licenses.asl20; + maintainers = with maintainers; [ mausch ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/tendermint/default.nix b/nixpkgs/pkgs/tools/networking/tendermint/default.nix new file mode 100644 index 000000000000..b97c49dd9c96 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/tendermint/default.nix @@ -0,0 +1,31 @@ +{ lib, fetchFromGitHub, buildGoModule }: + +buildGoModule rec { + pname = "tendermint"; + version = "0.34.8"; + + src = fetchFromGitHub { + owner = "tendermint"; + repo = pname; + rev = "v${version}"; + sha256 = "sha256:03k44w23167az2kk6ccp3139kykzkhack4w2vy0wvs2lb67xiqd9"; + }; + + vendorSha256 = "sha256-0Y9QDBVNYE2x3nY3loRKTCtYWXRnK7v+drRVvTMY4Dg="; + + subPackages = [ "cmd/tendermint" ]; + + preBuild = '' + makeFlagsArray+=( + "-ldflags=-s -w -X github.com/tendermint/tendermint/version.GitCommit=${src.rev}" + ) + ''; + + meta = with lib; { + description = "Byzantine-Fault Tolerant State Machines. Or Blockchain, for short"; + homepage = "https://tendermint.com/"; + license = licenses.asl20; + maintainers = with maintainers; [ alexfmpe ]; + platforms = platforms.linux ++ platforms.darwin; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/termshark/default.nix b/nixpkgs/pkgs/tools/networking/termshark/default.nix new file mode 100644 index 000000000000..7b9a3c42d606 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/termshark/default.nix @@ -0,0 +1,36 @@ +{ lib, fetchFromGitHub, makeWrapper, buildGoModule, wireshark-cli }: + +buildGoModule rec { + pname = "termshark"; + version = "2.2.0"; + + src = fetchFromGitHub { + owner = "gcla"; + repo = "termshark"; + rev = "v${version}"; + sha256 = "sha256-vS6j8Mcri3SI/6HqtFX/EzVl8S0lx8fWU+0ddjzJz8g="; + }; + + nativeBuildInputs = [ makeWrapper ]; + buildInputs = [ wireshark-cli ]; + + vendorSha256 = "sha256-md9HHiYOsBimCBjD1FyjTqnskCZksQiEggWd5UW0RPM="; + + doCheck = false; + + postFixup = '' + wrapProgram $out/bin/termshark --prefix PATH : ${lib.makeBinPath [ wireshark-cli ]} + ''; + + buildFlagsArray = '' + -ldflags= + -X github.com/gcla/termshark.Version=${version} + ''; + + meta = with lib; { + homepage = "https://termshark.io/"; + description = "A terminal UI for wireshark-cli, inspired by Wireshark"; + license = licenses.mit; + maintainers = with maintainers; [ winpat elseym ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/tftp-hpa/default.nix b/nixpkgs/pkgs/tools/networking/tftp-hpa/default.nix new file mode 100644 index 000000000000..f8e028dc616a --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/tftp-hpa/default.nix @@ -0,0 +1,24 @@ +{ lib, stdenv, fetchurl }: + +stdenv.mkDerivation rec { + pname = "tftp-hpa"; + version="5.2"; + src = fetchurl { + url = "mirror://kernel/software/network/tftp/tftp-hpa/${pname}-${version}.tar.xz"; + sha256 = "12vidchglhyc20znq5wdsbhi9mqg90jnl7qr9qs8hbvaz4fkdvmg"; + }; + + meta = with lib; { + description = "TFTP tools - a lot of fixes on top of BSD TFTP"; + maintainers = with maintainers; [ raskin ]; + platforms = platforms.linux; + license = licenses.bsd3; + homepage = "https://www.kernel.org/pub/software/network/tftp/"; + }; + + passthru = { + updateInfo = { + downloadPage = "https://www.kernel.org/pub/software/network/tftp/"; + }; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/tgt/default.nix b/nixpkgs/pkgs/tools/networking/tgt/default.nix new file mode 100644 index 000000000000..ba1f89af433e --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/tgt/default.nix @@ -0,0 +1,59 @@ +{ stdenv, lib, fetchFromGitHub, libxslt, libaio, systemd, perl +, docbook_xsl, coreutils, lsof, rdma-core, makeWrapper, sg3_utils, util-linux +}: + +stdenv.mkDerivation rec { + pname = "tgt"; + version = "1.0.80"; + + src = fetchFromGitHub { + owner = "fujita"; + repo = pname; + rev = "v${version}"; + sha256 = "sha256-5qBqCHbkL6yw/iT2AtSumw8V0bV74TEyYMRgcPHW2lg="; + }; + + nativeBuildInputs = [ libxslt docbook_xsl makeWrapper ]; + + buildInputs = [ systemd libaio ]; + + makeFlags = [ + "PREFIX=${placeholder "out"}" + "SD_NOTIFY=1" + ]; + + installFlags = [ + "sysconfdir=${placeholder "out"}/etc" + ]; + + preConfigure = '' + sed -i 's|/usr/bin/||' doc/Makefile + sed -i 's|/usr/include/libaio.h|${libaio}/include/libaio.h|' usr/Makefile + sed -i 's|/usr/include/sys/|${stdenv.glibc.dev}/include/sys/|' usr/Makefile + sed -i 's|/usr/include/linux/|${stdenv.glibc.dev}/include/linux/|' usr/Makefile + ''; + + postInstall = '' + substituteInPlace $out/sbin/tgt-admin \ + --replace "#!/usr/bin/perl" "#! ${perl.withPackages (p: [ p.ConfigGeneral ])}/bin/perl" + wrapProgram $out/sbin/tgt-admin --prefix PATH : \ + ${lib.makeBinPath [ lsof sg3_utils (placeholder "out") ]} + + install -D scripts/tgtd.service $out/etc/systemd/system/tgtd.service + substituteInPlace $out/etc/systemd/system/tgtd.service \ + --replace "/usr/sbin/tgt" "$out/bin/tgt" + + # See https://bugzilla.redhat.com/show_bug.cgi?id=848942 + sed -i '/ExecStart=/a ExecStartPost=${coreutils}/bin/sleep 5' $out/etc/systemd/system/tgtd.service + ''; + + enableParallelBuilding = true; + + meta = with lib; { + description = "iSCSI Target daemon with RDMA support"; + homepage = "http://stgt.sourceforge.net/"; + license = licenses.gpl2; + platforms = platforms.linux; + maintainers = with maintainers; [ johnazoidberg ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/tinc/default.nix b/nixpkgs/pkgs/tools/networking/tinc/default.nix new file mode 100644 index 000000000000..2387c903a9b0 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/tinc/default.nix @@ -0,0 +1,31 @@ +{lib, stdenv, fetchurl, lzo, openssl, zlib}: + +stdenv.mkDerivation rec { + version = "1.0.36"; + pname = "tinc"; + + src = fetchurl { + url = "https://www.tinc-vpn.org/packages/tinc-${version}.tar.gz"; + sha256 = "021i2sl2mjscbm8g59d7vs74iw3gf0m48wg7w3zhwj6czarkpxs0"; + }; + + buildInputs = [ lzo openssl zlib ]; + + configureFlags = [ + "--localstatedir=/var" + "--sysconfdir=/etc" + ]; + + meta = { + description = "VPN daemon with full mesh routing"; + longDescription = '' + tinc is a Virtual Private Network (VPN) daemon that uses tunnelling and + encryption to create a secure private network between hosts on the + Internet. It features full mesh routing, as well as encryption, + authentication, compression and ethernet bridging. + ''; + homepage="http://www.tinc-vpn.org/"; + license = lib.licenses.gpl2Plus; + platforms = lib.platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/tinc/pre.nix b/nixpkgs/pkgs/tools/networking/tinc/pre.nix new file mode 100644 index 000000000000..2379338e51d9 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/tinc/pre.nix @@ -0,0 +1,52 @@ +{ lib, stdenv, fetchgit, fetchpatch, autoreconfHook, texinfo, ncurses, readline, zlib, lzo, openssl }: + +stdenv.mkDerivation rec { + pname = "tinc"; + version = "1.1pre17"; + + src = fetchgit { + rev = "refs/tags/release-${version}"; + url = "git://tinc-vpn.org/tinc"; + sha256 = "12abmx9qglchgn94a1qwgzldf2kaz77p8705ylpggzyncxv6bw2q"; + }; + + outputs = [ "out" "man" "info" ]; + + patches = [ + (fetchpatch { + name = "tinc-openssl-1.0.2r.patch"; + url = "http://git.tinc-vpn.org/git/browse?p=tinc;a=patch;h=2b0aeec02d64bb4724da9ff1dbc19b7d35d7c904"; + sha256 = "0kidzlmgl0cin4g54ygcxa0jbq9vwlk3dyq5f65nkjd8yvayfzi8"; + }) + ]; + + nativeBuildInputs = [ autoreconfHook texinfo ]; + buildInputs = [ ncurses readline zlib lzo openssl ]; + + # needed so the build doesn't need to run git to find out the version. + prePatch = '' + substituteInPlace configure.ac --replace UNKNOWN ${version} + echo "${version}" > configure-version + echo "https://tinc-vpn.org/git/browse?p=tinc;a=log;h=refs/tags/release-${version}" > ChangeLog + sed -i '/AC_INIT/s/m4_esyscmd_s.*/${version})/' configure.ac + ''; + + configureFlags = [ + "--sysconfdir=/etc" + "--localstatedir=/var" + ]; + + meta = with lib; { + description = "VPN daemon with full mesh routing"; + longDescription = '' + tinc is a Virtual Private Network (VPN) daemon that uses tunnelling and + encryption to create a secure private network between hosts on the + Internet. It features full mesh routing, as well as encryption, + authentication, compression and ethernet bridging. + ''; + homepage="http://www.tinc-vpn.org/"; + license = licenses.gpl2Plus; + platforms = platforms.unix; + maintainers = with maintainers; [ fpletz lassulus mic92 ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/tinyfecvpn/default.nix b/nixpkgs/pkgs/tools/networking/tinyfecvpn/default.nix new file mode 100644 index 000000000000..190950e37ecc --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/tinyfecvpn/default.nix @@ -0,0 +1,37 @@ +{ lib, stdenv, fetchFromGitHub, pkg-config }: + +stdenv.mkDerivation rec { + pname = "tinyfecvpn"; + version = "20180820.0"; + + src = fetchFromGitHub { + owner = "wangyu-"; + repo = pname; + rev = version; + sha256 = "1mbb9kzvy24na375dz0rlf5k93gan1vahamc9wzkn34mcx8i97cs"; + fetchSubmodules = true; + }; + + enableParallelBuilding = true; + nativeBuildInputs = [ pkg-config ]; + + patchPhase = '' + runHook prePatch + find . -type f -name "makefile" -exec sed "s/ -static/ -g/g" -i \{\} \; + runHook postPatch + ''; + + installPhase = '' + runHook preInstall + install -Dm755 tinyvpn $out/bin/tinyvpn + runHook postInstall + ''; + + meta = with lib; { + homepage = "https://github.com/wangyu-/tinyfecVPN"; + description = "A VPN Designed for Lossy Links, with Build-in Forward Error Correction(FEC) Support"; + license = licenses.mit; + platforms = platforms.linux; + maintainers = with maintainers; [ petabyteboy ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/tinyproxy/default.nix b/nixpkgs/pkgs/tools/networking/tinyproxy/default.nix new file mode 100644 index 000000000000..6aa05738498b --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/tinyproxy/default.nix @@ -0,0 +1,26 @@ +{ lib, stdenv, fetchFromGitHub, autoreconfHook, perl, withDebug ? false }: + +stdenv.mkDerivation rec { + pname = "tinyproxy"; + version = "1.11.0"; + + src = fetchFromGitHub { + sha256 = "13fhkmmrwzl657dq04x2wagkpjwdrzhkl141qvzr7y7sli8j0w1n"; + rev = version; + repo = "tinyproxy"; + owner = "tinyproxy"; + }; + + # perl is needed for man page generation. + nativeBuildInputs = [ autoreconfHook perl ]; + + configureFlags = lib.optionals withDebug [ "--enable-debug" ]; # Enable debugging support code and methods. + + meta = with lib; { + homepage = "https://tinyproxy.github.io/"; + description = "A light-weight HTTP/HTTPS proxy daemon for POSIX operating systems"; + license = licenses.gpl2Only; + platforms = platforms.all; + maintainers = [ maintainers.carlosdagos ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/tlspool/default.nix b/nixpkgs/pkgs/tools/networking/tlspool/default.nix new file mode 100644 index 000000000000..01eced9a5664 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/tlspool/default.nix @@ -0,0 +1,52 @@ +{ lib, stdenv, fetchFromGitHub +, cmake, pkg-config, arpa2cm +, openldap, p11-kit, unbound, libtasn1, db, openssl, quickder, libkrb5, ldns, gnutls-kdh +, softhsm +}: + +let + pname = "tlspool"; + version = "20180227"; +in + +stdenv.mkDerivation { + name = "${pname}-${version}"; + src = fetchFromGitHub { + owner = "arpa2"; + repo = "tlspool"; + rev = "b4459637d71c7602e94d455e23c74f3973b9cf30"; + sha256 = "0x78f2bdsiglwicwn3injm5ysfjlfa0yzdpnc0r3iw4z0n89rj2r"; + }; + + nativeBuildInputs = [ + cmake pkg-config arpa2cm + ]; + + buildInputs = [ + openldap p11-kit unbound libtasn1 db openssl quickder libkrb5 ldns gnutls-kdh + ]; + + postPatch = '' + # CMake is probably confused because the current version isn't 1.2.6, but 1.2-6 + substituteInPlace CMakeLists.txt \ + --replace "Quick-DER 1.2.4" "Quick-DER 1.2" + substituteInPlace etc/tlspool.conf \ + --replace "dnssec_rootkey ../etc/root.key" "dnssec_rootkey $out/etc/root.key" \ + --replace "pkcs11_path /usr/local/lib/softhsm/libsofthsm2.so" "pkcs11_path ${softhsm}/lib/softhsm/libsofthsm2.so" + ''; + + postInstall = '' + mkdir -p $out/include/${pname}/pulleyback $out/etc/tlspool + cp -R $src/etc/* $out/etc/tlspool/ + cp $src/include/tlspool/*.h $out/include/${pname} + cp $src/pulleyback/*.h $out/include/${pname}/pulleyback/ + cp $src/src/*.h $out/include/${pname} + ''; + + meta = with lib; { + description = "A supercharged TLS daemon that allows for easy, strong and consistent deployment"; + license = licenses.gpl3; + homepage = "http://www.tlspool.org"; + maintainers = with maintainers; [ leenaars qknight ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/tnat64/default.nix b/nixpkgs/pkgs/tools/networking/tnat64/default.nix new file mode 100644 index 000000000000..9b1c2c3aec11 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/tnat64/default.nix @@ -0,0 +1,37 @@ +{ lib, stdenv, fetchFromGitHub, autoreconfHook }: + +stdenv.mkDerivation rec { + pname = "tnat64"; + version = "0.05"; + + src = fetchFromGitHub { + owner = "andrewshadura"; + repo = pname; + rev = "${pname}-${version}"; + sha256 = "07lmzidbrd3aahk2jvv93cic9gf36pwmgfd63gmy6hjkxf9a6fw9"; + }; + + postPatch = '' + # Fix usage of deprecated sys_errlist + substituteInPlace tnat64.c --replace 'sys_errlist[errno]' 'strerror(errno)' + ''; + + configureFlags = [ "--libdir=$(out)/lib" ]; + nativeBuildInputs = [ autoreconfHook ]; + + meta = with lib; { + description = "IPv4 to IPv6 interceptor"; + homepage = "https://github.com/andrewshadura/tnat64"; + license = licenses.gpl2Plus; + longDescription = '' + TNAT64 is an interceptor which redirects outgoing TCPv4 connections + through NAT64, thus enabling an application running on an IPv6-only host + to communicate with the IPv4 world, even if that application does not + support IPv6 at all. + ''; + platforms = platforms.unix; + badPlatforms = platforms.darwin; + maintainers = [ maintainers.rnhmjoj ]; + }; + +} diff --git a/nixpkgs/pkgs/tools/networking/toss/default.nix b/nixpkgs/pkgs/tools/networking/toss/default.nix new file mode 100644 index 000000000000..3c8f72961812 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/toss/default.nix @@ -0,0 +1,20 @@ +{ lib, stdenv, fetchFromGitHub }: + +stdenv.mkDerivation rec { + pname = "toss"; + version = "1.1"; + src = fetchFromGitHub { + owner = "zerotier"; + repo = pname; + rev = version; + sha256 = "05ql0d8wbdhnmh3dw8ch5bi6clfb9h8v21lq2a74iy02slya2y0r"; + }; + preInstall = "export DESTDIR=$out/bin"; + meta = with lib; + src.meta // { + description = "Dead simple LAN file transfers from the command line"; + license = with licenses; [ mit ]; + maintainers = with maintainers; [ ehmry ]; + platforms = platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/tox-node/default.nix b/nixpkgs/pkgs/tools/networking/tox-node/default.nix new file mode 100644 index 000000000000..5ed6aa632d33 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/tox-node/default.nix @@ -0,0 +1,35 @@ +{ lib, rustPlatform, fetchFromGitHub +, libsodium, openssl +, pkg-config +}: + +with rustPlatform; + +buildRustPackage rec { + pname = "tox-node"; + version = "0.1.1"; + + src = fetchFromGitHub { + owner = "tox-rs"; + repo = "tox-node"; + rev = "v${version}"; + sha256 = "sha256-tB6v2NEBdTNHf89USdQOr/pV0mbxxb8ftOYPPJMvz5Y="; + }; + + buildInputs = [ libsodium openssl ]; + nativeBuildInputs = [ pkg-config ]; + + SODIUM_USE_PKG_CONFIG = "yes"; + + doCheck = false; + + cargoSha256 = "sha256-J/0KO33vZmOvm6V7qCXInuAJTbRqyy5/qj6p6dEmoas="; + + meta = with lib; { + description = "A server application to run tox node written in pure Rust"; + homepage = "https://github.com/tox-rs/tox-node"; + license = [ licenses.gpl3Plus ]; + platforms = platforms.linux; + maintainers = with maintainers; [ suhr ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/toxvpn/default.nix b/nixpkgs/pkgs/tools/networking/toxvpn/default.nix new file mode 100644 index 000000000000..c433d7d0a668 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/toxvpn/default.nix @@ -0,0 +1,33 @@ +{ lib, stdenv, fetchFromGitHub, cmake, nlohmann_json, + libtoxcore, libsodium, libcap, zeromq, + systemd ? null }: + +with lib; + +stdenv.mkDerivation { + name = "toxvpn-2019-09-09"; + + src = fetchFromGitHub { + owner = "cleverca22"; + repo = "toxvpn"; + rev = "45083dec172ce167f7ed84d571ec2822ebe4d51a"; + sha256 = "193crarrx6q0zd2p6dn67pzv8kngwi440zm1y54njgcz0v3fpxmb"; + }; + + buildInputs = [ libtoxcore nlohmann_json libsodium zeromq ] + ++ optionals stdenv.isLinux [ libcap systemd ]; + + nativeBuildInputs = [ cmake ]; + + cmakeFlags = optional stdenv.isLinux [ "-DSYSTEMD=1" ]; + + postInstall = "$out/bin/toxvpn -h"; + + meta = with lib; { + description = "A powerful tool that allows one to make tunneled point to point connections over Tox"; + homepage = "https://github.com/cleverca22/toxvpn"; + license = licenses.gpl3; + maintainers = with maintainers; [ cleverca22 obadz toonn ]; + platforms = platforms.linux ++ platforms.darwin; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/tracebox/default.nix b/nixpkgs/pkgs/tools/networking/tracebox/default.nix new file mode 100644 index 000000000000..3d50b11f8e1a --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/tracebox/default.nix @@ -0,0 +1,32 @@ +{ lib, stdenv, fetchzip, autoreconfHook, libcrafter, libpcap, lua }: + +stdenv.mkDerivation rec { + pname = "tracebox"; + version = "0.2"; + + src = fetchzip { + url = "https://github.com/tracebox/tracebox/archive/v${version}.zip"; + sha256 = "0gxdapm6b5a41gymi1f0nr2kyz70vllnk10085yz3pq527gp9gns"; + }; + + nativeBuildInputs = [ autoreconfHook ]; + buildInputs = [ libcrafter lua ]; + + configureFlags = [ "--with-lua=yes" ]; + + NIX_LDFLAGS = "${libpcap}/lib/libpcap.so ${libcrafter}/lib/libcrafter.so"; + + preAutoreconf = '' + substituteInPlace Makefile.am --replace "noinst" "" + sed '/noinst/d' -i configure.ac + sed '/libcrafter/d' -i src/tracebox/Makefile.am + ''; + + meta = with lib; { + homepage = "http://www.tracebox.org/"; + description = "A middlebox detection tool"; + license = lib.licenses.gpl2; + maintainers = [ ]; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/traceroute/default.nix b/nixpkgs/pkgs/tools/networking/traceroute/default.nix new file mode 100644 index 000000000000..c941aad258cc --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/traceroute/default.nix @@ -0,0 +1,25 @@ +{ lib, stdenv, fetchurl }: + +stdenv.mkDerivation rec { + pname = "traceroute"; + version = "2.1.0"; + + src = fetchurl { + url = "mirror://sourceforge/traceroute/${pname}-${version}.tar.gz"; + sha256 = "3669d22a34d3f38ed50caba18cd525ba55c5c00d5465f2d20d7472e5d81603b6"; + }; + + makeFlags = [ "prefix=$(out)" "LDFLAGS=-lm" ]; + + preConfigure = '' + sed -i 's@LIBS := \(.*\) -lm \(.*\)@LIBS := \1 \2@' Make.rules + ''; + + meta = with lib; { + homepage = "http://traceroute.sourceforge.net/"; + description = "Tracks the route taken by packets over an IP network"; + license = lib.licenses.gpl2; + maintainers = [ maintainers.koral ]; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/trickle/default.nix b/nixpkgs/pkgs/tools/networking/trickle/default.nix new file mode 100644 index 000000000000..8a5143d1e3bd --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/trickle/default.nix @@ -0,0 +1,34 @@ +{ lib, stdenv, fetchurl, libevent, libtirpc }: + +stdenv.mkDerivation rec { + name = "trickle-1.07"; + + src = fetchurl { + url = "https://monkey.org/~marius/trickle/${name}.tar.gz"; + sha256 = "0s1qq3k5mpcs9i7ng0l9fvr1f75abpbzfi1jaf3zpzbs1dz50dlx"; + }; + + buildInputs = [ libevent libtirpc ]; + + preConfigure = '' + sed -i 's|libevent.a|libevent.so|' configure + ''; + + preBuild = '' + sed -i '/#define in_addr_t/ s:^://:' config.h + ''; + + NIX_LDFLAGS = [ "-levent" "-ltirpc" ]; + NIX_CFLAGS_COMPILE = [ "-I${libtirpc.dev}/include/tirpc" ]; + + configureFlags = [ "--with-libevent" ]; + + hardeningDisable = [ "format" ]; + + meta = { + description = "Lightweight userspace bandwidth shaper"; + license = lib.licenses.bsd3; + homepage = "https://monkey.org/~marius/pages/?page=trickle"; + platforms = lib.platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/tridactyl-native/default.nix b/nixpkgs/pkgs/tools/networking/tridactyl-native/default.nix new file mode 100644 index 000000000000..ce7325975fb3 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/tridactyl-native/default.nix @@ -0,0 +1,44 @@ +{ lib, stdenv +, fetchFromGitHub +, python3 +}: + +stdenv.mkDerivation rec { + pname = "tridactyl-native"; + # this is actually the version of tridactyl itself; the native messenger will + # probably not change with every tridactyl version + version = "1.20.4"; + + src = fetchFromGitHub { + owner = "tridactyl"; + repo = "tridactyl"; + rev = version; + sha256 = "sha256-BjjRB9VadQ/MSwNK2QLbcTDoRs6Ua+5MONHtmfq4xz0="; + }; + sourceRoot = "source/native"; + + nativeBuildInputs = [ + python3.pkgs.wrapPython + ]; + + buildPhase = '' + sed -i -e "s|REPLACE_ME_WITH_SED|$out/share/tridactyl/native_main.py|" "tridactyl.json" + ''; + + installPhase = '' + mkdir -p "$out/lib/mozilla/native-messaging-hosts" + cp tridactyl.json "$out/lib/mozilla/native-messaging-hosts/" + + mkdir -p "$out/share/tridactyl" + cp native_main.py "$out/share/tridactyl" + wrapPythonProgramsIn "$out/share/tridactyl" + ''; + + meta = with lib; { + description = "Tridactyl native messaging host application"; + homepage = "https://github.com/tridactyl/tridactyl"; + license = licenses.asl20; + platforms = platforms.all; + maintainers = with maintainers; [ timokau ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/tunnelto/default.nix b/nixpkgs/pkgs/tools/networking/tunnelto/default.nix new file mode 100644 index 000000000000..e750327e4bab --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/tunnelto/default.nix @@ -0,0 +1,33 @@ +{ lib, stdenv +, rustPlatform +, fetchFromGitHub +, openssl +, pkg-config +, Security +}: + +rustPlatform.buildRustPackage rec { + pname = "tunnelto"; + version = "0.1.12"; + + src = fetchFromGitHub { + owner = "agrinman"; + repo = pname; + rev = version; + sha256 = "1vvb619cq3n88y2s8lncwcyrhb5s4gpjfiyia91pilcpnfdb04y2"; + }; + + cargoSha256 = "1pjd62yz7pavcinc96g2x0f5giadl9aqvz1i5vhfanh6mj6mrbl1"; + + nativeBuildInputs = lib.optionals stdenv.isLinux [ pkg-config ]; + buildInputs = [ ] + ++ lib.optionals stdenv.isLinux [ openssl ] + ++ lib.optionals stdenv.isDarwin [ Security ]; + + meta = with lib; { + description = "Expose your local web server to the internet with a public URL"; + homepage = "https://tunnelto.dev"; + license = licenses.mit; + maintainers = with maintainers; [ Br1ght0ne ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/twa/default.nix b/nixpkgs/pkgs/tools/networking/twa/default.nix new file mode 100644 index 000000000000..b6038aa54353 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/twa/default.nix @@ -0,0 +1,57 @@ +{ stdenv +, bash +, curl +, fetchFromGitHub +, gawk +, host +, jq +, lib +, makeWrapper +, ncurses +, netcat +}: + +stdenv.mkDerivation rec { + pname = "twa"; + version = "1.9.1"; + + src = fetchFromGitHub { + owner = "trailofbits"; + repo = "twa"; + rev = version; + sha256 = "1ab3bcyhfach9y15w8ffvqqan2qk8h62n6z8nqbgygi7n1mf6jzx"; + }; + + dontBuild = true; + + nativeBuildInputs = [ makeWrapper ]; + + buildInputs = [ bash + curl + gawk + host.dnsutils + jq + netcat ]; + + installPhase = '' + install -Dm 0755 twa "$out/bin/twa" + install -Dm 0755 tscore "$out/bin/tscore" + install -Dm 0644 twa.1 "$out/share/man/man1/twa.1" + install -Dm 0644 README.md "$out/share/doc/twa/README.md" + + wrapProgram "$out/bin/twa" \ + --prefix PATH : ${lib.makeBinPath [ curl + host.dnsutils + jq + ncurses + netcat ]} + ''; + + meta = with lib; { + description = "A tiny web auditor with strong opinions"; + homepage = "https://github.com/trailofbits/twa"; + license = licenses.mit; + maintainers = with maintainers; [ avaq ]; + platforms = platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/ua/default.nix b/nixpkgs/pkgs/tools/networking/ua/default.nix new file mode 100644 index 000000000000..feb17b283de5 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/ua/default.nix @@ -0,0 +1,31 @@ +{ lib, buildGoPackage, fetchgit +, pkg-config +, glib, libxml2 +}: + +buildGoPackage rec { + pname = "ua-unstable"; + version = "2017-02-24"; + rev = "325dab92c60e0f028e55060f0c288aa70905fb17"; + + goPackagePath = "github.com/sloonz/ua"; + + src = fetchgit { + inherit rev; + url = "https://github.com/sloonz/ua.git"; + sha256 = "0452qknc8km9495324g6b5ja3shvk8jl7aa9nrjhdylf09dp2nif"; + }; + + goDeps = ./deps.nix; + + nativeBuildInputs = [ pkg-config ]; + buildInputs = [ glib libxml2 ]; + + meta = { + homepage = "https://github.com/sloonz/ua"; + license = lib.licenses.isc; + description = "Universal Aggregator"; + platforms = lib.platforms.unix; + maintainers = with lib.maintainers; [ ttuegel ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/ua/deps.nix b/nixpkgs/pkgs/tools/networking/ua/deps.nix new file mode 100644 index 000000000000..e59b9f239a68 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/ua/deps.nix @@ -0,0 +1,57 @@ +# This file was generated by https://github.com/kamilchm/go2nix v1.2.0 +[ + { + goPackagePath = "github.com/sloonz/cfeedparser"; + fetch = { + type = "git"; + url = "https://github.com/sloonz/cfeedparser"; + rev = "a220b181f09fa7fba347c7fa72168ed8a010907a"; + sha256 = "1dsdzflwbb0cw39bs37shggmswggb326sfdb5x25f4bpd19z6qp0"; + }; + } + { + goPackagePath = "github.com/sloonz/go-maildir"; + fetch = { + type = "git"; + url = "https://github.com/sloonz/go-maildir"; + rev = "4629e76d952bb24730bbe1b4c7bc628cd54babb6"; + sha256 = "0i9r7hhk0ih47pmc9ixhv17fa6gba3j7vk9g8j0di0pr0siha65f"; + }; + } + { + goPackagePath = "github.com/sloonz/go-mime-message"; + fetch = { + type = "git"; + url = "https://github.com/sloonz/go-mime-message"; + rev = "cf50e17d2410fee25cdb89485ab0d5996f2d3bfc"; + sha256 = "09r45w2qfl0rx785xpgcjv9bvdnwkz7fyr272rdi3krwr900fwxs"; + }; + } + { + goPackagePath = "github.com/sloonz/go-qprintable"; + fetch = { + type = "git"; + url = "https://github.com/sloonz/go-qprintable"; + rev = "775b3a4592d5bfc47b0ba398ec0d4dba018e5926"; + sha256 = "19r8ica7kd946brdh1zn4hkzgbciqsz42a2p1h7hgzpmld51kg43"; + }; + } + { + goPackagePath = "gopkg.in/redis.v3"; + fetch = { + type = "git"; + url = "https://github.com/go-redis/redis"; + rev = "b5e368500d0a508ef8f16e9c2d4025a8a46bcc29"; + sha256 = "1syhnm1csrlfh1jgd1v9bzf2pp9ljyg4ks3z6xx0nqd83xmyhdzh"; + }; + } + { + goPackagePath = "gopkg.in/bsm/ratelimit.v1"; + fetch = { + type = "git"; + url = "https://github.com/bsm/ratelimit"; + rev = "db14e161995a5177acef654cb0dd785e8ee8bc22"; + sha256 = "1ph6dsvgwrsli9akh6arwkvz78hkdb42lyqmgfckjcsar1a2fcsh"; + }; + } +] diff --git a/nixpkgs/pkgs/tools/networking/ubridge/default.nix b/nixpkgs/pkgs/tools/networking/ubridge/default.nix new file mode 100644 index 000000000000..ac475e6e8a53 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/ubridge/default.nix @@ -0,0 +1,41 @@ +{ lib, stdenv, fetchFromGitHub +, libpcap +}: + +stdenv.mkDerivation rec { + pname = "ubridge"; + version = "0.9.18"; + + src = fetchFromGitHub { + owner = "GNS3"; + repo = "ubridge"; + rev = "v${version}"; + sha256 = "0jg66jhhpv4c9340fsdp64hf9h253i8r81fknxa0gq241ripp3jn"; + }; + + postPatch = '' + substituteInPlace Makefile \ + --replace "/usr/local/bin" "$out/bin" \ + --replace "setcap" "#setcap" + ''; + + buildInputs = [ libpcap ]; + + preInstall = '' + mkdir -p $out/bin + ''; + + meta = with lib; { + description = "Bridge for UDP tunnels, Ethernet, TAP, and VMnet interfaces"; + longDescription = '' + uBridge is a simple application to create user-land bridges between + various technologies. Currently bridging between UDP tunnels, Ethernet + and TAP interfaces is supported. Packet capture is also supported. + ''; + inherit (src.meta) homepage; + changelog = "https://github.com/GNS3/ubridge/releases/tag/v${version}"; + license = licenses.gpl3Plus; + platforms = platforms.linux; + maintainers = with maintainers; [ primeos ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/ucspi-tcp/default.nix b/nixpkgs/pkgs/tools/networking/ucspi-tcp/default.nix new file mode 100644 index 000000000000..0d6e0a2f8d96 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/ucspi-tcp/default.nix @@ -0,0 +1,86 @@ +{ lib, stdenv, fetchurl }: + +stdenv.mkDerivation rec { + name = "ucspi-tcp-0.88"; + + src = fetchurl { + url = "https://cr.yp.to/ucspi-tcp/${name}.tar.gz"; + sha256 = "171yl9kfm8w7l17dfxild99mbf877a9k5zg8yysgb1j8nz51a1ja"; + }; + + # Plain upstream tarball doesn't build, get patches from Debian + patches = [ + (fetchurl { + url = "http://ftp.de.debian.org/debian/pool/main/u/ucspi-tcp/ucspi-tcp_0.88-3.diff.gz"; + sha256 = "0mzmhz8hjkrs0khmkzs5i0s1kgmgaqz07h493bd5jj5fm5njxln6"; + }) + ./remove-setuid.patch + ]; + + # Apply Debian patches + postPatch = '' + for fname in debian/diff/*.diff; do + echo "Applying patch $fname" + patch < "$fname" + done + ''; + + # The build system is weird; 'make install' doesn't install anything, instead + # it builds an executable called ./install (from C code) which installs + # binaries to the directory given on line 1 in ./conf-home. + # + # Also, assume getgroups and setgroups work, instead of doing a build time + # test that breaks on NixOS (I think because nixbld users lack CAP_SETGID + # capability). + preBuild = '' + echo "$out" > conf-home + + echo "main() { return 0; }" > chkshsgr.c + ''; + + installPhase = '' + mkdir -p "$out/bin" + mkdir -p "$out/share/man/man1" + + # run the newly built installer + ./install + + # Install Debian man pages (upstream has none) + cp debian/ucspi-tcp-man/*.1 "$out/share/man/man1" + ''; + + meta = with lib; { + description = "Command-line tools for building TCP client-server applications"; + longDescription = '' + tcpserver waits for incoming connections and, for each connection, runs a + program of your choice. Your program receives environment variables + showing the local and remote host names, IP addresses, and port numbers. + + tcpserver offers a concurrency limit to protect you from running out of + processes and memory. When you are handling 40 (by default) simultaneous + connections, tcpserver smoothly defers acceptance of new connections. + + tcpserver also provides TCP access control features, similar to + tcp-wrappers/tcpd's hosts.allow but much faster. Its access control rules + are compiled into a hashed format with cdb, so it can easily deal with + thousands of different hosts. + + This package includes a recordio tool that monitors all the input and + output of a server. + + tcpclient makes a TCP connection and runs a program of your choice. It + sets up the same environment variables as tcpserver. + + This package includes several sample clients built on top of tcpclient: + who@, date@, finger@, http@, tcpcat, and mconnect. + + tcpserver and tcpclient conform to UCSPI, the UNIX Client-Server Program + Interface, using the TCP protocol. UCSPI tools are available for several + different networks. + ''; + homepage = "http://cr.yp.to/ucspi-tcp.html"; + license = licenses.publicDomain; + platforms = platforms.linux; + maintainers = [ maintainers.bjornfor ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/ucspi-tcp/remove-setuid.patch b/nixpkgs/pkgs/tools/networking/ucspi-tcp/remove-setuid.patch new file mode 100644 index 000000000000..dd6933208046 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/ucspi-tcp/remove-setuid.patch @@ -0,0 +1,15 @@ +diff --git a/hier.c b/hier.c +index 5663ada..1d73b84 100644 +--- a/hier.c ++++ b/hier.c +@@ -2,8 +2,8 @@ + + void hier() + { +- h(auto_home,-1,-1,02755); +- d(auto_home,"bin",-1,-1,02755); ++ h(auto_home,-1,-1,0755); ++ d(auto_home,"bin",-1,-1,0755); + + c(auto_home,"bin","tcpserver",-1,-1,0755); + c(auto_home,"bin","tcprules",-1,-1,0755); diff --git a/nixpkgs/pkgs/tools/networking/udptunnel/default.nix b/nixpkgs/pkgs/tools/networking/udptunnel/default.nix new file mode 100644 index 000000000000..6063cb38b568 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/udptunnel/default.nix @@ -0,0 +1,24 @@ +{ lib, stdenv, fetchurl }: + +stdenv.mkDerivation { + name = "udptunnel-19"; + + src = fetchurl { + url = "https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/udptunnel/udptunnel-r19.tar.gz"; + sha256 = "1hkrn153rdyrp9g15z4d5dq44cqlnby2bfplp6z0g3862lnv7m3l"; + }; + + installPhase = '' + mkdir -p $out/bin $out/share/udptunnel + cp udptunnel $out/bin + cp README COPYING* $out/share/udptunnel + ''; + + meta = { + homepage = "https://code.google.com/archive/p/udptunnel/"; + description = "Tunnels TCP over UDP packets"; + license = lib.licenses.gpl3Plus; + maintainers = with lib.maintainers; [viric]; + platforms = with lib.platforms; linux; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/uget-integrator/default.nix b/nixpkgs/pkgs/tools/networking/uget-integrator/default.nix new file mode 100644 index 000000000000..2d069ea07f02 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/uget-integrator/default.nix @@ -0,0 +1,39 @@ +{ lib, stdenv, fetchFromGitHub, uget, python3Packages }: + +stdenv.mkDerivation rec { + pname = "uget-integrator"; + version = "1.0.0"; + + src = fetchFromGitHub { + owner = "ugetdm"; + repo = "uget-integrator"; + rev = "v${version}"; + sha256 = "0bfqwbpprxp5sy49p2hqcjdfj7zamnp2hhcnnyccffkn7pghx8pp"; + }; + + nativeBuildInputs = [ python3Packages.wrapPython ]; + + buildInputs = [ uget python3Packages.python ]; + + installPhase = '' + for f in conf/com.ugetdm.{chrome,firefox}.json; do + substituteInPlace $f --replace "/usr" "$out" + done + + install -D -t $out/bin bin/uget-integrator + install -D -t $out/etc/opt/chrome/native-messaging-hosts conf/com.ugetdm.chrome.json + install -D -t $out/etc/chromium/native-messaging-hosts conf/com.ugetdm.chrome.json + install -D -t $out/etc/opera/native-messaging-hosts conf/com.ugetdm.chrome.json + install -D -t $out/lib/mozilla/native-messaging-hosts conf/com.ugetdm.firefox.json + + wrapPythonPrograms + ''; + + meta = with lib; { + description = "Native messaging host to integrate uGet Download Manager with web browsers"; + homepage = "https://github.com/ugetdm/uget-integrator"; + license = licenses.gpl3; + platforms = platforms.linux; + maintainers = [ maintainers.romildo ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/uget/default.nix b/nixpkgs/pkgs/tools/networking/uget/default.nix new file mode 100644 index 000000000000..2bece5e30dd7 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/uget/default.nix @@ -0,0 +1,50 @@ +{ lib, stdenv, fetchurl, pkg-config, intltool, openssl, curl, libnotify, + libappindicator-gtk3, gst_all_1, gtk3, dconf, wrapGAppsHook, aria2 ? null +}: + +stdenv.mkDerivation rec { + pname = "uget"; + version = "2.2.3-1"; + + src = fetchurl { + url = "mirror://sourceforge/urlget/${pname}-${version}.tar.gz"; + sha256 = "0jchvgkkphhwp2z7vd4axxr9ns8b6vqc22b2z8a906qm8916wd8i"; + }; + + nativeBuildInputs = [ + pkg-config + intltool + wrapGAppsHook + ]; + + buildInputs = [ + openssl + curl + libnotify + libappindicator-gtk3 + gtk3 + (lib.getLib dconf) + ] + ++ (with gst_all_1; [ gstreamer gst-plugins-base gst-plugins-good ]) + ++ (lib.optional (aria2 != null) aria2); + + enableParallelBuilding = true; + + preFixup = lib.optionalString (aria2 != null) + ''gappsWrapperArgs+=(--suffix PATH : "${aria2}/bin")''; + + meta = with lib; { + description = "Download manager using GTK and libcurl"; + longDescription = '' + uGet is a VERY Powerful download manager application with a large + inventory of features but is still very light-weight and low on + resources, so don't let the impressive list of features scare you into + thinking that it "might be too powerful" because remember power is good + and lightweight power is uGet! + ''; + homepage = "http://www.ugetdm.com"; + license = licenses.lgpl21; + platforms = platforms.unix; + maintainers = with maintainers; [ romildo ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/unbound/default.nix b/nixpkgs/pkgs/tools/networking/unbound/default.nix new file mode 100644 index 000000000000..a0c774fb7341 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/unbound/default.nix @@ -0,0 +1,93 @@ +{ stdenv +, lib +, fetchurl +, openssl +, nettle +, expat +, libevent +, dns-root-data +, pkg-config +, makeWrapper + # + # By default unbound will not be built with systemd support. Unbound is a very + # commmon dependency. The transitive dependency closure of systemd also + # contains unbound. + # Since most (all?) (lib)unbound users outside of the unbound daemon usage do + # not need the systemd integration it is likely best to just default to no + # systemd integration. + # For the daemon use-case, that needs to notify systemd, use `unbound-with-systemd`. + # +, withSystemd ? false +, systemd ? null + # optionally support DNS-over-HTTPS as a server +, withDoH ? false +, libnghttp2 +}: + +stdenv.mkDerivation rec { + pname = "unbound"; + version = "1.13.1"; + + src = fetchurl { + url = "https://unbound.net/downloads/${pname}-${version}.tar.gz"; + sha256 = "sha256-hQTZe4/FvYlzRcldEW4O4N34yP+ZWQqytL0TJ4yfULg="; + }; + + outputs = [ "out" "lib" "man" ]; # "dev" would only split ~20 kB + + nativeBuildInputs = [ makeWrapper ]; + + buildInputs = [ openssl nettle expat libevent ] + ++ lib.optionals withSystemd [ pkg-config systemd ] + ++ lib.optionals withDoH [ libnghttp2 ]; + + configureFlags = [ + "--with-ssl=${openssl.dev}" + "--with-libexpat=${expat.dev}" + "--with-libevent=${libevent.dev}" + "--localstatedir=/var" + "--sysconfdir=/etc" + "--sbindir=\${out}/bin" + "--with-rootkey-file=${dns-root-data}/root.key" + "--enable-pie" + "--enable-relro-now" + ] ++ lib.optional stdenv.hostPlatform.isStatic [ + "--disable-flto" + ] ++ lib.optionals withSystemd [ + "--enable-systemd" + ] ++ lib.optionals withDoH [ + "--with-libnghttp2=${libnghttp2.dev}" + ]; + + installFlags = [ "configfile=\${out}/etc/unbound/unbound.conf" ]; + + postInstall = '' + make unbound-event-install + wrapProgram $out/bin/unbound-control-setup \ + --prefix PATH : ${lib.makeBinPath [ openssl ]} + ''; + + preFixup = lib.optionalString (stdenv.isLinux && !stdenv.hostPlatform.isMusl) # XXX: revisit + # Build libunbound again, but only against nettle instead of openssl. + # This avoids gnutls.out -> unbound.lib -> openssl.out. + # There was some problem with this on Darwin; let's not complicate non-Linux. + '' + configureFlags="$configureFlags --with-nettle=${nettle.dev} --with-libunbound-only" + configurePhase + buildPhase + installPhase + '' + # get rid of runtime dependencies on $dev outputs + + ''substituteInPlace "$lib/lib/libunbound.la" '' + + lib.concatMapStrings + (pkg: lib.optionalString (pkg ? dev) " --replace '-L${pkg.dev}/lib' '-L${pkg.out}/lib' --replace '-R${pkg.dev}/lib' '-R${pkg.out}/lib'") + (builtins.filter (p: p != null) buildInputs); + + meta = with lib; { + description = "Validating, recursive, and caching DNS resolver"; + license = licenses.bsd3; + homepage = "https://www.unbound.net"; + maintainers = with maintainers; [ ehmry fpletz globin ]; + platforms = platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/unbound/python.nix b/nixpkgs/pkgs/tools/networking/unbound/python.nix new file mode 100644 index 000000000000..fcfd93be4d67 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/unbound/python.nix @@ -0,0 +1,65 @@ +{ lib, stdenv, fetchurl, openssl, expat, libevent, swig, pythonPackages }: + +let + inherit (pythonPackages) python; +in stdenv.mkDerivation rec { + pname = "pyunbound"; + version = "1.9.3"; + + src = fetchurl { + url = "http://unbound.net/downloads/unbound-${version}.tar.gz"; + sha256 = "1ykdy62sgzv33ggkmzwx2h0ifm7hyyxyfkb4zckv7gz4f28xsm8v"; + }; + + buildInputs = [ openssl expat libevent swig python ]; + + patchPhase = ''substituteInPlace Makefile.in \ + --replace "\$(DESTDIR)\$(PYTHON_SITE_PKG)" "$out/${python.sitePackages}" \ + --replace "\$(LIBTOOL) --mode=install cp _unbound.la" "cp _unbound.la" + ''; + + preConfigure = "export PYTHON_VERSION=${python.pythonVersion}"; + + configureFlags = [ + "--with-ssl=${openssl.dev}" + "--with-libexpat=${expat.dev}" + "--with-libevent=${libevent.dev}" + "--localstatedir=/var" + "--sysconfdir=/etc" + "--sbindir=\${out}/bin" + "--enable-pie" + "--enable-relro-now" + "--with-pyunbound" + "DESTDIR=$out PREFIX=" + ]; + + preInstall = '' + mkdir -p $out/${python.sitePackages} $out/etc/${pname} + cp .libs/_unbound.so .libs/libunbound.so* $out/${python.sitePackages} + substituteInPlace _unbound.la \ + --replace "-L.libs $PWD/libunbound.la" "-L$out/${python.sitePackages}" \ + --replace "libdir=\'$PWD/${python.sitePackages}\'" "libdir=\'$out/${python.sitePackages}\'" + ''; + + installFlags = [ "configfile=\${out}/etc/unbound/unbound.conf pyunbound-install lib" ]; + + # All we want is the Unbound Python module + postInstall = '' + # Generate the built in root anchor and root key and store these in a logical place + # to be used by tools depending only on the Python module + $out/bin/unbound-anchor -l | head -1 > $out/etc/${pname}/root.anchor + $out/bin/unbound-anchor -l | tail --lines=+2 - > $out/etc/${pname}/root.key + # We don't need anything else + rm -fR $out/bin $out/share $out/include $out/etc/unbound + patchelf --replace-needed libunbound.so.2 $out/${python.sitePackages}/libunbound.so.2 $out/${python.sitePackages}/_unbound.so + ''; + + meta = with lib; { + description = "Python library for Unbound, the validating, recursive, and caching DNS resolver"; + license = licenses.bsd3; + homepage = "http://www.unbound.net"; + maintainers = with maintainers; [ leenaars ]; + platforms = lib.platforms.unix; + broken = true; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/uqmi/default.nix b/nixpkgs/pkgs/tools/networking/uqmi/default.nix new file mode 100644 index 000000000000..17a55d86b9a3 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/uqmi/default.nix @@ -0,0 +1,28 @@ +{ stdenv, lib, fetchgit, cmake, perl, libubox, json_c }: + +stdenv.mkDerivation { + pname = "uqmi"; + version = "unstable-2019-06-27"; + + src = fetchgit { + url = "https://git.openwrt.org/project/uqmi.git"; + rev = "1965c713937495a5cb029165c16acdb6572c3f87"; + sha256 = "1gn8sdcl4lwfs3lwabmnjbvdhhk1l42bwbajwds7j4936fpbklx0"; + }; + + postPatch = '' + substituteInPlace data/gen-header.pl --replace /usr/bin/env "" + patchShebangs . + ''; + + nativeBuildInputs = [ cmake perl ]; + buildInputs = [ libubox json_c ]; + + meta = with lib; { + description = "Tiny QMI command line utility"; + homepage = "https://git.openwrt.org/?p=project/uqmi.git;a=summary"; + license = licenses.gpl2Plus; + platforms = platforms.all; + maintainers = with maintainers; [ fpletz ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/urlwatch/default.nix b/nixpkgs/pkgs/tools/networking/urlwatch/default.nix new file mode 100644 index 000000000000..b1a374f0349d --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/urlwatch/default.nix @@ -0,0 +1,41 @@ +{ lib +, fetchFromGitHub +, python3Packages +}: + +python3Packages.buildPythonApplication rec { + pname = "urlwatch"; + version = "2.23"; + + src = fetchFromGitHub { + owner = "thp"; + repo = "urlwatch"; + rev = version; + sha256 = "1ryygy7lalmwnv9kc8q4920gkdx878izy33a5dgxb780sy2qq8pg"; + }; + + propagatedBuildInputs = with python3Packages; [ + appdirs + cssselect + keyring + lxml + markdown2 + matrix-client + minidb + pushbullet + pycodestyle + pyppeteer + pyyaml + requests + ]; + + # no tests + doCheck = false; + + meta = with lib; { + description = "A tool for monitoring webpages for updates"; + homepage = "https://thp.io/2008/urlwatch/"; + license = licenses.bsd3; + maintainers = with maintainers; [ kmein tv ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/uwimap/default.nix b/nixpkgs/pkgs/tools/networking/uwimap/default.nix new file mode 100644 index 000000000000..e675268163ac --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/uwimap/default.nix @@ -0,0 +1,62 @@ +{ lib, stdenv, fetchurl, fetchpatch, pam, openssl }: + +stdenv.mkDerivation ({ + name = "uw-imap-2007f"; + + src = fetchurl { + url = "ftp://ftp.cac.washington.edu/imap/imap-2007f.tar.gz"; + sha256 = "0a2a00hbakh0640r2wdpnwr8789z59wnk7rfsihh3j0vbhmmmqak"; + }; + + makeFlags = [ (if stdenv.isDarwin + then "osx" + else "lnp") ] # Linux with PAM modules; + # -fPIC is required to compile php with imap on x86_64 systems + ++ lib.optional stdenv.isx86_64 "EXTRACFLAGS=-fPIC" + ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ "CC=${stdenv.hostPlatform.config}-gcc" "RANLIB=${stdenv.hostPlatform.config}-ranlib" ]; + + hardeningDisable = [ "format" ]; + + buildInputs = [ openssl ] + ++ lib.optional (!stdenv.isDarwin) pam; + + patches = [ (fetchpatch { + url = "https://salsa.debian.org/holmgren/uw-imap/raw/dcb42981201ea14c2d71c01ebb4a61691b6f68b3/debian/patches/1006_openssl1.1_autoverify.patch"; + sha256 = "09xb58awvkhzmmjhrkqgijzgv7ia381ablf0y7i1rvhcqkb5wga7"; + }) ]; + + postPatch = '' + sed -i src/osdep/unix/Makefile -e 's,/usr/local/ssl,${openssl.dev},' + sed -i src/osdep/unix/Makefile -e 's,^SSLCERTS=.*,SSLCERTS=/etc/ssl/certs,' + sed -i src/osdep/unix/Makefile -e 's,^SSLLIB=.*,SSLLIB=${openssl.out}/lib,' + ''; + + NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin + "-I${openssl.dev}/include/openssl"; + + installPhase = '' + mkdir -p $out/bin $out/lib $out/include/c-client + cp c-client/*.h osdep/unix/*.h c-client/linkage.c c-client/auths.c $out/include/c-client/ + cp c-client/c-client.a $out/lib/libc-client.a + cp mailutil/mailutil imapd/imapd dmail/dmail mlock/mlock mtest/mtest tmail/tmail \ + tools/{an,ua} $out/bin + ''; + + meta = { + homepage = "https://www.washington.edu/imap/"; + description = "UW IMAP toolkit - IMAP-supporting software developed by the UW"; + license = lib.licenses.asl20; + platforms = with lib.platforms; linux; + }; + + passthru = { + withSSL = true; + }; +} // lib.optionalAttrs (stdenv.buildPlatform != stdenv.hostPlatform) { + # This is set here to prevent rebuilds on native compilation. + # Configure phase is a no-op there, because this package doesn't use ./configure scripts. + configurePhase = '' + echo "Cross-compilation, injecting make flags" + makeFlagsArray+=("ARRC=${stdenv.hostPlatform.config}-ar rc") + ''; +}) diff --git a/nixpkgs/pkgs/tools/networking/v2ray/default.nix b/nixpkgs/pkgs/tools/networking/v2ray/default.nix new file mode 100644 index 000000000000..4c4b46c25206 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/v2ray/default.nix @@ -0,0 +1,89 @@ +{ lib, fetchFromGitHub, fetchurl, linkFarm, buildGoModule, runCommand, makeWrapper, nixosTests +, assetOverrides ? {} +}: + +let + version = "4.39.2"; + + src = fetchFromGitHub { + owner = "v2fly"; + repo = "v2ray-core"; + rev = "v${version}"; + sha256 = "0rgwxsix2qy5w44s2ramalsn1bqznj2yra8bakcms8yl9yh0gbvd"; + }; + + vendorSha256 = "sha256-1LEKg9kyF4QBrzLP5TyKmFLPBprJRNqGxtkAI1mHx4Y="; + + assets = { + # MIT licensed + "geoip.dat" = let + geoipRev = "202105270041"; + geoipSha256 = "0g67lggc41himpnbbghm4xlnbv4dl2fyidxplh3pl6ajqb4wxwd5"; + in fetchurl { + url = "https://github.com/v2fly/geoip/releases/download/${geoipRev}/geoip.dat"; + sha256 = geoipSha256; + }; + + # MIT licensed + "geosite.dat" = let + geositeRev = "20210527065138"; + geositeSha256 = "1335zyc5zrwws46ldv0sqn51kpkfwfksbfw6hd53fakz0whxki0g"; + in fetchurl { + url = "https://github.com/v2fly/domain-list-community/releases/download/${geositeRev}/dlc.dat"; + sha256 = geositeSha256; + }; + + } // assetOverrides; + + assetsDrv = linkFarm "v2ray-assets" (lib.mapAttrsToList (name: path: { + inherit name path; + }) assets); + + core = buildGoModule rec { + pname = "v2ray-core"; + inherit version src; + + inherit vendorSha256; + + doCheck = false; + + buildPhase = '' + buildFlagsArray=(-v -p $NIX_BUILD_CORES -ldflags="-s -w") + runHook preBuild + go build "''${buildFlagsArray[@]}" -o v2ray ./main + go build "''${buildFlagsArray[@]}" -o v2ctl -tags confonly ./infra/control/main + runHook postBuild + ''; + + installPhase = '' + install -Dm755 v2ray v2ctl -t $out/bin + ''; + + meta = { + homepage = "https://www.v2fly.org/en_US/"; + description = "A platform for building proxies to bypass network restrictions"; + license = with lib.licenses; [ mit ]; + maintainers = with lib.maintainers; [ servalcatty ]; + }; + }; + +in runCommand "v2ray-${version}" { + inherit src version; + inherit (core) meta; + + nativeBuildInputs = [ makeWrapper ]; + + passthru = { + inherit core; + updateScript = ./update.sh; + tests = { + simple-vmess-proxy-test = nixosTests.v2ray; + }; + }; + +} '' + for file in ${core}/bin/*; do + makeWrapper "$file" "$out/bin/$(basename "$file")" \ + --set-default V2RAY_LOCATION_ASSET ${assetsDrv} + done +'' diff --git a/nixpkgs/pkgs/tools/networking/v2ray/update.sh b/nixpkgs/pkgs/tools/networking/v2ray/update.sh new file mode 100755 index 000000000000..f645b8ea0939 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/v2ray/update.sh @@ -0,0 +1,71 @@ +#!/usr/bin/env nix-shell +#!nix-shell -i bash -p curl jq +set -eo pipefail +cd "$(dirname "${BASH_SOURCE[0]}")" + +version_nix=./default.nix +deps_nix=./deps.nix +nixpkgs=../../../.. + +old_core_rev=$(sed -En 's/.*\bversion = "(.*?)".*/\1/p' "$version_nix") +old_geoip_rev=$(sed -En 's/.*\bgeoipRev = "(.*?)".*/\1/p' "$version_nix") +old_geosite_rev=$(sed -En 's/.*\bgeositeRev = "(.*?)".*/\1/p' "$version_nix") +echo "Current version:" >&2 +echo "core: $old_core_rev, geoip: $old_geoip_rev, geosite: $old_geosite_rev" >&2 + +function fetch_latest_rev { + curl "https://api.github.com/repos/v2fly/$1/releases" | + jq '.[0].tag_name' --raw-output +} + +core_rev=$(fetch_latest_rev 'v2ray-core') +core_rev=${core_rev:1} +geoip_rev=$(fetch_latest_rev 'geoip') +geosite_rev=$(fetch_latest_rev 'domain-list-community') +echo "Latest version:" >&2 +echo "core: $core_rev, geoip: $geoip_rev, geosite: $geosite_rev" >&2 + +if [[ $core_rev != $old_core_rev ]]; then + echo "Prefetching core..." >&2 + { read hash; read store_path; } < <( + nix-prefetch-url --unpack --print-path "https://github.com/v2fly/v2ray-core/archive/v$core_rev.zip" + ) + + sed --in-place \ + -e "s/\bversion = \".*\"/version = \"$core_rev\"/" \ + -e "s/\bsha256 = \".*\"/sha256 = \"$hash\"/" \ + -e "s/\bvendorSha256 = \".*\"/vendorSha256 = \"0000000000000000000000000000000000000000000000000000\"/" \ + "$version_nix" +fi + +if [[ $geoip_rev != $old_geoip_rev ]]; then + echo "Prefetching geoip..." >&2 + hash=$(nix-prefetch-url "https://github.com/v2fly/geoip/releases/download/$geoip_rev/geoip.dat") + sed --in-place \ + -e "s/\bgeoipRev = \".*\"/geoipRev = \"$geoip_rev\"/" \ + -e "s/\bgeoipSha256 = \".*\"/geoipSha256 = \"$hash\"/" \ + "$version_nix" +fi + +if [[ $geosite_rev != $old_geosite_rev ]]; then + echo "Prefetching geosite..." >&2 + hash=$(nix-prefetch-url "https://github.com/v2fly/domain-list-community/releases/download/$geosite_rev/dlc.dat") + sed --in-place \ + -e "s/\bgeositeRev = \".*\"/geositeRev = \"$geosite_rev\"/" \ + -e "s/\bgeositeSha256 = \".*\"/geositeSha256 = \"$hash\"/" \ + "$version_nix" +fi + +echo "Prebuilding..." >&2 +set +o pipefail +vendorSha256=$( + nix-build "$nixpkgs" -A v2ray --no-out-link 2>&1 | + tee /dev/stderr | + sed -nE 's/.*got:\s*(sha256\S+)$/\1/p' +) +[[ "$vendorSha256" ]] +sed --in-place \ + -e "s#vendorSha256 = \".*\"#vendorSha256 = \"$vendorSha256\"#" \ + "$version_nix" + +echo "vendorSha256 updated" >&2 diff --git a/nixpkgs/pkgs/tools/networking/vde2/default.nix b/nixpkgs/pkgs/tools/networking/vde2/default.nix new file mode 100644 index 000000000000..bc3be9122652 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/vde2/default.nix @@ -0,0 +1,42 @@ +{ lib, stdenv, fetchurl, fetchpatch, openssl, libpcap, python2, withPython ? false }: + +stdenv.mkDerivation rec { + name = "vde2-2.3.2"; + + src = fetchurl { + url = "mirror://sourceforge/vde/vde2/2.3.1/${name}.tar.gz"; + sha256 = "14xga0ib6p1wrv3hkl4sa89yzjxv7f1vfqaxsch87j6scdm59pr2"; + }; + + patches = [ + # Fix build with openssl 1.1.0 + (fetchpatch { + name = "vde_cryptcab-compile-against-openssl-1.1.0.patch"; + url = "https://git.archlinux.org/svntogit/packages.git/plain/trunk/vde_cryptcab-compile-against-openssl-1.1.0.patch?h=packages/vde2&id=15b11be49997fa94b603e366064690b7cc6bce61"; + sha256 = "07z1yabwigq35mkwzqa934n7vjnjlqz5xfzq8cfj87lgyjjp00qi"; + }) + ] ++ lib.optional stdenv.hostPlatform.isMusl [ + (fetchpatch { + url = "https://git.alpinelinux.org/aports/plain/main/vde2/musl-build-fix.patch?id=ddee2f86a48e087867d4a2c12849b2e3baccc238"; + sha256 = "0b5382v541bkxhqylilcy34bh83ag96g71f39m070jzvi84kx8af"; + }) + ]; + + preConfigure = lib.optionalString (lib.versionAtLeast stdenv.hostPlatform.darwinMinVersion "11") '' + MACOSX_DEPLOYMENT_TARGET=10.16 + ''; + + configureFlags = lib.optional (!withPython) "--disable-python"; + + buildInputs = [ openssl libpcap ] + ++ lib.optional withPython python2; + + hardeningDisable = [ "format" ]; + + meta = with lib; { + homepage = "https://github.com/virtualsquare/vde-2"; + description = "Virtual Distributed Ethernet, an Ethernet compliant virtual network"; + platforms = platforms.unix; + license = licenses.gpl2; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/vegeta/default.nix b/nixpkgs/pkgs/tools/networking/vegeta/default.nix new file mode 100644 index 000000000000..16abe8c60335 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/vegeta/default.nix @@ -0,0 +1,25 @@ +{ lib, fetchFromGitHub, buildGoPackage }: + +buildGoPackage rec { + pname = "vegeta"; + version = "12.8.4"; + + src = fetchFromGitHub { + owner = "tsenart"; + repo = pname; + rev = "v${version}"; + sha256 = "0sw10k4g370c544dgw2c1sqdnxryld8lf6c1wnyknrm3zsfzn1hl"; + }; + + goPackagePath = "github.com/tsenart/${pname}"; + + goDeps = ./deps.nix; + + meta = with lib; { + description = "Versatile HTTP load testing tool"; + license = licenses.mit; + homepage = "https://github.com/tsenart/vegeta/"; + maintainers = [ maintainers.mmahut ]; + }; +} + diff --git a/nixpkgs/pkgs/tools/networking/vegeta/deps.nix b/nixpkgs/pkgs/tools/networking/vegeta/deps.nix new file mode 100644 index 000000000000..1a06ad178ec4 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/vegeta/deps.nix @@ -0,0 +1,255 @@ +# file generated from go.mod using vgo2nix (https://github.com/adisbladis/vgo2nix) +[ + { + goPackagePath = "github.com/alecthomas/jsonschema"; + fetch = { + type = "git"; + url = "https://github.com/alecthomas/jsonschema"; + rev = "f2c93856175a"; + sha256 = "145w6zg453mbspfyixs71xfjwi3djq20lij1rcgrdcn5gmwj2cal"; + }; + } + { + goPackagePath = "github.com/bmizerany/perks"; + fetch = { + type = "git"; + url = "https://github.com/bmizerany/perks"; + rev = "d9a9656a3a4b"; + sha256 = "0f39b3zfm1zd6xcvlm6szgss026qs84n2j9y5bnb3zxzdkxb9w9n"; + }; + } + { + goPackagePath = "github.com/c2h5oh/datasize"; + fetch = { + type = "git"; + url = "https://github.com/c2h5oh/datasize"; + rev = "4eba002a5eae"; + sha256 = "02sxd659q7m7axfywiqfxk5rh6djh2m5240bin1makldj1nj16j3"; + }; + } + { + goPackagePath = "github.com/dgryski/go-gk"; + fetch = { + type = "git"; + url = "https://github.com/dgryski/go-gk"; + rev = "201884a44051"; + sha256 = "17csmdlqibg5g2pjybh4522dis6nklyhjvly55pawy0vprd17agz"; + }; + } + { + goPackagePath = "github.com/dgryski/go-lttb"; + fetch = { + type = "git"; + url = "https://github.com/dgryski/go-lttb"; + rev = "318fcdf10a77"; + sha256 = "0cs2rr2j6fbbpgmfxkq39pir4bibfzkfwxvd2cvw30q97cmfpiz3"; + }; + } + { + goPackagePath = "github.com/gonum/blas"; + fetch = { + type = "git"; + url = "https://github.com/gonum/blas"; + rev = "f22b278b28ac"; + sha256 = "0dh73akv4gazyhva9xbm9xbq786vij8iisivp3p65p6ahf502fs6"; + }; + } + { + goPackagePath = "github.com/gonum/diff"; + fetch = { + type = "git"; + url = "https://github.com/gonum/diff"; + rev = "500114f11e71"; + sha256 = "1bg4k3bxqb44nz1nmyigr5bx55859n55vvi45w2rq4y5djvpral8"; + }; + } + { + goPackagePath = "github.com/gonum/floats"; + fetch = { + type = "git"; + url = "https://github.com/gonum/floats"; + rev = "c233463c7e82"; + sha256 = "12m7pa64mk3am2i10agg6c1aqdfgx9i3f4bgf3w7wra8bnnjncp6"; + }; + } + { + goPackagePath = "github.com/gonum/integrate"; + fetch = { + type = "git"; + url = "https://github.com/gonum/integrate"; + rev = "a422b5c0fdf2"; + sha256 = "01wfav882h3bcp137cd2bsr91hkmmi4d6qwhdm0xv1p2z2qzs7iq"; + }; + } + { + goPackagePath = "github.com/gonum/internal"; + fetch = { + type = "git"; + url = "https://github.com/gonum/internal"; + rev = "f884aa714029"; + sha256 = "038w8pc82vxq773qg0mw472f3p8h5vkh3ggcdn09qd3s6myp2zq7"; + }; + } + { + goPackagePath = "github.com/gonum/lapack"; + fetch = { + type = "git"; + url = "https://github.com/gonum/lapack"; + rev = "e4cdc5a0bff9"; + sha256 = "046fffskysg0bmha16s5582bimpis0m6qd7c7k1n65a0qhrslli1"; + }; + } + { + goPackagePath = "github.com/gonum/mathext"; + fetch = { + type = "git"; + url = "https://github.com/gonum/mathext"; + rev = "8a4bf007ea55"; + sha256 = "044xy32mgcjc5948na6f6fgqqq17canw3z6sppidmj52s17p0k7i"; + }; + } + { + goPackagePath = "github.com/gonum/matrix"; + fetch = { + type = "git"; + url = "https://github.com/gonum/matrix"; + rev = "c518dec07be9"; + sha256 = "0i6pyxxhcy2s9as77g90dsj9xya48775dl5fxgvqal665cxc4l4i"; + }; + } + { + goPackagePath = "github.com/gonum/stat"; + fetch = { + type = "git"; + url = "https://github.com/gonum/stat"; + rev = "41a0da705a5b"; + sha256 = "0r9mqiy3ma0c15p57bz4xq2vf105s9g1lqysb7ff0nip4050cpvn"; + }; + } + { + goPackagePath = "github.com/google/go-cmp"; + fetch = { + type = "git"; + url = "https://github.com/google/go-cmp"; + rev = "v0.2.0"; + sha256 = "1fbv0x27k9sn8svafc0hjwsnckk864lv4yi7bvzrxvmd3d5hskds"; + }; + } + { + goPackagePath = "github.com/influxdata/tdigest"; + fetch = { + type = "git"; + url = "https://github.com/influxdata/tdigest"; + rev = "a7d76c6f093a"; + sha256 = "02jxrb2d1n6zflwa7jhgid5344l6zj4gxg4kis20v7xa6iqrj1ni"; + }; + } + { + goPackagePath = "github.com/mailru/easyjson"; + fetch = { + type = "git"; + url = "https://github.com/mailru/easyjson"; + rev = "v0.7.0"; + sha256 = "13zv5fvjp3nr65lhqhiw6i6mlmqvyls882rlmcas0ab35alsxni8"; + }; + } + { + goPackagePath = "github.com/miekg/dns"; + fetch = { + type = "git"; + url = "https://github.com/miekg/dns"; + rev = "v1.1.17"; + sha256 = "0x0375n7n1qmgyn7yvpr65z4ll4l39q2xagyfafw09h3kkrkpka8"; + }; + } + { + goPackagePath = "github.com/streadway/quantile"; + fetch = { + type = "git"; + url = "https://github.com/streadway/quantile"; + rev = "b0c588724d25"; + sha256 = "1y27nrg7wkyrvw07a5s7wl4lpwxshwyvhzc6i0rzn20dajah2vkh"; + }; + } + { + goPackagePath = "github.com/tsenart/go-tsz"; + fetch = { + type = "git"; + url = "https://github.com/tsenart/go-tsz"; + rev = "cdeb9e1e981e"; + sha256 = "1lgnllx810ly0203jn9vkimcwqv3302mnh9d7mip1yyq4cmvlj3b"; + }; + } + { + goPackagePath = "golang.org/x/crypto"; + fetch = { + type = "git"; + url = "https://go.googlesource.com/crypto"; + rev = "9756ffdc2472"; + sha256 = "0q7hxaaq6lp0v8qqzifvysl47z5rfdlrxkh3d29vsl3wyby3dxl8"; + }; + } + { + goPackagePath = "golang.org/x/net"; + fetch = { + type = "git"; + url = "https://go.googlesource.com/net"; + rev = "ba9fcec4b297"; + sha256 = "1hbqvy6r0s5h0dpdqw8fynl3cq0acin3iyqki9xvl5r8h33yb9bx"; + }; + } + { + goPackagePath = "golang.org/x/sync"; + fetch = { + type = "git"; + url = "https://go.googlesource.com/sync"; + rev = "112230192c58"; + sha256 = "05i2k43j2d0llq768hg5pf3hb2yhfzp9la1w5wp0rsnnzblr0lfn"; + }; + } + { + goPackagePath = "golang.org/x/sys"; + fetch = { + type = "git"; + url = "https://go.googlesource.com/sys"; + rev = "749cb33beabd"; + sha256 = "0dm3257q3rv2kyn5lmqqim2fqg634v6rhrqq4glvbk4wx4l3v337"; + }; + } + { + goPackagePath = "golang.org/x/text"; + fetch = { + type = "git"; + url = "https://go.googlesource.com/text"; + rev = "v0.3.2"; + sha256 = "0flv9idw0jm5nm8lx25xqanbkqgfiym6619w575p7nrdh0riqwqh"; + }; + } + { + goPackagePath = "golang.org/x/tools"; + fetch = { + type = "git"; + url = "https://go.googlesource.com/tools"; + rev = "2ca718005c18"; + sha256 = "1nl4cw8vrfigab0hij86vl2mmhfmyim69r7vy5qk2v60g8frvgxg"; + }; + } + { + goPackagePath = "golang.org/x/xerrors"; + fetch = { + type = "git"; + url = "https://go.googlesource.com/xerrors"; + rev = "a985d3407aa7"; + sha256 = "00wzr5w8aadipgc3rkk8f11i41znskfj9ix5nhhaxyg7isrslgcj"; + }; + } + { + goPackagePath = "pgregory.net/rapid"; + fetch = { + type = "git"; + url = "https://github.com/flyingmutant/rapid"; + rev = "v0.3.3"; + sha256 = "04w4dmx753b2xp5z5br5wxalgkkgag8qpbxics2gdcksqgi85vg3"; + }; + } +] diff --git a/nixpkgs/pkgs/tools/networking/vlan/default.nix b/nixpkgs/pkgs/tools/networking/vlan/default.nix new file mode 100644 index 000000000000..2d329cb29b06 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/vlan/default.nix @@ -0,0 +1,33 @@ +{ lib, stdenv, fetchurl }: + +stdenv.mkDerivation { + name = "vlan-1.9"; + + src = fetchurl { + url = "mirror://gentoo/distfiles/vlan.1.9.tar.gz"; + sha256 = "1jjc5f26hj7bk8nkjxsa8znfxcf8pgry2ipnwmj2fr6ky0dhm3rv"; + }; + + hardeningDisable = [ "format" ]; + + preBuild = + '' + # Ouch, the tarball contains pre-compiled binaries. + make clean + ''; + + installPhase = + '' + mkdir -p $out/sbin + cp vconfig $out/sbin/ + + mkdir -p $out/share/man/man8 + cp vconfig.8 $out/share/man/man8/ + ''; + + meta = with lib; { + description = "User mode programs to enable VLANs on Ethernet devices"; + platforms = platforms.linux; + license = licenses.gpl2Plus; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/vpn-slice/default.nix b/nixpkgs/pkgs/tools/networking/vpn-slice/default.nix new file mode 100644 index 000000000000..9511c214c08c --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/vpn-slice/default.nix @@ -0,0 +1,25 @@ +{ lib, buildPythonApplication, python3Packages, fetchFromGitHub }: + +buildPythonApplication rec { + pname = "vpn-slice"; + version = "0.14"; + + src = fetchFromGitHub { + owner = "dlenski"; + repo = pname; + rev = "v${version}"; + sha256 = "1z2mdl3arzl95zrj4ir57f762gcimmmq5nk91j679cshxz4snxyr"; + }; + + propagatedBuildInputs = with python3Packages; [ setproctitle dnspython ]; + + doCheck = false; + + meta = with lib; { + homepage = "https://github.com/dlenski/vpn-slice"; + description = + "vpnc-script replacement for easy and secure split-tunnel VPN setup"; + license = licenses.gpl3; + maintainers = with maintainers; [ jdbaldry ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/vpnc/default.nix b/nixpkgs/pkgs/tools/networking/vpnc/default.nix new file mode 100644 index 000000000000..edb50559fc0f --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/vpnc/default.nix @@ -0,0 +1,58 @@ +{ lib, stdenv, fetchsvn, nettools, libgcrypt, openssl, openresolv, perl, gawk, makeWrapper }: + +stdenv.mkDerivation { + name = "vpnc-0.5.3-post-r550"; + src = fetchsvn { + url = "https://svn.unix-ag.uni-kl.de/vpnc"; + rev = "550"; + sha256 = "0x4ckfv9lpykwmh28v1kyzz91y1j2v48fi8q5nsawrba4q0wlrls"; + }; + + postUnpack = '' + mv $sourceRoot/trunk/* $sourceRoot/. + rm -r $sourceRoot/{trunk,branches,tags} + ''; + + patches = [ ./makefile.patch ./no_default_route_when_netmask.patch ]; + + # The `etc/vpnc/vpnc-script' script relies on `which' and on + # `ifconfig' as found in net-tools (not GNU Inetutils). + propagatedBuildInputs = [ nettools ]; + + nativeBuildInputs = [ makeWrapper ]; + buildInputs = [libgcrypt perl openssl ]; + + preConfigure = '' + sed -i 's|^#OPENSSL|OPENSSL|g' Makefile + + substituteInPlace "vpnc-script" \ + --replace "which" "type -P" \ + --replace "awk" "${gawk}/bin/awk" \ + --replace "/sbin/resolvconf" "${openresolv}/bin/resolvconf" + + substituteInPlace "config.c" \ + --replace "/etc/vpnc/vpnc-script" "$out/etc/vpnc/vpnc-script" + + substituteInPlace "pcf2vpnc" \ + --replace "/usr/bin/perl" "${perl}/bin/perl" + ''; + + postInstall = '' + for i in "$out/{bin,sbin}/"* + do + wrapProgram $i --prefix PATH : \ + "${nettools}/bin:${nettools}/sbin" + done + + mkdir -p $out/share/doc/vpnc + cp README nortel.txt ChangeLog $out/share/doc/vpnc/ + ''; + + meta = { + homepage = "https://www.unix-ag.uni-kl.de/~massar/vpnc/"; + description = "Virtual private network (VPN) client for Cisco's VPN concentrators"; + license = lib.licenses.gpl2Plus; + + platforms = lib.platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/vpnc/makefile.patch b/nixpkgs/pkgs/tools/networking/vpnc/makefile.patch new file mode 100644 index 000000000000..89a8cd6da952 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/vpnc/makefile.patch @@ -0,0 +1,22 @@ +--- vpnc-0.5.1.orig/Makefile 2008-02-10 22:22:43.000000000 +0100 ++++ vpnc-0.5.1/Makefile 2008-02-10 22:22:32.000000000 +0100 +@@ -20,8 +20,8 @@ + # $Id: Makefile 236 2007-09-05 20:40:59Z Joerg Mayer $ + + DESTDIR= +-PREFIX=/usr/local +-ETCDIR=/etc/vpnc ++PREFIX=$(out) ++ETCDIR=$(out)/etc/vpnc + BINDIR=$(PREFIX)/bin + SBINDIR=$(PREFIX)/sbin + MANDIR=$(PREFIX)/share/man +@@ -71,7 +71,7 @@ + $(CC) -o $@ $^ $(LDFLAGS) + + vpnc.8 : vpnc.8.template makeman.pl vpnc +- ./makeman.pl ++ perl makeman.pl + + cisco-decrypt : cisco-decrypt.o config.o supp.o sysdep.o vpnc-debug.o + $(CC) -o $@ $^ $(LDFLAGS) diff --git a/nixpkgs/pkgs/tools/networking/vpnc/no_default_route_when_netmask.patch b/nixpkgs/pkgs/tools/networking/vpnc/no_default_route_when_netmask.patch new file mode 100644 index 000000000000..fa12abe9b776 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/vpnc/no_default_route_when_netmask.patch @@ -0,0 +1,12 @@ +diff -uNr a/vpnc-script b/vpnc-script +--- a/vpnc-script 2015-09-06 13:19:11.408661526 +0200 ++++ b/vpnc-script 2015-09-06 14:47:40.260871556 +0200 +@@ -647,7 +647,7 @@ + echo "$i" | grep : >/dev/null || \ + set_network_route "$i" "255.255.255.255" "32" + done +- elif [ -n "$INTERNAL_IP4_ADDRESS" ]; then ++ elif [ -n "$INTERNAL_IP4_ADDRESS" -a -z "$INTERNAL_IP4_NETMASK" ]; then + set_default_route + fi + if [ -n "$CISCO_IPV6_SPLIT_INC" ]; then diff --git a/nixpkgs/pkgs/tools/networking/vtun/default.nix b/nixpkgs/pkgs/tools/networking/vtun/default.nix new file mode 100644 index 000000000000..4d79fdc9bc58 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/vtun/default.nix @@ -0,0 +1,36 @@ +{ lib, stdenv, fetchurl, fetchpatch, openssl, lzo, zlib, bison, flex }: + +stdenv.mkDerivation rec { + name = "vtun-3.0.4"; + + src = fetchurl { + url = "mirror://sourceforge/vtun/${name}.tar.gz"; + sha256 = "1fcqzn2bdjw31j1hvv6lg99v2phhszm29kp2xambxzp32mmxzy5b"; + }; + + patches = [ + (fetchpatch { url = "http://sources.debian.net/data/main/v/vtun/3.0.3-2.2/debian/patches/08-gcc5-inline.patch"; + sha256 = "18sys97v2hx6vac5zp3ld7sa6kz4izv3g9dnkm0lflbaxhym2vs1"; + }) + ]; + + postPatch = '' + sed -i -e 's/-m 755//' -e 's/-o root -g 0//' Makefile.in + sed -i '/strip/d' Makefile.in + ''; + buildInputs = [ lzo openssl zlib bison flex ]; + + configureFlags = [ + "--with-lzo-headers=${lzo}/include/lzo" + "--with-ssl-headers=${openssl.dev}/include/openssl" + "--with-blowfish-headers=${openssl.dev}/include/openssl" + ]; + + meta = with lib; { + description = "Virtual Tunnels over TCP/IP with traffic shaping, compression and encryption"; + homepage = "http://vtun.sourceforge.net/"; + license = licenses.gpl2; + platforms = platforms.linux; + maintainers = with maintainers; [ pSub ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/waitron/default.nix b/nixpkgs/pkgs/tools/networking/waitron/default.nix new file mode 100644 index 000000000000..8364cd5763dc --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/waitron/default.nix @@ -0,0 +1,30 @@ +# This file was generated by https://github.com/kamilchm/go2nix v1.3.0 +{ lib, buildGoPackage, fetchgit, fetchhg, fetchbzr, fetchsvn }: + +buildGoPackage rec { + name = "waitron-unstable-${version}"; + version = "2020-01-24"; + rev = "c96833619cbb0cf2bc71b1d7b534101e139cc6e6"; + + goPackagePath = "github.com/ns1/waitron"; + + src = fetchgit { + inherit rev; + url = "https://github.com/ns1/waitron"; + sha256 = "0lgw37iq1cvg3mqc94nzf0027mvv721ay8x6dw3fc814ww8a2hb6"; + }; + + patches = [ + ./staticfiles-directory.patch + ]; + + goDeps = ./deps.nix; + + meta = { + description = "A tool to manage network booting of machines"; + homepage = "https://github.com/ns1/waitron"; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ guibert ]; + platforms = lib.platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/waitron/deps.nix b/nixpkgs/pkgs/tools/networking/waitron/deps.nix new file mode 100644 index 000000000000..46369c783184 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/waitron/deps.nix @@ -0,0 +1,57 @@ +# This file was generated by https://github.com/kamilchm/go2nix v1.3.0 +[ + { + goPackagePath = "github.com/flosch/pongo2"; + fetch = { + type = "git"; + url = "https://github.com/flosch/pongo2"; + rev = "bbf5a6c351f4d4e883daa40046a404d7553e0a00"; + sha256 = "0yqh58phznnxakm64w82gawrpndb0r85vsd1s7h244qqrq7w4avq"; + }; + } + { + goPackagePath = "github.com/gorilla/handlers"; + fetch = { + type = "git"; + url = "https://github.com/gorilla/handlers"; + rev = "f08afc1876ad882db8074bcb8a4cc96107d3a5f4"; + sha256 = "1ysm6sw3jqa3h8pb5qpqgh44g91c23n3as277sh0vyp7282290jq"; + }; + } + { + goPackagePath = "github.com/juju/errors"; + fetch = { + type = "git"; + url = "https://github.com/juju/errors"; + rev = "d42613fe1ab9e303fc850e7a19fda2e8eeb6516e"; + sha256 = "0qggzzvh9lzlfk8ixlyw8bw645rh0lrjrd367505hhl6cg18v8yf"; + }; + } + { + goPackagePath = "github.com/julienschmidt/httprouter"; + fetch = { + type = "git"; + url = "https://github.com/julienschmidt/httprouter"; + rev = "8c9f31f047a304abedb5614d4a18a843cd5f4a40"; + sha256 = "00f5ja1yslrjclx3sf29mzpcsrpfd15kkw5ygv7n4jsyb4v3xgj6"; + }; + } + { + goPackagePath = "github.com/satori/go.uuid"; + fetch = { + type = "git"; + url = "https://github.com/satori/go.uuid"; + rev = "b2ce2384e17bbe0c6d34077efa39dbab3e09123b"; + sha256 = "1yz4cx02377ijlf8mnn84j1dcmlwh8ncx7y3kw1zg2qw0z4x119c"; + }; + } + { + goPackagePath = "gopkg.in/yaml.v2"; + fetch = { + type = "git"; + url = "https://gopkg.in/yaml.v2"; + rev = "53403b58ad1b561927d19068c655246f2db79d48"; + sha256 = "1inf7svydzscwv9fcjd2rm61a4xjk6jkswknybmns2n58shimapw"; + }; + } +] diff --git a/nixpkgs/pkgs/tools/networking/waitron/staticfiles-directory.patch b/nixpkgs/pkgs/tools/networking/waitron/staticfiles-directory.patch new file mode 100644 index 000000000000..b1096487fac1 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/waitron/staticfiles-directory.patch @@ -0,0 +1,13 @@ +diff --git a/main.go b/main.go +index 4046911..a126bae 100644 +--- a/main.go ++++ b/main.go +@@ -411,7 +411,7 @@ func main() { + + if configuration.StaticFilesPath != "" { + fs := http.FileServer(http.Dir(configuration.StaticFilesPath)) +- r.Handler("GET", "/files/:filename", http.StripPrefix("/files/", fs)) ++ r.Handler("GET", "/files/*filepath", http.StripPrefix("/files/", fs)) + log.Println("Serving static files from " + configuration.StaticFilesPath) + } + diff --git a/nixpkgs/pkgs/tools/networking/wakelan/default.nix b/nixpkgs/pkgs/tools/networking/wakelan/default.nix new file mode 100644 index 000000000000..96e01141c180 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/wakelan/default.nix @@ -0,0 +1,29 @@ +{ lib, stdenv, fetchurl }: + +stdenv.mkDerivation rec { + name = "wakelan-1.1"; + + src = fetchurl { + url = "mirror://metalab/system/network/misc/${name}.tar.gz"; + sha256 = "0vydqpf44146ir6k87gmqaq6xy66xhc1gkr3nsd7jj3nhy7ypx9x"; + }; + + preInstall = '' + mkdir -p $out/man/man1 $out/bin + ''; + + meta = { + description = "Send a wake-on-lan packet"; + + longDescription = + '' WakeLan sends a properly formatted UDP packet across the + network which will cause a wake-on-lan enabled computer to + power on. + ''; + + license = lib.licenses.gpl2Plus; + + maintainers = [ lib.maintainers.viric ]; + platforms = lib.platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/wakeonlan/default.nix b/nixpkgs/pkgs/tools/networking/wakeonlan/default.nix new file mode 100644 index 000000000000..48b99cadf2b9 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/wakeonlan/default.nix @@ -0,0 +1,29 @@ +{ lib, perlPackages, fetchFromGitHub, installShellFiles }: + +perlPackages.buildPerlPackage rec { + pname = "wakeonlan"; + version = "0.41"; + + src = fetchFromGitHub { + owner = "jpoliv"; + repo = pname; + rev = "wakeonlan-${version}"; + sha256 = "0m48b39lz0yc5ckx2jx8y2p4c8npjngxl9wy86k43xgsd8mq1g3c"; + }; + + outputs = [ "out" ]; + + nativeBuildInputs = [ installShellFiles ]; + + installPhase = '' + install -Dt $out/bin wakeonlan + installManPage blib/man1/wakeonlan.1 + ''; + + meta = with lib; { + description = "Perl script for waking up computers via Wake-On-LAN magic packets"; + homepage = "https://github.com/jpoliv/wakeonlan"; + license = licenses.artistic1; + maintainers = with maintainers; [ SuperSandro2000 ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/wavemon/default.nix b/nixpkgs/pkgs/tools/networking/wavemon/default.nix new file mode 100644 index 000000000000..19bfd6ae4547 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/wavemon/default.nix @@ -0,0 +1,25 @@ +{ lib, stdenv, fetchFromGitHub, ncurses, libnl, pkg-config }: + +stdenv.mkDerivation rec { + pname = "wavemon"; + version = "0.9.3"; + + nativeBuildInputs = [ pkg-config ]; + buildInputs = [ ncurses libnl ]; + + src = fetchFromGitHub { + owner = "uoaerg"; + repo = "wavemon"; + rev = "v${version}"; + sha256 = "0m9n5asjxs1ir5rqprigqcrm976mgjvh4yql1jhfnbszwbf95193"; + }; + + meta = with lib; { + inherit version; + description = "Ncurses-based monitoring application for wireless network devices"; + homepage = "https://github.com/uoaerg/wavemon"; + license = licenses.gpl3Plus; + maintainers = with maintainers; [ raskin fpletz ]; + platforms = lib.platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/wbox/default.nix b/nixpkgs/pkgs/tools/networking/wbox/default.nix new file mode 100644 index 000000000000..3a5fce6808f8 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/wbox/default.nix @@ -0,0 +1,22 @@ +{ lib, stdenv, fetchurl }: + +stdenv.mkDerivation rec { + pname = "wbox"; + version = "5"; + + installPhase = '' + install -vD wbox "$out/bin/wbox" + ''; + + src = fetchurl { + url = "http://www.hping.org/wbox/${pname}-${version}.tar.gz"; + sha256 = "06daxwbysppvbh1mwprw8fgsp6mbd3kqj7a978w7ivn8hdgdi28m"; + }; + + meta = { + description = "A simple HTTP benchmarking tool"; + homepage = "http://www.hping.org/wbox/"; + license = lib.licenses.bsd3; + platforms = lib.platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/webalizer/default.nix b/nixpkgs/pkgs/tools/networking/webalizer/default.nix new file mode 100644 index 000000000000..332d1cf2867f --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/webalizer/default.nix @@ -0,0 +1,31 @@ +{ lib, stdenv, fetchurl, zlib, libpng, gd, geoip, db }: + +stdenv.mkDerivation { + name = "webalizer-2.23-05"; + + src = fetchurl { + url = "ftp://ftp.mrunix.net/pub/webalizer/webalizer-2.23-05-src.tar.bz2"; + sha256 = "0nl88y57a7gawfragj3viiigfkh5sgivfb4n0k89wzcjw278pj5g"; + }; + + preConfigure = + '' + substituteInPlace ./configure \ + --replace "--static" "" + ''; + + buildInputs = [zlib libpng gd geoip db]; + + configureFlags = [ + "--enable-dns" + "--enable-geoip" + "--enable-shared" + ]; + + meta = with lib; { + description = "Web server log file analysis program"; + homepage = "http://www.webalizer.org"; + platforms = platforms.unix; + license = licenses.gpl2; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/webwormhole/default.nix b/nixpkgs/pkgs/tools/networking/webwormhole/default.nix new file mode 100644 index 000000000000..8fbaf3159a22 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/webwormhole/default.nix @@ -0,0 +1,22 @@ +{ lib, buildGoModule, fetchFromGitHub }: + +buildGoModule rec { + pname = "webwormhole"; + version = "unstable-2021-01-16"; + + src = fetchFromGitHub { + owner = "saljam"; + repo = pname; + rev = "c85e196c8a8a885815136aa8aee1958ad80a3bb5"; + sha256 = "D10xmBwmEbeR3nU4CmppFBzdeE4Pm2+o/Vb5Yd+pPtM="; + }; + + vendorSha256 = "sha256-yK04gjDO6JSDcJULcbJBBuPBhx792JNn+B227lDUrWk="; + + meta = with lib; { + description = "Send files using peer authenticated WebRTC"; + homepage = "https://github.com/saljam/webwormhole"; + license = licenses.bsd3; + maintainers = with maintainers; [ bbigras ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/weighttp/default.nix b/nixpkgs/pkgs/tools/networking/weighttp/default.nix new file mode 100644 index 000000000000..7c3d23c0d17f --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/weighttp/default.nix @@ -0,0 +1,23 @@ +{ lib, stdenv, fetchgit, python, libev, wafHook }: + +stdenv.mkDerivation rec { + pname = "weighttp"; + version = "0.4"; + + src = fetchgit { + url = "https://git.lighttpd.net/weighttp.git"; + rev = "refs/tags/weighttp-${version}"; + sha256 = "14yjmdx9p8g8c3zlrx5qid8k156lsagfwhl3ny54162nxjf7kzgr"; + }; + + nativeBuildInputs = [ wafHook ]; + + buildInputs = [ python libev ]; + + meta = with lib; { + description = "Lightweight and simple webserver benchmarking tool"; + homepage = "https://redmine.lighttpd.net/projects/weighttp/wiki"; + platforms = platforms.unix; + license = licenses.mit; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/wget/default.nix b/nixpkgs/pkgs/tools/networking/wget/default.nix new file mode 100644 index 000000000000..efdd16e630bc --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/wget/default.nix @@ -0,0 +1,64 @@ +{ lib, stdenv, fetchurl, gettext, pkg-config, perlPackages +, libidn2, zlib, pcre, libuuid, libiconv, libintl +, python3, lzip +, libpsl ? null +, openssl ? null }: + +stdenv.mkDerivation rec { + pname = "wget"; + version = "1.21.1"; + + src = fetchurl { + url = "mirror://gnu/wget/${pname}-${version}.tar.lz"; + sha256 = "sha256-25u+U0fm+qBvx4gF7rgIsmiXlFXq2QA6YIVpydT8kK0="; + }; + + patches = [ + ./remove-runtime-dep-on-openssl-headers.patch + ]; + + preConfigure = '' + patchShebangs doc + + '' + lib.optionalString doCheck '' + # Work around lack of DNS resolution in chroots. + for i in "tests/"*.pm "tests/"*.px + do + sed -i "$i" -e's/localhost/127.0.0.1/g' + done + ''; + + nativeBuildInputs = [ gettext pkg-config perlPackages.perl lzip libiconv libintl ]; + buildInputs = [ libidn2 zlib pcre libuuid ] + ++ lib.optionals doCheck [ perlPackages.IOSocketSSL perlPackages.LWP python3 ] + ++ lib.optional (openssl != null) openssl + ++ lib.optional (libpsl != null) libpsl + ++ lib.optional stdenv.isDarwin perlPackages.perl; + + configureFlags = [ + (lib.withFeatureAs (openssl != null) "ssl" "openssl") + ] ++ lib.optionals stdenv.isDarwin [ + # https://lists.gnu.org/archive/html/bug-wget/2021-01/msg00076.html + "--without-included-regex" + ]; + + doCheck = false; + + meta = with lib; { + description = "Tool for retrieving files using HTTP, HTTPS, and FTP"; + + longDescription = + '' GNU Wget is a free software package for retrieving files using HTTP, + HTTPS and FTP, the most widely-used Internet protocols. It is a + non-interactive commandline tool, so it may easily be called from + scripts, cron jobs, terminals without X-Windows support, etc. + ''; + + license = licenses.gpl3Plus; + + homepage = "https://www.gnu.org/software/wget/"; + + maintainers = with maintainers; [ fpletz ]; + platforms = platforms.all; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/wget/remove-runtime-dep-on-openssl-headers.patch b/nixpkgs/pkgs/tools/networking/wget/remove-runtime-dep-on-openssl-headers.patch new file mode 100644 index 000000000000..a6a1fcfcb37b --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/wget/remove-runtime-dep-on-openssl-headers.patch @@ -0,0 +1,17 @@ +diff --git a/src/Makefile.in b/src/Makefile.in +index 1a36a9b..e279c84 100644 +--- a/src/Makefile.in ++++ b/src/Makefile.in +@@ -2211,10 +2211,9 @@ version.c: $(wget_SOURCES) ../lib/libgnu.a + echo '' >> $@ + echo '#include "version.h"' >> $@ + echo 'const char *version_string = "@VERSION@";' >> $@ +- echo 'const char *compilation_string = "'$(COMPILE)'";' \ ++ echo 'const char *compilation_string = 0;' \ + | $(ESCAPEQUOTE) >> $@ +- echo 'const char *link_string = "'$(CCLD) $(AM_CFLAGS) $(CFLAGS) \ +- $(AM_LDFLAGS) $(LDFLAGS) $(LIBS) $(wget_LDADD)'";' \ ++ echo 'const char *link_string = 0;' \ + | $(ESCAPEQUOTE) >> $@ + + css.c: $(srcdir)/css.l diff --git a/nixpkgs/pkgs/tools/networking/wget2/default.nix b/nixpkgs/pkgs/tools/networking/wget2/default.nix new file mode 100644 index 000000000000..3fd40f8a7bad --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/wget2/default.nix @@ -0,0 +1,100 @@ +{ lib +, stdenv +, fetchFromGitLab +, fetchpatch + # build support +, autoreconfHook +, flex +, gnulib +, lzip +, pkg-config +, python3 +, texinfo + # libraries +, brotli +, bzip2 +, gpgme +, libhsts +, libidn2 +, libpsl +, xz +, nghttp2 +, sslSupport ? true +, openssl +, pcre2 +, zlib +, zstd +}: + +stdenv.mkDerivation rec { + pname = "wget2"; + version = "1.99.2"; + + src = fetchFromGitLab { + owner = "gnuwget"; + repo = pname; + rev = version; + sha256 = "1gws8y3z8xzi46c48n7jb162mr3ar4c34s7yy8kjcs14yzq951qz"; + }; + + patches = [ + (fetchpatch { + name = "fix-autotools-2.70.patch"; + url = "https://gitlab.com/gnuwget/wget2/-/commit/580af869093cfda6bc8a9d5901850354a16b3666.patch"; + sha256 = "1x6wq4wxvvy6174d52qrhxkcgmv366f8smxyki49zb6rs4gqhskd"; + }) + (fetchpatch { + name = "update-potfiles-for-gnulib-2020-11-28.patch"; + url = "https://gitlab.com/gnuwget/wget2/-/commit/368deb9fcca0c281f9c76333607cc878c3945ad0.patch"; + sha256 = "1qsz8hbzbgg14wikxsbjjlq0cp3jw4pajbaz9wdn6ny617hdvi8y"; + }) + ]; + + # wget2_noinstall contains forbidden reference to /build/ + postPatch = '' + substituteInPlace src/Makefile.am \ + --replace 'bin_PROGRAMS = wget2 wget2_noinstall' 'bin_PROGRAMS = wget2' + ''; + + nativeBuildInputs = [ autoreconfHook flex lzip pkg-config python3 texinfo ]; + + buildInputs = [ brotli bzip2 gpgme libhsts libidn2 libpsl xz nghttp2 pcre2 zlib zstd ] + ++ lib.optional sslSupport openssl; + + # TODO: include translation files + autoreconfPhase = '' + # copy gnulib into build dir and make writable. + # Otherwise ./bootstrap copies the non-writable files from nix store and fails to modify them + rmdir gnulib + cp -r ${gnulib} gnulib + chmod -R u+w gnulib/{build-aux,lib} + + # fix bashisms can be removed when https://gitlab.com/gnuwget/wget2/-/commit/c9499dcf2f58983d03e659e2a1a7f21225141edf is in the release + sed 's|==|=|g' -i configure.ac + + ./bootstrap --no-git --gnulib-srcdir=gnulib --skip-po + ''; + + configureFlags = [ + "--disable-static" + # TODO: https://gitlab.com/gnuwget/wget2/-/issues/537 + (lib.withFeatureAs sslSupport "ssl" "openssl") + ]; + + outputs = [ "out" "lib" "dev" ]; + + meta = with lib; { + description = "successor of GNU Wget, a file and recursive website downloader."; + longDescription = '' + Designed and written from scratch it wraps around libwget, that provides the basic + functions needed by a web client. + Wget2 works multi-threaded and uses many features to allow fast operation. + In many cases Wget2 downloads much faster than Wget1.x due to HTTP2, HTTP compression, + parallel connections and use of If-Modified-Since HTTP header. + ''; + homepage = "https://gitlab.com/gnuwget/wget2"; + # wget2 GPLv3+; libwget LGPLv3+ + license = with licenses; [ gpl3Plus lgpl3Plus ]; + maintainers = with maintainers; [ SuperSandro2000 ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/whois/default.nix b/nixpkgs/pkgs/tools/networking/whois/default.nix new file mode 100644 index 000000000000..55a356e32980 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/whois/default.nix @@ -0,0 +1,42 @@ +{ lib, stdenv, fetchFromGitHub, perl, gettext, pkg-config, libidn2, libiconv }: + +stdenv.mkDerivation rec { + version = "5.5.8"; + pname = "whois"; + + src = fetchFromGitHub { + owner = "rfc1036"; + repo = "whois"; + rev = "v${version}"; + sha256 = "sha256-WSAqJMVeHkcqzcgwvFKKBXJiIfKXBQr2mjioG7CgkIo="; + }; + + nativeBuildInputs = [ perl gettext pkg-config ]; + buildInputs = [ libidn2 libiconv ]; + + preConfigure = '' + for i in Makefile po/Makefile; do + substituteInPlace $i --replace "prefix = /usr" "prefix = $out" + done + ''; + + makeFlags = [ "HAVE_ICONV=1" ]; + buildFlags = [ "whois" ]; + + installTargets = [ "install-whois" ]; + + meta = with lib; { + description = "Intelligent WHOIS client from Debian"; + longDescription = '' + This package provides a commandline client for the WHOIS (RFC 3912) + protocol, which queries online servers for information such as contact + details for domains and IP address assignments. It can intelligently + select the appropriate WHOIS server for most queries. + ''; + + homepage = "https://packages.qa.debian.org/w/whois.html"; + license = licenses.gpl2; + maintainers = with maintainers; [ fpletz ]; + platforms = platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/wicd/default.nix b/nixpkgs/pkgs/tools/networking/wicd/default.nix new file mode 100644 index 000000000000..e4eb0a2cdc8c --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/wicd/default.nix @@ -0,0 +1,121 @@ +{ lib, stdenv, fetchurl, python2Packages +, wpa_supplicant, dhcp, dhcpcd, wirelesstools +, nettools, openresolv, iproute2, iputils }: + +let + inherit (python2Packages) python pygobject2 dbus-python pyGtkGlade pycairo; +in stdenv.mkDerivation rec { + pname = "wicd"; + version = "1.7.2.4"; + + src = fetchurl { + url = "https://launchpad.net/wicd/1.7/${version}/+download/${pname}-${version}.tar.gz"; + sha256 = "15ywgh60xzmp5z8l1kzics7yi95isrjg1paz42dvp7dlpdfzpzfw"; + }; + + buildInputs = with python2Packages; [ + python Babel urwid notify + ]; + + patches = [ + ./no-var-install.patch + ./pygtk.patch + ./no-optimization.patch + ./dhclient.patch + ./fix-app-icon.patch + ./fix-gtk-issues.patch + ./urwid-api-update.patch + ./fix-curses.patch + ]; + + # Should I be using pygtk's propagated build inputs? + # !!! Should use makeWrapper. + postPatch = '' + # We don't have "python2". + substituteInPlace wicd/wicd-daemon.py --replace 'misc.find_path("python2")' "'${python.interpreter}'" + + substituteInPlace in/scripts=wicd.in --subst-var-by TEMPLATE-DEFAULT $out/share/other/dhclient.conf.template.default + + sed -i "2iexport PATH=${lib.makeBinPath [ python wpa_supplicant dhcpcd dhcp wirelesstools nettools nettools iputils openresolv iproute2 ]}\$\{PATH:+:\}\$PATH" in/scripts=wicd.in + sed -i "3iexport PYTHONPATH=$(toPythonPath $out):$(toPythonPath ${pygobject2}):$(toPythonPath ${dbus-python})\$\{PYTHONPATH:+:\}\$PYTHONPATH" in/scripts=wicd.in + sed -i "2iexport PATH=${python}/bin\$\{PATH:+:\}\$PATH" in/scripts=wicd-client.in + sed -i "3iexport PYTHONPATH=$(toPythonPath $out):$(toPythonPath ${pyGtkGlade})/gtk-2.0:$(toPythonPath ${pygobject2}):$(toPythonPath ${pygobject2})/gtk-2.0:$(toPythonPath ${pycairo}):$(toPythonPath ${dbus-python})\$\{PYTHONPATH:+:\}\$PYTHONPATH" in/scripts=wicd-client.in + sed -i "2iexport PATH=${python}/bin\$\{PATH:+:\}\$PATH" in/scripts=wicd-gtk.in + sed -i "3iexport PYTHONPATH=$(toPythonPath $out):$(toPythonPath ${pyGtkGlade})/gtk-2.0:$(toPythonPath ${pygobject2}):$(toPythonPath ${pygobject2})/gtk-2.0:$(toPythonPath ${pycairo}):$(toPythonPath ${dbus-python}):$(toPythonPath ${python2Packages.notify})\$\{PYTHONPATH:+:\}\$PYTHONPATH" in/scripts=wicd-gtk.in + sed -i "2iexport PATH=${python}/bin\$\{PATH:+:\}\$PATH" in/scripts=wicd-cli.in + sed -i "3iexport PYTHONPATH=$(toPythonPath $out):$(toPythonPath ${pyGtkGlade})/gtk-2.0:$(toPythonPath ${pygobject2}):$(toPythonPath ${pycairo}):$(toPythonPath ${dbus-python})\$\{PYTHONPATH:+:\}\$PYTHONPATH" in/scripts=wicd-cli.in + sed -i "2iexport PATH=${python}/bin\$\{PATH:+:\}\$PATH" in/scripts=wicd-curses.in + sed -i "3iexport PYTHONPATH=$(toPythonPath $out):$(toPythonPath ${pyGtkGlade})/gtk-2.0:$(toPythonPath ${pygobject2}):$(toPythonPath ${pycairo}):$(toPythonPath ${dbus-python}):$(toPythonPath ${python2Packages.urwid})\$\{PYTHONPATH:+:\}\$PYTHONPATH" in/scripts=wicd-curses.in + rm po/ast.po + ''; + + configurePhase = '' + python setup.py configure \ + --lib=$out/lib/ \ + --share=$out/share/ \ + --etc=/var/lib/wicd/ \ + --scripts=$out/etc/scripts/ \ + --pixmaps=$out/share/pixmaps/ \ + --images=$out/share/pixmaps/wicd/ \ + --encryption=$out/etc/encryption/templates/ \ + --bin=$out/bin/ \ + --sbin=$out/sbin/ \ + --backends=$out/share/backends/ \ + --daemon=$out/share/daemon/ \ + --curses=$out/share/curses/ \ + --gtk=$out/share/gtk/ \ + --cli=$out/share/cli/ \ + --networks=/var/lib/wicd/configurations/ \ + --resume=$out/etc/acpi/resume.d/ \ + --suspend=$out/etc/acpi/suspend.d/ \ + --pmutils=$out/lib/pm-utils/sleep.d/ \ + --dbus=$out/etc/dbus-1/system.d/ \ + --dbus-service=$out/etc/dbus-1/system-services/ \ + --systemd=$out/lib/systemd/ \ + --logrotate=$out/etc/logrotate.d/ \ + --desktop=$out/share/applications/ \ + --icons=$out/share/icons/hicolor/ \ + --translations=$out/share/locale/ \ + --autostart=$out/etc/xdg/autostart/ \ + --varlib=$out/var/lib/ \ + --docdir=$out/share/doc/ \ + --mandir=$out/share/man/ \ + --kdedir=$out/share/autostart/ \ + --python=${python}/bin/python \ + --distro=nix \ + --wicdgroup=users \ + --no-install-init \ + --no-install-kde \ + --no-install-acpi \ + --no-install-pmutils \ + ''; + + installPhase = '' + python setup.py install --prefix=$out --install-lib=$out/${python.sitePackages} + mkdir -p $out/share/other + cp other/dhclient.conf.template.default $out/share/other/dhclient.conf.template.default + + # Add a template for "WPA2 Enterprise" encryption as used, e.g., by the + # Eduroam network. Taken and adapted from + # <http://wicd.net/punbb/viewtopic.php?id=87>. + cp -v "${./wpa2-ttls}" "$out/etc/encryption/templates/wpa2-ttls" + echo "wpa2-ttls" >> "$out/etc/encryption/templates/active" + ''; + + meta = with lib; { + homepage = "http://wicd.net/"; + description = "A wiredless and wired network manager"; + longDescription='' + A complete network connection manager + Wicd supports wired and wireless networks, and capable of + creating and tracking profiles for both. It has a + template-based wireless encryption system, which allows the user + to easily add encryption methods used. It ships with some common + encryption types, such as WPA and WEP. Wicd will automatically + connect at startup to any preferred network within range. + ''; + maintainers = [ maintainers.roconnor ]; + license = licenses.gpl2; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/wicd/dhclient.patch b/nixpkgs/pkgs/tools/networking/wicd/dhclient.patch new file mode 100644 index 000000000000..fbda1caacb7a --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/wicd/dhclient.patch @@ -0,0 +1,120 @@ +diff -ruN wicd-1.7.2.4.orig/wicd/wicd-daemon.py wicd-1.7.2.4/wicd/wicd-daemon.py +--- wicd-1.7.2.4.orig/wicd/wicd-daemon.py 2013-06-22 18:55:02.641242947 +0000 ++++ wicd-1.7.2.4/wicd/wicd-daemon.py 2013-06-22 18:58:33.990244153 +0000 +@@ -69,6 +69,7 @@ + wireless_conf = os.path.join(wpath.etc, "wireless-settings.conf") + wired_conf = os.path.join(wpath.etc, "wired-settings.conf") + dhclient_conf = os.path.join(wpath.etc, "dhclient.conf.template") ++dhclient_conf_default = os.path.join(wpath.share, "other", "dhclient.conf.template.default") + + class WicdDaemon(dbus.service.Object): + """ The main wicd daemon class. +@@ -910,7 +911,7 @@ + + if not os.path.isfile(dhclient_conf): + print "dhclient.conf.template not found, copying..." +- shutil.copy(dhclient_conf + ".default", dhclient_conf) ++ shutil.copy(dhclient_conf_default, dhclient_conf) + # Hide the files, so the keys aren't exposed. + print "chmoding configuration files 0600..." + os.chmod(app_conf.get_config(), 0600)diff -ruN wicd-1.7.2.4.orig/wicd/wnettools.py wicd-1.7.2.4/wicd/wnettools.py +--- wicd-1.7.2.4.orig/wicd/wnettools.py 2013-03-30 21:47:19.804907552 +0000 ++++ wicd-1.7.2.4/wicd/wnettools.py 2013-03-31 08:44:37.572792110 +0000 +@@ -37,6 +37,7 @@ + import time + from string import maketrans, translate + ++import tempfile + import wpath + import misc + from misc import find_path +@@ -216,6 +217,7 @@ + self.flush_tool = None + self.link_detect = None + self.dhcp_object = None ++ self.dhclient_conf_path = None; + + def SetDebugMode(self, value): + """ If True, verbose output is enabled. """ +@@ -277,12 +279,6 @@ + cmd = "" + return (client, cmd) + +- # probably /var/lib/wicd/dhclient.conf with defaults +- dhclient_conf_path = os.path.join( +- wpath.varlib, +- 'dhclient.conf' +- ) +- + client_dict = { + "dhclient" : + {'connect' : r"%(cmd)s -cf %(dhclientconf)s %(iface)s", +@@ -307,41 +303,44 @@ + } + (client_name, cmd) = get_client_name(self.DHCP_CLIENT) + +- # cause dhclient doesn't have a handy dandy argument +- # for specifing the hostname to be sent +- if client_name == "dhclient" and flavor: +- if hostname == None: +- # <hostname> will use the system hostname +- # we'll use that if there is hostname passed +- # that shouldn't happen, though +- hostname = '<hostname>' +- print 'attempting to set hostname with dhclient' +- print 'using dhcpcd or another supported client may work better' +- dhclient_template = \ +- open(os.path.join(wpath.etc, 'dhclient.conf.template'), 'r') +- +- output_conf = open(dhclient_conf_path, 'w') +- +- for line in dhclient_template.readlines(): +- line = line.replace('$_HOSTNAME', hostname) +- output_conf.write(line) +- +- output_conf.close() +- dhclient_template.close() +- os.chmod(dhclient_conf_path, 0644) +- + if not client_name or not cmd: + print "WARNING: Failed to find a valid dhcp client!" + return "" + + if flavor == "connect": ++ # cause dhclient doesn't have a handy dandy argument ++ # for specifing the hostname to be sent ++ if client_name == "dhclient" and flavor: ++ if hostname == None: ++ # <hostname> will use the system hostname ++ # we'll use that if there is hostname passed ++ # that shouldn't happen, though ++ hostname = '<hostname>' ++ print 'attempting to set hostname with dhclient' ++ print 'using dhcpcd or another supported client may work better' ++ if not self.dhclient_conf_path: ++ _,self.dhclient_conf_path = tempfile.mkstemp() ++ print 'New dhclient conf path: %s ' % self.dhclient_conf_path ++ dhclient_template = \ ++ open(os.path.join(wpath.etc, 'dhclient.conf.template'), 'r') ++ ++ output_conf = open(self.dhclient_conf_path, 'w') ++ ++ for line in dhclient_template.readlines(): ++ line = line.replace('$_HOSTNAME', hostname) ++ output_conf.write(line) ++ ++ output_conf.close() ++ dhclient_template.close() ++ os.chmod(self.dhclient_conf_path, 0644) ++ + if not hostname: + hostname = os.uname()[1] + return client_dict[client_name]['connect'] % \ + { "cmd" : cmd, + "iface" : self.iface, + "hostname" : hostname, +- 'dhclientconf' : dhclient_conf_path } ++ 'dhclientconf' : self.dhclient_conf_path } + elif flavor == "release": + return client_dict[client_name]['release'] % {"cmd":cmd, "iface":self.iface} + else: diff --git a/nixpkgs/pkgs/tools/networking/wicd/fix-app-icon.patch b/nixpkgs/pkgs/tools/networking/wicd/fix-app-icon.patch new file mode 100644 index 000000000000..31b47bb45881 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/wicd/fix-app-icon.patch @@ -0,0 +1,19 @@ +Someone forgot to pack wicd.png icon. We will replace it with existing one. + +diff -ruN wicd-1.7.2.4.orig/gtk/gui.py wicd-1.7.2.4/gtk/gui.py +--- wicd-1.7.2.4.orig/gtk/gui.py 2013-03-30 21:47:19.802907553 +0000 ++++ wicd-1.7.2.4/gtk/gui.py 2013-03-31 08:13:32.876871673 +0000 +@@ -205,8 +205,10 @@ + + self.status_area.hide_all() + +- if os.path.exists(os.path.join(wpath.images, "wicd.png")): +- self.window.set_icon_from_file(os.path.join(wpath.images, "wicd.png")) ++ if os.path.exists(os.path.join(wpath.images, "../../icons/hicolour/128x128/apps/wicd-gtk.png")): ++ self.window.set_icon_from_file(os.path.join(wpath.images, "../../icons/hicolor/128x128/apps/wicd-gtk.png")) ++ else: ++ print 'icon doesn\'t exist %s' % os.path.join(wpath.images, "../../icons/hicolor/128x128/apps/wicd-gtk.png") + self.statusID = None + self.first_dialog_load = True + self.is_visible = True + diff --git a/nixpkgs/pkgs/tools/networking/wicd/fix-curses.patch b/nixpkgs/pkgs/tools/networking/wicd/fix-curses.patch new file mode 100644 index 000000000000..138dfbabfd5c --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/wicd/fix-curses.patch @@ -0,0 +1,15 @@ +--- a/curses/wicd-curses.py 2015-01-27 22:35:25.414781192 -0300 ++++ b/curses/wicd-curses.py 2015-01-28 01:13:48.078904587 -0300 +@@ -1153,9 +1153,10 @@ + if not ui._started: + return False + +- input_data = ui.get_input_nonblocking() ++ ui.set_input_timeouts(max_wait=0) ++ input_data = ui.get_input() + # Resolve any "alarms" in the waiting +- self.handle_keys(input_data[1]) ++ self.handle_keys(input_data) + + # Update the screen + canvas = self.frame.render((self.size), True) diff --git a/nixpkgs/pkgs/tools/networking/wicd/fix-gtk-issues.patch b/nixpkgs/pkgs/tools/networking/wicd/fix-gtk-issues.patch new file mode 100644 index 000000000000..31e553b46b50 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/wicd/fix-gtk-issues.patch @@ -0,0 +1,47 @@ +diff -ruN wicd-1.7.2.4.orig/gtk/gui.py wicd-1.7.2.4/gtk/gui.py +--- wicd-1.7.2.4.orig/gtk/gui.py 2013-03-31 17:01:29.367001288 +0000 ++++ wicd-1.7.2.4/gtk/gui.py 2013-03-31 17:55:20.826028396 +0000 +@@ -35,7 +35,7 @@ + from wicd import misc + from wicd import wpath + from wicd import dbusmanager +-from wicd.misc import noneToString ++from wicd.misc import noneToString, _status_dict + from wicd.translations import _, language + import prefs + from prefs import PreferencesDialog +@@ -250,7 +250,7 @@ + + def handle_connection_results(self, results): + if results not in ['success', 'aborted'] and self.is_visible: +- error(self.window, language[results], block=False) ++ error(self.window, misc._status_dict[results], block=False) + + def create_adhoc_network(self, widget=None): + """ Shows a dialog that creates a new adhoc network. """ +diff -ruN wicd-1.7.2.4.orig/po/ru.po wicd-1.7.2.4/po/ru.po +--- wicd-1.7.2.4.orig/po/ru.po 2013-03-31 17:01:29.362001288 +0000 ++++ wicd-1.7.2.4/po/ru.po 2013-03-31 17:43:37.909022515 +0000 +@@ -173,7 +173,7 @@ + + #: wicd/misc.py:79 + msgid "Connection Failed: Bad password" +-msgstr "Ошибка соединения: Неверный пароль:" ++msgstr "Ошибка соединения: Неверный пароль" + + #: wicd/misc.py:89 + msgid "Connection Failed: No DHCP offers received." +diff -ruN wicd-1.7.2.4.orig/wicd/misc.py wicd-1.7.2.4/wicd/misc.py +--- wicd-1.7.2.4.orig/wicd/misc.py 2013-03-31 17:01:29.369001288 +0000 ++++ wicd-1.7.2.4/wicd/misc.py 2013-03-31 17:23:56.822012593 +0000 +@@ -430,7 +430,9 @@ + """ Sanitize property names to be used in config-files. """ + allowed = string.ascii_letters + '_' + string.digits + table = string.maketrans(allowed, ' ' * len(allowed)) +- return s.translate(None, table) ++ #return s.translate(None, table) ++ #return s.translate(table) ++ return s + + def sanitize_escaped(s): + """ Sanitize double-escaped unicode strings. """ diff --git a/nixpkgs/pkgs/tools/networking/wicd/no-optimization.patch b/nixpkgs/pkgs/tools/networking/wicd/no-optimization.patch new file mode 100644 index 000000000000..785cae7b6ed5 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/wicd/no-optimization.patch @@ -0,0 +1,21 @@ +With optimizations on, python will overwrite the nix store. + +--- wicd-1.7.0/in/scripts=wicd.in 2011-04-05 14:31:09.733096865 -0400 ++++ wicd-1.7.0/in/scripts=wicd.in 2011-04-05 14:31:16.397096864 -0400 +@@ -1,3 +1,3 @@ + #!/bin/bash + +-exec %PYTHON% -O %SHARE%daemon/wicd-daemon.py $@ ++exec %PYTHON% -B %SHARE%daemon/wicd-daemon.py $@ + +--- wicd-1.7.2.4/wicd/wicd-daemon.py 2012-04-30 21:19:45.000000000 +0200 ++++ wicd-1.7.2.4/wicd/wicd-daemon.pynew 2013-03-14 21:35:23.250306592 +0100 +@@ -1812,7 +1812,7 @@ + daemon = WicdDaemon(wicd_bus, auto_connect=auto_connect) + child_pid = None + if not no_poll: +- child_pid = Popen([wpath.python, "-O", ++ child_pid = Popen([wpath.python, "-B", + os.path.join(wpath.daemon, "monitor.py")], + shell=False, close_fds=True).pid + atexit.register(on_exit, child_pid) diff --git a/nixpkgs/pkgs/tools/networking/wicd/no-var-install.patch b/nixpkgs/pkgs/tools/networking/wicd/no-var-install.patch new file mode 100644 index 000000000000..b01f0e5a438a --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/wicd/no-var-install.patch @@ -0,0 +1,17 @@ +The install tries to create files in /var. This patch removes those steps. + +--- wicd-1.7.2.4/setup.py 2013-03-14 21:28:21.360580941 +0100 ++++ wicd-1.7.2.4/setup.py 2013-03-14 21:22:50.125721943 +0100 +@@ -505,11 +505,8 @@ + (wpath.dbus_service, ['other/org.wicd.daemon.service']), + (wpath.systemd, ['other/wicd.service']), + (wpath.logrotate, ['other/wicd.logrotate']), +- (wpath.log, [empty_file]), +- (wpath.etc, ['other/dhclient.conf.template.default']), + (wpath.encryption, [('encryption/templates/' + b) for b in + os.listdir('encryption/templates') if not b.startswith('.')]), +- (wpath.networks, [empty_file]), + (wpath.sbin, ['scripts/wicd']), + (wpath.daemon, ['wicd/monitor.py', 'wicd/wicd-daemon.py', + 'wicd/suspend.py', 'wicd/autoconnect.py']), + diff --git a/nixpkgs/pkgs/tools/networking/wicd/pygtk.patch b/nixpkgs/pkgs/tools/networking/wicd/pygtk.patch new file mode 100644 index 000000000000..f015e50d684a --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/wicd/pygtk.patch @@ -0,0 +1,15 @@ +For some reason nix's pygtk doesn't have a pygtk module so we remove the version check. +If this ever changes we could remove this patch. + +--- wicd-1.7.0/gtk/wicd-client.py 2009-09-01 11:05:31.000000000 -0400 ++++ wicd-1.7.0/gtk/wicd-client.py 2009-12-28 00:22:57.000000000 -0500 +@@ -43,9 +43,6 @@ + import atexit + from dbus import DBusException + +-import pygtk +-pygtk.require('2.0') +- + HAS_NOTIFY = True + try: + import pynotify diff --git a/nixpkgs/pkgs/tools/networking/wicd/urwid-api-update.patch b/nixpkgs/pkgs/tools/networking/wicd/urwid-api-update.patch new file mode 100644 index 000000000000..a794f6caaeee --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/wicd/urwid-api-update.patch @@ -0,0 +1,21 @@ +--- a/curses/curses_misc.py ++++ a/curses/curses_misc.py +@@ -358,6 +358,19 @@ class ComboBox(urwid.WidgetWrap): + self.parent = None + self.ui = None + self.row = None ++ ++ @property ++ def focus(self): ++ return self._focus ++ ++ @focus.setter ++ def focus(self, index): ++ self._focus = index ++ ++ @focus.deleter ++ def focus(self): ++ del self._focus ++ + def set_list(self,list): + self.list = list diff --git a/nixpkgs/pkgs/tools/networking/wicd/wpa2-ttls b/nixpkgs/pkgs/tools/networking/wicd/wpa2-ttls new file mode 100644 index 000000000000..650375cbbaae --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/wicd/wpa2-ttls @@ -0,0 +1,20 @@ +name = WPA2-TTLS +author = various contributors +version = 1 +require identity *Identity anonymous_identity *Anonymous_identity password *Password ca_cert *Path_to_CA_Cert +protected password *Password +----- +ctrl_interface=/run/wpa_supplicant +network={ + ssid="$_ESSID" + scan_ssid=$_SCAN + proto=WPA2 + key_mgmt=WPA-EAP + group=CCMP TKIP + eap=TTLS + identity="$_IDENTITY" + password="$_PASSWORD" + anonymous_identity="$_ANONYMOUS_IDENTITY" + ca_cert="$_CA_CERT" + phase2="auth=PAP" +} diff --git a/nixpkgs/pkgs/tools/networking/wifish/default.nix b/nixpkgs/pkgs/tools/networking/wifish/default.nix new file mode 100644 index 000000000000..a9e30710c1a2 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/wifish/default.nix @@ -0,0 +1,47 @@ +{ lib, stdenv, fetchFromGitHub +, dialog +, gawk +, wpa_supplicant +, makeWrapper +}: + +stdenv.mkDerivation rec { + pname = "wifish"; + version = "1.1.4"; + + src = fetchFromGitHub{ + owner = "bougyman"; + repo = "wifish"; + rev = version; + sha256 = "sha256-eTErN6CfKDey/wV+9o9cBVaG5FzCRBiA9UicrMz3KBc="; + }; + + nativeBuildInputs = [ makeWrapper ]; + + postPatch = '' + sed -ie 's|/var/lib/wifish|${placeholder "out"}/var/lib/wifish|' wifish + ''; + + dontConfigure = true; + + installPhase = '' + install -D -m0644 awk/wscanparse.awk ${placeholder "out"}/var/lib/wifish/wscanparse.awk + install -D -m0644 awk/wlistparse.awk ${placeholder "out"}/var/lib/wifish/wlistparse.awk + install -D -m0644 awk/wscan2menu.awk ${placeholder "out"}/var/lib/wifish/wscan2menu.awk + install -D -m0644 awk/iwparse.awk ${placeholder "out"}/var/lib/wifish/iwparse.awk + install -D -m0755 wifish ${placeholder "out"}/bin/wifish + ''; + + postFixup = '' + wrapProgram ${placeholder "out"}/bin/wifish \ + --prefix PATH ":" ${lib.makeBinPath [ dialog gawk wpa_supplicant ]} + ''; + + meta = with lib; { + homepage = "https://github.com/bougyman/wifish"; + description = "Simple wifi shell script for linux"; + license = licenses.wtfpl; + maintainers = with maintainers; [ AndersonTorres ]; + platforms = with platforms; linux; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/wifite2/default.nix b/nixpkgs/pkgs/tools/networking/wifite2/default.nix new file mode 100644 index 000000000000..054b77f8c9b8 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/wifite2/default.nix @@ -0,0 +1,56 @@ +{ lib, fetchFromGitHub, fetchpatch, python3, wirelesstools +, aircrack-ng, wireshark-cli, reaverwps-t6x, cowpatty, hashcat, hcxtools +, hcxdumptool, pyrit, which }: + +python3.pkgs.buildPythonApplication rec { + version = "2.5.5"; + pname = "wifite2"; + + src = fetchFromGitHub { + owner = "kimocoder"; + repo = "wifite2"; + rev = version; + sha256 = "0rh54gj471dn8442imxwasjrrwzsx4m40nylkw3y6p8rbjmb92h4"; + }; + + patches = [ + (fetchpatch { + url = "https://salsa.debian.org/pkg-security-team/wifite/raw/debian/${version}-1/debian/patches/Disable-aircrack-failing-test.patch"; + sha256 = "04qql8w27c1lqk59ghkr1n6r08jwdrb1dcam5k88szkk2bxv8yx1"; + }) + (fetchpatch { + url = "https://salsa.debian.org/pkg-security-team/wifite/raw/debian/${version}-1/debian/patches/Disable-two-failing-tests.patch"; + sha256 = "1sixcqz1kbkhxf38yq55pwycm54adjx22bq46dfnl44mg69nx356"; + }) + ]; + + propagatedBuildInputs = [ + aircrack-ng + wireshark-cli + reaverwps-t6x + cowpatty + hashcat + hcxtools + hcxdumptool + wirelesstools + pyrit + which + ]; + + postFixup = let + sitePackagesDir = "$out/lib/python3.${lib.versions.minor python3.version}/site-packages"; + in '' + mv ${sitePackagesDir}/wifite/__main__.py ${sitePackagesDir}/wifite/wifite.py + ''; + + checkInputs = propagatedBuildInputs; + checkPhase = "python -m unittest discover tests -v"; + + meta = with lib; { + homepage = "https://github.com/derv82/wifite2"; + description = "Rewrite of the popular wireless network auditor, wifite"; + license = licenses.gpl2; + platforms = platforms.linux; + maintainers = with maintainers; [ lassulus danielfullmer ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/wireguard-go/0001-Fix-darwin-build.patch b/nixpkgs/pkgs/tools/networking/wireguard-go/0001-Fix-darwin-build.patch new file mode 100644 index 000000000000..d79d9e3531f3 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/wireguard-go/0001-Fix-darwin-build.patch @@ -0,0 +1,26 @@ +From 63360467da4ae6d7fc8c0e05619bdf8813c7e417 Mon Sep 17 00:00:00 2001 +From: Maximilian Bosch <maximilian@mbosch.me> +Date: Sun, 5 Jan 2020 15:35:15 +0100 +Subject: [PATCH] Fix darwin build + +--- + rwcancel/select_default.go | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/rwcancel/select_default.go b/rwcancel/select_default.go +index dd23cda..03f3452 100644 +--- a/rwcancel/select_default.go ++++ b/rwcancel/select_default.go +@@ -9,6 +9,7 @@ package rwcancel + + import "golang.org/x/sys/unix" + +-func unixSelect(nfd int, r *unix.FdSet, w *unix.FdSet, e *unix.FdSet, timeout *unix.Timeval) error { +- return unix.Select(nfd, r, w, e, timeout) ++func unixSelect(nfd int, r *unix.FdSet, w *unix.FdSet, e *unix.FdSet, timeout *unix.Timeval) (err error) { ++ _, err = unix.Select(nfd, r, w, e, timeout) ++ return + } +-- +2.23.1 + diff --git a/nixpkgs/pkgs/tools/networking/wireguard-go/default.nix b/nixpkgs/pkgs/tools/networking/wireguard-go/default.nix new file mode 100644 index 000000000000..35c5371113c1 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/wireguard-go/default.nix @@ -0,0 +1,30 @@ +{ lib, buildGoPackage, fetchzip }: + +buildGoPackage rec { + pname = "wireguard-go"; + version = "0.0.20200320"; + + goPackagePath = "golang.zx2c4.com/wireguard"; + + src = fetchzip { + url = "https://git.zx2c4.com/wireguard-go/snapshot/wireguard-go-${version}.tar.xz"; + sha256 = "0fy4qsss3i3pkq1rpgjds4aipbwlh1dr9hbbf7jn2a1c63kfks0r"; + }; + + patches = [ ./0001-Fix-darwin-build.patch ]; + + goDeps = ./deps.nix; + + passthru.updateScript = ./update.sh; + + postInstall = '' + mv $out/bin/wireguard $out/bin/wireguard-go + ''; + + meta = with lib; { + description = "Userspace Go implementation of WireGuard"; + homepage = "https://git.zx2c4.com/wireguard-go/about/"; + license = licenses.gpl2; + maintainers = with maintainers; [ elseym kirelagin yegortimoshenko zx2c4 ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/wireguard-go/deps.nix b/nixpkgs/pkgs/tools/networking/wireguard-go/deps.nix new file mode 100644 index 000000000000..859b8572f82e --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/wireguard-go/deps.nix @@ -0,0 +1,48 @@ +# file generated from go.mod using vgo2nix (https://github.com/adisbladis/vgo2nix) +[ + { + goPackagePath = "golang.org/x/crypto"; + fetch = { + type = "git"; + url = "https://go.googlesource.com/crypto"; + rev = "34f69633bfdc"; + sha256 = "0169vcn9s4c851y9vm7xqnar3vdfjrp7qsvcxadpfhsmwlfhxzgg"; + }; + } + { + goPackagePath = "golang.org/x/net"; + fetch = { + type = "git"; + url = "https://go.googlesource.com/net"; + rev = "d98b1b443823"; + sha256 = "1vzwpy56g056dsq304xga3d55jg2cxx89bijpfwjlhwyqyskybsz"; + }; + } + { + goPackagePath = "golang.org/x/sys"; + fetch = { + type = "git"; + url = "https://go.googlesource.com/sys"; + rev = "5c8b2ff67527"; + sha256 = "0r5s7f4w7crrbcf5ydpr2xzsq0svjm332vsds41yp58kwi2lvh2v"; + }; + } + { + goPackagePath = "golang.org/x/text"; + fetch = { + type = "git"; + url = "https://go.googlesource.com/text"; + rev = "v0.3.2"; + sha256 = "0flv9idw0jm5nm8lx25xqanbkqgfiym6619w575p7nrdh0riqwqh"; + }; + } + { + goPackagePath = "golang.org/x/tools"; + fetch = { + type = "git"; + url = "https://go.googlesource.com/tools"; + rev = "90fa682c2a6e"; + sha256 = "03ic2xsy51jw9749wl7gszdbz99iijbd2bckgygl6cm9w5m364ak"; + }; + } +] diff --git a/nixpkgs/pkgs/tools/networking/wireguard-go/update.sh b/nixpkgs/pkgs/tools/networking/wireguard-go/update.sh new file mode 100755 index 000000000000..2b6b8317a1e8 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/wireguard-go/update.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env nix-shell +#!nix-shell -i bash -p curl gnused common-updater-scripts vgo2nix + +set -eu -o pipefail + +basedir="$(git rev-parse --show-toplevel)" +version="$(curl -sL https://build.wireguard.com/distros.txt | sed -n 's/^upstream\tgo\t\([^\t]\+\)\t.*/\1/p')" +update-source-version wireguard-go "$version" + +vgo2nix -dir $(nix-build -A wireguard-go.src) -outfile "$basedir/pkgs/tools/networking/wireguard-go/deps.nix" + +if [[ -f "$basedir/wireguard-go.log" ]];then + rm "$basedir/wireguard-go.log" +fi diff --git a/nixpkgs/pkgs/tools/networking/wireguard-tools/default.nix b/nixpkgs/pkgs/tools/networking/wireguard-tools/default.nix new file mode 100644 index 000000000000..5972d781bd15 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/wireguard-tools/default.nix @@ -0,0 +1,62 @@ +{ lib +, stdenv +, fetchzip +, nixosTests +, iptables +, iproute2 +, makeWrapper +, openresolv +, procps +, wireguard-go +}: + +stdenv.mkDerivation rec { + pname = "wireguard-tools"; + version = "1.0.20210424"; + + src = fetchzip { + url = "https://git.zx2c4.com/wireguard-tools/snapshot/wireguard-tools-${version}.tar.xz"; + sha256 = "sha256-0aGaE4EBb4wb5g32Wugakt7w41sb97Hqqkac7qE641M="; + }; + + outputs = [ "out" "man" ]; + + sourceRoot = "source/src"; + + nativeBuildInputs = [ makeWrapper ]; + + makeFlags = [ + "DESTDIR=$(out)" + "PREFIX=/" + "WITH_BASHCOMPLETION=yes" + "WITH_SYSTEMDUNITS=yes" + "WITH_WGQUICK=yes" + ]; + + postFixup = '' + substituteInPlace $out/lib/systemd/system/wg-quick@.service \ + --replace /usr/bin $out/bin + '' + lib.optionalString stdenv.isLinux '' + for f in $out/bin/*; do + wrapProgram $f --prefix PATH : ${lib.makeBinPath [ procps iproute2 iptables openresolv ]} + done + '' + lib.optionalString stdenv.isDarwin '' + for f in $out/bin/*; do + wrapProgram $f --prefix PATH : ${wireguard-go}/bin + done + ''; + + passthru = { + updateScript = ./update.sh; + tests = nixosTests.wireguard; + }; + + meta = with lib; { + description = "Tools for the WireGuard secure network tunnel"; + downloadPage = "https://git.zx2c4.com/wireguard-tools/refs/"; + homepage = "https://www.wireguard.com/"; + license = licenses.gpl2; + maintainers = with maintainers; [ elseym ericsagnes mic92 zx2c4 globin ma27 xwvvvvwx ]; + platforms = platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/wireguard-tools/update.sh b/nixpkgs/pkgs/tools/networking/wireguard-tools/update.sh new file mode 100755 index 000000000000..e549228e8f1f --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/wireguard-tools/update.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env nix-shell +#!nix-shell -i bash -p curl gnused common-updater-scripts + +set -eu -o pipefail + +version="$(curl -sL https://build.wireguard.com/distros.txt | sed -n 's/^upstream\tkmodtools\t\([^\t]\+\)\t.*/\1/p')" +update-source-version wireguard-tools "$version" diff --git a/nixpkgs/pkgs/tools/networking/wol/default.nix b/nixpkgs/pkgs/tools/networking/wol/default.nix new file mode 100644 index 000000000000..114a8457d5b2 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/wol/default.nix @@ -0,0 +1,24 @@ +{ lib, stdenv, fetchurl, perl }: + +stdenv.mkDerivation rec { + pname = "wol"; + version = "0.7.1"; + + src = fetchurl { + url = "mirror://sourceforge/wake-on-lan/${pname}-${version}.tar.gz"; + sha256 = "08i6l5lr14mh4n3qbmx6kyx7vjqvzdnh3j9yfvgjppqik2dnq270"; + }; + + # for pod2man in order to get a manpage + nativeBuildInputs = [ perl ]; + + enableParallelBuilding = true; + + meta = with lib; { + description = "Implements Wake On LAN functionality in a small program"; + homepage = "https://sourceforge.net/projects/wake-on-lan/"; + license = licenses.gpl2; + maintainers = with maintainers; [ makefu ]; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/wolfebin/default.nix b/nixpkgs/pkgs/tools/networking/wolfebin/default.nix new file mode 100644 index 000000000000..2a07ada114d7 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/wolfebin/default.nix @@ -0,0 +1,29 @@ +{ lib, stdenv, fetchFromGitHub, python }: + +stdenv.mkDerivation rec { + version = "5.4"; + pname = "wolfebin"; + + src = fetchFromGitHub { + owner = "thejoshwolfe"; + repo = "wolfebin"; + rev = version; + sha256 = "16xj6zz30sn9q05p211bmmsl0i6fknfxf8dssn6knm6nkiym8088"; + }; + + buildInputs = [ python ]; + + installPhase = '' + install -m 755 -d $out/bin + install -m 755 wolfebin $out/bin + install -m 755 wolfebin_server.py $out/bin/wolfebin_server + ''; + + meta = with lib; { + homepage = "https://github.com/thejoshwolfe/wolfebin"; + description = "Quick and easy file sharing"; + license = licenses.mit; + maintainers = [ maintainers.andrewrk ]; + platforms = platforms.all; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/wormhole-william/default.nix b/nixpkgs/pkgs/tools/networking/wormhole-william/default.nix new file mode 100644 index 000000000000..4379aa89ceb5 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/wormhole-william/default.nix @@ -0,0 +1,25 @@ +{ lib, buildGoModule, fetchFromGitHub }: + +buildGoModule rec { + pname = "wormhole-william"; + version = "1.0.5"; + + src = fetchFromGitHub { + owner = "psanford"; + repo = "wormhole-william"; + rev = "v${version}"; + sha256 = "sha256-75pSFMzaZW+rtikO0khuxXIgb3Wj8ieSE4sB6quKgo4="; + }; + + vendorSha256 = "sha256-8GZ4h+DFQaCizOCxsMzAllXyaQgzQQBsbCnVi5MWbFg="; + + doCheck = false; + + meta = with lib; { + homepage = "https://github.com/psanford/wormhole-william"; + description = "End-to-end encrypted file transfers"; + changelog = "https://github.com/psanford/wormhole-william/releases/tag/v${version}"; + license = licenses.mit; + maintainers = with maintainers; [ psanford ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/wrk/default.nix b/nixpkgs/pkgs/tools/networking/wrk/default.nix new file mode 100644 index 000000000000..4298bd70d600 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/wrk/default.nix @@ -0,0 +1,45 @@ +{ lib, stdenv, fetchFromGitHub, luajit, openssl, perl }: + +stdenv.mkDerivation rec { + pname = "wrk"; + version = "4.1.0"; + + src = fetchFromGitHub { + owner = "wg"; + repo = "wrk"; + rev = version; + sha256 = "0dblb3qdg8mbgb8iiks0g420pza13npbr33b2xkc5dgv7kcwmvqj"; + }; + + buildInputs = [ luajit openssl perl ]; + + makeFlags = [ "WITH_LUAJIT=${luajit}" "WITH_OPENSSL=${openssl.dev}" "VER=${version}" ]; + + preBuild = '' + for f in src/*.h; do + substituteInPlace $f \ + --replace "#include <luajit-2.0/" "#include <" + done + ''; + + NIX_CFLAGS_COMPILE = "-DluaL_reg=luaL_Reg"; # needed since luajit-2.1.0-beta3 + + installPhase = '' + mkdir -p $out/bin + cp wrk $out/bin + ''; + + meta = with lib; { + description = "HTTP benchmarking tool"; + homepage = "https://github.com/wg/wrk"; + longDescription = '' + wrk is a modern HTTP benchmarking tool capable of generating + significant load when run on a single multi-core CPU. It + combines a multithreaded design with scalable event notification + systems such as epoll and kqueue. + ''; + license = licenses.asl20; + maintainers = with maintainers; [ ragge ]; + platforms = platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/wrk2/default.nix b/nixpkgs/pkgs/tools/networking/wrk2/default.nix new file mode 100644 index 000000000000..0cf40b87f5aa --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/wrk2/default.nix @@ -0,0 +1,42 @@ +{ lib, stdenv, fetchFromGitHub, luajit, openssl, zlib }: + +stdenv.mkDerivation rec { + pname = "wrk2"; + version = "4.0.0-${builtins.substring 0 7 src.rev}"; + + src = fetchFromGitHub { + owner = "giltene"; + repo = "wrk2"; + rev = "e0109df5b9de09251adb5f5848f223fbee2aa9f5"; + sha256 = "1aqdwmgdd74wq73f1zp28yqj91gd6p6nf9nbdfibl7mlklbzvak8"; + }; + + buildInputs = [ luajit openssl zlib ]; + + patchPhase = '' + rm -rf deps/luajit && mkdir deps/luajit + + substituteInPlace ./Makefile \ + --replace '-lluajit' '-lluajit-5.1' \ + --replace '_BSD_SOURCE' '_DEFAULT_SOURCE' \ + --replace 'cd $(LDIR) && ./luajit' '${luajit}/bin/luajit' \ + --replace 'config.h Makefile $(LDIR)/libluajit.a' 'config.h Makefile' + + substituteInPlace ./src/script.c \ + --replace 'struct luaL_reg ' 'struct luaL_Reg ' + ''; + + dontConfigure = true; + installPhase = '' + mkdir -p $out/bin + mv ./wrk $out/bin/wrk2 + ''; + + meta = { + description = "Constant throughput, correct latency recording variant of wrk"; + homepage = "https://github.com/giltene/wrk2"; + license = lib.licenses.bsd3; + platforms = lib.platforms.linux; + maintainers = with lib.maintainers; [ thoughtpolice ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/wuzz/default.nix b/nixpkgs/pkgs/tools/networking/wuzz/default.nix new file mode 100644 index 000000000000..156841be3344 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/wuzz/default.nix @@ -0,0 +1,25 @@ +{ lib, buildGoPackage, fetchFromGitHub }: + +buildGoPackage rec { + pname = "wuzz"; + version = "0.2.0"; + rev = "v${version}"; + + goPackagePath = "https://github.com/asciimoo/wuzz"; + + src = fetchFromGitHub { + owner = "asciimoo"; + repo = "wuzz"; + inherit rev; + sha256 = "1fcr5jr0vn5w60bn08lkh2mi0hdarwp361h94in03139j7hhqrfs"; + }; + + goDeps = ./deps.nix; + + meta = with lib; { + homepage = "https://github.com/asciimoo/wuzz"; + description = "Interactive cli tool for HTTP inspection"; + license = licenses.agpl3; + maintainers = with maintainers; [ pradeepchhetri ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/wuzz/deps.nix b/nixpkgs/pkgs/tools/networking/wuzz/deps.nix new file mode 100644 index 000000000000..8904596a712d --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/wuzz/deps.nix @@ -0,0 +1,92 @@ +[ + { + goPackagePath = "github.com/jroimartin/gocui"; + fetch = { + type = "git"; + url = "https://github.com/jroimartin/gocui"; + rev = "ed41d1bd2c217d4d1e312c2ee5d2f0c7793a99cc"; + sha256 = "1h4jxhvkf43jsbn85w45fq2xsmcg08mc9g7pkxf880g6sqznrmcz"; + }; + } + { + goPackagePath = "github.com/nsf/termbox-go"; + fetch = { + type = "git"; + url = "https://github.com/nsf/termbox-go"; + rev = "abe82ce5fb7a42fbd6784a5ceb71aff977e09ed8"; + sha256 = "156i8apkga8b3272kjhapyqwspgcfkrr9kpqwc5lii43k4swghpv"; + }; + } + { + goPackagePath = "github.com/mattn/go-runewidth"; + fetch = { + type = "git"; + url = "https://github.com/mattn/go-runewidth"; + rev = "14207d285c6c197daabb5c9793d63e7af9ab2d50"; + sha256 = "0y6yq9zd4kh7fimnc00r3h9pr2pwa5j85b3jcn5dyfamsnm2xdsv"; + }; + } + { + goPackagePath = "github.com/mitchellh/go-homedir"; + fetch = { + type = "git"; + url = "https://github.com/mitchellh/go-homedir"; + rev = "b8bc1bf767474819792c23f32d8286a45736f1c6"; + sha256 = "13ry4lylalkh4g2vny9cxwvryslzyzwp9r92z0b10idhdq3wad1q"; + }; + } + { + goPackagePath = "github.com/BurntSushi/toml"; + fetch = { + type = "git"; + url = "https://github.com/BurntSushi/toml"; + rev = "056c9bc7be7190eaa7715723883caffa5f8fa3e4"; + sha256 = "0gkgkw04ndr5y7hrdy0r4v2drs5srwfcw2bs1gyas066hwl84xyw"; + }; + } + { + goPackagePath = "github.com/nwidger/jsoncolor"; + fetch = { + type = "git"; + url = "https://github.com/nwidger/jsoncolor"; + rev = "0192e84d44af834c3a90c8a17bf670483b91ad5a"; + sha256 = "17mndgd1d233c22bd19xv4v2l2i5k8kz7y6n4n54a9i7fi9d10al"; + }; + } + { + goPackagePath = "github.com/fatih/color"; + fetch = { + type = "git"; + url = "https://github.com/fatih/color"; + rev = "e8e01ee22a7d4a91b49646e39245fe08e69c7878"; + sha256 = "1660g29qhshk6zxhpnc0f52m69jdqqdw2ccbkqw9y4kilnripfvl"; + }; + } + { + goPackagePath = "github.com/mattn/go-isatty"; + fetch = { + type = "git"; + url = "https://github.com/mattn/go-isatty"; + rev = "30a891c33c7cde7b02a981314b4228ec99380cca"; + sha256 = "03gsxn89pgkj4jkxm9avnj4f0ckvcskc6fj2lcd98l3akrz50ndg"; + }; + } + { + goPackagePath = "github.com/mattn/go-colorable"; + fetch = { + type = "git"; + url = "https://github.com/mattn/go-colorable"; + rev = "d228849504861217f796da67fae4f6e347643f15"; + sha256 = "0ch5sfcpmqczsh8kjbwpzdw31lacbkfyzvpzh4disnhhydbxjq0d"; + }; + } + { + goPackagePath = "github.com/asciimoo/wuzz"; + fetch = { + type = "git"; + url = "https://github.com/asciimoo/wuzz"; + rev = "f34c82a4386951022f8bfc011fe6a7362dd8286c"; + sha256 = "1fcr5jr0vn5w60bn08lkh2mi0hdarwp361h94in03139j7hhqrfs"; + }; + } +] diff --git a/nixpkgs/pkgs/tools/networking/x11-ssh-askpass/default.nix b/nixpkgs/pkgs/tools/networking/x11-ssh-askpass/default.nix new file mode 100644 index 000000000000..d33dd3df12ee --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/x11-ssh-askpass/default.nix @@ -0,0 +1,33 @@ +{ lib, stdenv, fetchurl, xlibsWrapper, imake, gccmakedep }: + +stdenv.mkDerivation { + name = "x11-ssh-askpass-1.2.4.1"; + + outputs = [ "out" "man" ]; + + src = fetchurl { + url = "http://pkgs.fedoraproject.org/repo/pkgs/openssh/x11-ssh-askpass-1.2.4.1.tar.gz/8f2e41f3f7eaa8543a2440454637f3c3/x11-ssh-askpass-1.2.4.1.tar.gz"; + sha256 = "620de3c32ae72185a2c9aeaec03af24242b9621964e38eb625afb6cdb30b8c88"; + }; + + nativeBuildInputs = [ imake gccmakedep ]; + buildInputs = [ xlibsWrapper ]; + + configureFlags = [ + "--with-app-defaults-dir=$out/etc/X11/app-defaults" + ]; + + dontUseImakeConfigure = true; + postConfigure = '' + xmkmf -a + ''; + + installTargets = [ "install" "install.man" ]; + + meta = with lib; { + homepage = "https://github.com/sigmavirus24/x11-ssh-askpass"; + description = "Lightweight passphrase dialog for OpenSSH or other open variants of SSH"; + license = licenses.mit; + platforms = platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/xh/default.nix b/nixpkgs/pkgs/tools/networking/xh/default.nix new file mode 100644 index 000000000000..0a62fee4bd74 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/xh/default.nix @@ -0,0 +1,50 @@ +{ stdenv, lib, openssl, pkg-config, rustPlatform, fetchFromGitHub, Security +, libiconv, installShellFiles }: + +rustPlatform.buildRustPackage rec { + pname = "xh"; + version = "0.10.0"; + + src = fetchFromGitHub { + owner = "ducaale"; + repo = "xh"; + rev = "v${version}"; + sha256 = "0b9cgjgzf1vxd9j6cz44g68xbaii8gb3973pvjf0p6barnqzvqvq"; + }; + + cargoSha256 = "0lwxmqp0ww9wf9p3nd42q89j0g7ichpkcm0mb1p5hhagwqgb0z15"; + + nativeBuildInputs = [ installShellFiles pkg-config ]; + + buildInputs = if stdenv.isDarwin then [ Security libiconv ] else [ openssl ]; + + # Get openssl-sys to use pkg-config + OPENSSL_NO_VENDOR = 1; + + postInstall = '' + installShellCompletion --cmd xh \ + --bash completions/xh.bash \ + --fish completions/xh.fish \ + --zsh completions/_xh + + # https://github.com/ducaale/xh#xh-and-xhs + ln -s $out/bin/xh $out/bin/xhs + ''; + + # Nix build happens in sandbox without internet connectivity + # disable tests as some of them require internet due to nature of application + doCheck = false; + doInstallCheck = true; + postInstallCheck = '' + $out/bin/xh --help > /dev/null + $out/bin/xhs --help > /dev/null + ''; + + meta = with lib; { + description = "Friendly and fast tool for sending HTTP requests"; + homepage = "https://github.com/ducaale/xh"; + changelog = "https://github.com/ducaale/xh/blob/v${version}/CHANGELOG.md"; + license = licenses.mit; + maintainers = with maintainers; [ payas SuperSandro2000 ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/xl2tpd/default.nix b/nixpkgs/pkgs/tools/networking/xl2tpd/default.nix new file mode 100644 index 000000000000..26731817c80f --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/xl2tpd/default.nix @@ -0,0 +1,29 @@ +{ lib, stdenv, fetchFromGitHub, libpcap, ppp }: + +stdenv.mkDerivation rec { + pname = "xl2tpd"; + version = "1.3.15"; + + src = fetchFromGitHub { + owner = "xelerance"; + repo = "xl2tpd"; + rev = "v${version}"; + sha256 = "0ppwza8nwm1av1vldw40gin9wrjrs4l9si50jad414js3k8ycaag"; + }; + + buildInputs = [ libpcap ]; + + postPatch = '' + substituteInPlace l2tp.h --replace /usr/sbin/pppd ${ppp}/sbin/pppd + ''; + + makeFlags = [ "PREFIX=$(out)" ]; + + meta = with lib; { + homepage = "http://www.xelerance.com/software/xl2tpd/"; + description = "Layer 2 Tunnelling Protocol Daemon (RFC 2661)"; + platforms = platforms.linux; + license = licenses.gpl2; + maintainers = with maintainers; [ abbradar ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/xnbd/0001-Fix-build-for-glibc-2.28.patch b/nixpkgs/pkgs/tools/networking/xnbd/0001-Fix-build-for-glibc-2.28.patch new file mode 100644 index 000000000000..712183e56c74 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/xnbd/0001-Fix-build-for-glibc-2.28.patch @@ -0,0 +1,25 @@ +From e799a7e0a64696e4ef6c088d36e4db09f8323581 Mon Sep 17 00:00:00 2001 +From: Maximilian Bosch <maximilian@mbosch.me> +Date: Sun, 19 Jan 2020 22:37:04 +0100 +Subject: [PATCH] Fix build for glibc>=2.28 + +The major/minor macros are defined in <sys/sysmacros.h> now. +--- + lib/io.h | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/lib/io.h b/lib/io.h +index 8703cc8..e3d0d10 100644 +--- a/lib/io.h ++++ b/lib/io.h +@@ -33,6 +33,7 @@ + #include <sys/types.h> + #include <sys/stat.h> + #include <sys/mman.h> ++#include <sys/sysmacros.h> + + + void read_all(int fd, void *buf, size_t len); +-- +2.23.1 + diff --git a/nixpkgs/pkgs/tools/networking/xnbd/default.nix b/nixpkgs/pkgs/tools/networking/xnbd/default.nix new file mode 100644 index 000000000000..0488fb9fa186 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/xnbd/default.nix @@ -0,0 +1,33 @@ +{ lib, stdenv, fetchurl, pkg-config, autoreconfHook, glib, jansson }: + +stdenv.mkDerivation rec { + name = "xnbd-0.4.0"; + + src = fetchurl { + url = "https://bitbucket.org/hirofuchi/xnbd/downloads/${name}.tgz"; + sha256 = "00wkvsa0yaq4mabczcbfpj6rjvp02yahw8vdrq8hgb3wpm80x913"; + }; + + sourceRoot = "${name}/trunk"; + + patches = [ ./0001-Fix-build-for-glibc-2.28.patch ]; + + nativeBuildInputs = [ autoreconfHook pkg-config ]; + + buildInputs = [ glib jansson ]; + + # do not build docs, it is slow and it fails on Hydra + prePatch = '' + rm -rf doc + substituteInPlace configure.ac --replace "doc/Makefile" "" + substituteInPlace Makefile.am --replace "lib doc ." "lib ." + ''; + + meta = { + homepage = "https://bitbucket.org/hirofuchi/xnbd"; + description = "Yet another NBD (Network Block Device) server program"; + license = lib.licenses.gpl2; + maintainers = [ lib.maintainers.volth ]; + platforms = lib.platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/yggdrasil/change-runtime-dir.patch b/nixpkgs/pkgs/tools/networking/yggdrasil/change-runtime-dir.patch new file mode 100644 index 000000000000..b4edc6a83871 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/yggdrasil/change-runtime-dir.patch @@ -0,0 +1,12 @@ +diff -ruN a/src/defaults/defaults_linux.go b/src/defaults/defaults_linux.go +--- a/src/defaults/defaults_linux.go 2019-06-17 10:23:09.495613784 -0700 ++++ b/src/defaults/defaults_linux.go 2019-07-01 10:17:11.295669440 -0700 +@@ -7,7 +7,7 @@ + func GetDefaults() platformDefaultParameters { + return platformDefaultParameters{ + // Admin +- DefaultAdminListen: "unix:///var/run/yggdrasil.sock", ++ DefaultAdminListen: "unix:///var/run/yggdrasil/yggdrasil.sock", + + // Configuration (used for yggdrasilctl) + DefaultConfigFile: "/etc/yggdrasil.conf", diff --git a/nixpkgs/pkgs/tools/networking/yggdrasil/default.nix b/nixpkgs/pkgs/tools/networking/yggdrasil/default.nix new file mode 100644 index 000000000000..8228132b5c84 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/yggdrasil/default.nix @@ -0,0 +1,41 @@ +{ lib, buildGoModule, fetchFromGitHub, nixosTests }: + +buildGoModule rec { + pname = "yggdrasil"; + version = "0.3.16"; + + src = fetchFromGitHub { + owner = "yggdrasil-network"; + repo = "yggdrasil-go"; + rev = "v${version}"; + sha256 = "sha256-uUF0zkgtzdMZB/GKOtawjn7AQBkRoiAEj9nUUmpQSVQ="; + }; + + vendorSha256 = "sha256-619PSqd7pl3Akj/kzLQhDIp1adumBGhLrzQsZvMzC7w="; + + doCheck = false; + + # Change the default location of the management socket on Linux + # systems so that the yggdrasil system service unit does not have to + # be granted write permission to /run. + patches = [ ./change-runtime-dir.patch ]; + + subPackages = [ "cmd/yggdrasil" "cmd/yggdrasilctl" ]; + + buildFlagsArray = '' + -ldflags= + -X github.com/yggdrasil-network/yggdrasil-go/src/version.buildVersion=${version} + -X github.com/yggdrasil-network/yggdrasil-go/src/version.buildName=${pname} + -s -w + ''; + + passthru.tests.basic = nixosTests.yggdrasil; + + meta = with lib; { + description = + "An experiment in scalable routing as an encrypted IPv6 overlay network"; + homepage = "https://yggdrasil-network.github.io/"; + license = licenses.lgpl3; + maintainers = with maintainers; [ ehmry gazally lassulus ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/yrd/default.nix b/nixpkgs/pkgs/tools/networking/yrd/default.nix new file mode 100644 index 000000000000..75a89b859fe8 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/yrd/default.nix @@ -0,0 +1,27 @@ +{ lib, fetchFromGitHub, pythonPackages }: + +let + pname = "yrd"; + version = "0.5.3"; + sha256 = "1yx1hr8z4cvlb3yi24dwafs0nxq41k4q477jc9q24w61a0g662ps"; + +in pythonPackages.buildPythonApplication { + name = "${pname}-${version}"; + + src = fetchFromGitHub { + owner = "kpcyrd"; + repo = pname; + rev = "v${version}"; + inherit sha256; + }; + + propagatedBuildInputs = with pythonPackages; [ argh ]; + + meta = with lib; { + description = "Cjdns swiss army knife"; + maintainers = with maintainers; [ akru ]; + platforms = platforms.linux; + license = licenses.gpl3; + homepage = "https://github.com/kpcyrd/yrd"; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/ytcc/default.nix b/nixpkgs/pkgs/tools/networking/ytcc/default.nix new file mode 100644 index 000000000000..6bd12963b7ee --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/ytcc/default.nix @@ -0,0 +1,47 @@ +{ lib, python3Packages, fetchFromGitHub, gettext }: + +python3Packages.buildPythonApplication rec { + pname = "ytcc"; + version = "2.2.0"; + + src = fetchFromGitHub { + owner = "woefe"; + repo = "ytcc"; + rev = "v${version}"; + sha256 = "1rhnrmanad10zy2as9q5wjfjlk18f51vf801syyfgxvk0pdcsk6w"; + }; + + nativeBuildInputs = [ gettext ]; + + propagatedBuildInputs = with python3Packages; [ + click + feedparser + lxml + sqlalchemy + youtube-dl + wcwidth + ]; + + checkInputs = with python3Packages; [ nose pytestCheckHook ]; + + # Disable tests that touch network or shell out to commands + disabledTests = [ + "get_channels" + "play_video" + "download_videos" + "update_all" + "add_channel_duplicate" + "test_subscribe" + "test_import" + "test_import_duplicate" + "test_update" + "test_download" + ]; + + meta = { + description = "Command Line tool to keep track of your favourite YouTube channels without signing up for a Google account"; + homepage = "https://github.com/woefe/ytcc"; + license = lib.licenses.gpl3Plus; + maintainers = with lib.maintainers; [ marius851000 ]; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/zap/default.nix b/nixpkgs/pkgs/tools/networking/zap/default.nix new file mode 100644 index 000000000000..bccc840a27a4 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/zap/default.nix @@ -0,0 +1,45 @@ +{ lib, stdenv, fetchurl, jre, runtimeShell }: + +stdenv.mkDerivation rec { + pname = "zap"; + version = "2.10.0"; + src = fetchurl { + url = "https://github.com/zaproxy/zaproxy/releases/download/v${version}/ZAP_${version}_Linux.tar.gz"; + sha256 = "1mz9s56pbs62g4pnd1ml8y6jpf9ilisdwwvjv5kn6yxrcdi2zzqh"; + }; + + buildInputs = [ jre ]; + + # From https://github.com/zaproxy/zaproxy/blob/master/zap/src/main/java/org/parosproxy/paros/Constant.java + version_tag = "2010000"; + + # Copying config and adding version tag before first use to avoid permission + # issues if zap tries to copy config on it's own. + installPhase = '' + mkdir -p "$out/bin" "$out/share" + cp -pR . "$out/share/${pname}/" + + cat >> "$out/bin/${pname}" << EOF + #!${runtimeShell} + export PATH="${lib.makeBinPath [ jre ]}:\$PATH" + export JAVA_HOME='${jre}' + if ! [ -f "~/.ZAP/config.xml" ];then + mkdir -p "\$HOME/.ZAP" + head -n 2 $out/share/${pname}/xml/config.xml > "\$HOME/.ZAP/config.xml" + echo "<version>${version_tag}</version>" >> "\$HOME/.ZAP/config.xml" + tail -n +3 $out/share/${pname}/xml/config.xml >> "\$HOME/.ZAP/config.xml" + fi + exec "$out/share/${pname}/zap.sh" "\$@" + EOF + + chmod u+x "$out/bin/${pname}" + ''; + + meta = with lib; { + homepage = "https://www.owasp.org/index.php/ZAP"; + description = "Java application for web penetration testing"; + maintainers = with maintainers; [ mog ]; + platforms = platforms.linux; + license = licenses.asl20; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/zerotierone/default.nix b/nixpkgs/pkgs/tools/networking/zerotierone/default.nix new file mode 100644 index 000000000000..4a44843e947b --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/zerotierone/default.nix @@ -0,0 +1,56 @@ +{ lib, stdenv, buildPackages, fetchFromGitHub, openssl, lzo, zlib, iproute2, ronn }: + +stdenv.mkDerivation rec { + pname = "zerotierone"; + version = "1.6.5"; + + src = fetchFromGitHub { + owner = "zerotier"; + repo = "ZeroTierOne"; + rev = version; + sha256 = "0dlnrb59vnxa3pjkgfqd5jil9kl6axh23v0bffi4kx8jwzpdwas8"; + }; + + preConfigure = '' + patchShebangs ./doc/build.sh + substituteInPlace ./doc/build.sh \ + --replace '/usr/bin/ronn' '${buildPackages.ronn}/bin/ronn' \ + + substituteInPlace ./make-linux.mk \ + --replace 'armv5' 'armv6' + ''; + + + nativeBuildInputs = [ ronn ]; + buildInputs = [ openssl lzo zlib iproute2 ]; + + enableParallelBuilding = true; + + buildFlags = [ "all" "selftest" ]; + + doCheck = stdenv.hostPlatform == stdenv.buildPlatform; + checkPhase = '' + ./zerotier-selftest + ''; + + installPhase = '' + install -Dt "$out/bin/" zerotier-one + ln -s $out/bin/zerotier-one $out/bin/zerotier-idtool + ln -s $out/bin/zerotier-one $out/bin/zerotier-cli + + mkdir -p $man/share/man/man8 + for cmd in zerotier-one.8 zerotier-cli.1 zerotier-idtool.1; do + cat doc/$cmd | gzip -9n > $man/share/man/man8/$cmd.gz + done + ''; + + outputs = [ "out" "man" ]; + + meta = with lib; { + description = "Create flat virtual Ethernet networks of almost unlimited size"; + homepage = "https://www.zerotier.com"; + license = licenses.bsl11; + maintainers = with maintainers; [ sjmackenzie zimbatm ehmry obadz danielfullmer ]; + platforms = platforms.all; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/zs-apc-spdu-ctl/default.nix b/nixpkgs/pkgs/tools/networking/zs-apc-spdu-ctl/default.nix new file mode 100644 index 000000000000..1a3d3ed7a355 --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/zs-apc-spdu-ctl/default.nix @@ -0,0 +1,36 @@ +{ cmake +, fetchFromGitHub +, fping +, lib +, libowlevelzs +, net-snmp +, stdenv +}: + +# TODO: add a services entry for the /etc/zs-apc-spdu.conf file +stdenv.mkDerivation rec { + pname = "zs-apc-spdu-ctl"; + version = "0.0.2"; + + src = fetchFromGitHub { + owner = "zseri"; + repo = "zs-apc-spdu-ctl"; + rev = "v${version}"; + sha256 = "TMV9ETWBVeXq6tZ2e0CrvHBXoyKfOLCQurjBdf/iw/M="; + }; + + nativeBuildInputs = [ cmake ]; + buildInputs = [ libowlevelzs net-snmp ]; + + postPatch = '' + substituteInPlace src/confent.cxx \ + --replace /usr/sbin/fping "${fping}/bin/fping" + ''; + + meta = with lib; { + description = "APC SPDU control utility"; + license = licenses.mit; + maintainers = with maintainers; [ zseri ]; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/zs-wait4host/default.nix b/nixpkgs/pkgs/tools/networking/zs-wait4host/default.nix new file mode 100644 index 000000000000..b6b4c985dfea --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/zs-wait4host/default.nix @@ -0,0 +1,34 @@ +{ coreutils, fetchurl, fping, lib, stdenvNoCC }: + +stdenvNoCC.mkDerivation rec { + pname = "zs-wait4host"; + version = "0.3.2"; + + src = fetchurl { + url = "https://ytrizja.de/distfiles/${pname}-${version}.tar.gz"; + sha256 = "9F1264BDoGlRR7bWlRXhfyvxWio4ydShKmabUQEIz9I="; + }; + + postPatch = '' + for i in zs-wait4host zs-wait4host-inf; do + substituteInPlace "$i" \ + --replace '$(zs-guess-fping)' '${fping}/bin/fping' \ + --replace ' sleep ' ' ${coreutils}/bin/sleep ' \ + --replace '[ "$FPING" ] || exit 1' "" + done + ''; + + installPhase = '' + runHook preInstall + install -D -t $out/bin zs-wait4host zs-wait4host-inf + runHook postInstall + ''; + + meta = with lib; { + description = "Wait for a host to come up/go down"; + homepage = "https://ytrizja.de/"; + license = licenses.gpl3Plus; + maintainers = with maintainers; [ zseri ]; + platforms = platforms.all; + }; +} diff --git a/nixpkgs/pkgs/tools/networking/zssh/default.nix b/nixpkgs/pkgs/tools/networking/zssh/default.nix new file mode 100644 index 000000000000..07b7a8441b8e --- /dev/null +++ b/nixpkgs/pkgs/tools/networking/zssh/default.nix @@ -0,0 +1,39 @@ +{ lib, stdenv, fetchurl, readline }: + +let + version = "1.5c"; +in stdenv.mkDerivation rec { + pname = "zssh"; + inherit version; + + src = fetchurl { + url = "mirror://sourceforge/zssh/${pname}-${version}.tgz"; + sha256 = "06z73iq59lz8ibjrgs7d3xl39vh9yld1988yx8khssch4pw41s52"; + }; + + buildInputs = [ readline ]; + + patches = [ + # Cargo-culted from Arch, returns “out of pty's” without it + (fetchurl { + name = "fix_use_ptmx_on_arch.patch"; + url = "https://git.archlinux.org/svntogit/community.git/plain/trunk/fix_use_ptmx_on_arch.patch?h=packages/zssh&id=0a7c92543f9309856d02e31196f06d7c3eaa8b67"; + sha256 = "12daw9wpy58ql882zww945wk9cg2adwp8qsr5rvazx0xq0qawgbr"; + }) + ]; + + patchFlags = [ "-p0" ]; + + # The makefile does not create the directories + postBuild = '' + install -dm755 "$out"/{bin,man/man1} + ''; + + meta = { + description = "SSH and Telnet client with ZMODEM file transfer capability"; + homepage = "http://zssh.sourceforge.net/"; + license = lib.licenses.gpl2; + maintainers = [ ]; # required by deepin-terminal + platforms = lib.platforms.linux; + }; +} |