diff --git a/pkgs/tools/networking/narrowlink/Cargo.lock.patch b/pkgs/tools/networking/narrowlink/Cargo.lock.patch new file mode 100644 index 00000000000000..71e87a95c93de3 --- /dev/null +++ b/pkgs/tools/networking/narrowlink/Cargo.lock.patch @@ -0,0 +1,170 @@ +diff --git a/Cargo.lock b/Cargo.lock +index 2d5af9d..920b315 100644 +--- a/Cargo.lock ++++ b/Cargo.lock +@@ -952,7 +952,7 @@ dependencies = [ + + [[package]] + name = "narrowlink-agent" +-version = "0.1.3" ++version = "0.1.4" + dependencies = [ + "clap_lex", + "dirs", +@@ -961,8 +961,8 @@ dependencies = [ + "futures-util", + "hmac", + "log", +- "narrowlink-network", +- "narrowlink-types", ++ "narrowlink-network 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", ++ "narrowlink-types 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "serde", + "serde_json", + "serde_yaml", +@@ -976,7 +976,7 @@ dependencies = [ + + [[package]] + name = "narrowlink-client" +-version = "0.1.3" ++version = "0.1.4" + dependencies = [ + "chrono", + "clap_lex", +@@ -988,8 +988,8 @@ dependencies = [ + "futures-util", + "hmac", + "log", +- "narrowlink-network", +- "narrowlink-types", ++ "narrowlink-network 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", ++ "narrowlink-types 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "rand", + "regex", + "serde", +@@ -1006,7 +1006,7 @@ dependencies = [ + + [[package]] + name = "narrowlink-gateway" +-version = "0.1.3" ++version = "0.1.4" + dependencies = [ + "askama", + "async-trait", +@@ -1016,8 +1016,8 @@ dependencies = [ + "futures-util", + "hyper", + "instant-acme", +- "narrowlink-network", +- "narrowlink-types", ++ "narrowlink-network 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", ++ "narrowlink-types 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "pem 3.0.2", + "rcgen", + "rustls", +@@ -1037,7 +1037,7 @@ dependencies = [ + + [[package]] + name = "narrowlink-network" +-version = "0.1.3" ++version = "0.1.4" + dependencies = [ + "bytes", + "chacha20poly1305", +@@ -1045,7 +1045,30 @@ dependencies = [ + "futures-util", + "hyper", + "log", +- "narrowlink-types", ++ "narrowlink-types 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", ++ "serde", ++ "serde_json", ++ "tokio", ++ "tokio-native-tls", ++ "tokio-rustls", ++ "tokio-tungstenite", ++ "tungstenite", ++ "webpki-roots", ++] ++ ++[[package]] ++name = "narrowlink-network" ++version = "0.1.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "53a3e0af078492420b410b56ffeccd77e2c0d5ac31d53cc404e6b2f14ebde31b" ++dependencies = [ ++ "bytes", ++ "chacha20poly1305", ++ "env_logger", ++ "futures-util", ++ "hyper", ++ "log", ++ "narrowlink-types 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "serde", + "serde_json", + "tokio", +@@ -1058,19 +1081,38 @@ dependencies = [ + + [[package]] + name = "narrowlink-token-generator" +-version = "0.1.3" ++version = "0.1.4" + dependencies = [ + "clap_lex", + "dirs", + "jsonwebtoken", +- "narrowlink-types", ++ "narrowlink-types 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "serde", + "serde_yaml", + ] + + [[package]] + name = "narrowlink-types" +-version = "0.1.3" ++version = "0.1.4" ++dependencies = [ ++ "chrono", ++ "hmac", ++ "ipnet", ++ "jsonwebtoken", ++ "regex", ++ "serde", ++ "serde_json", ++ "sha3", ++ "uuid", ++ "validator", ++ "wildmatch", ++] ++ ++[[package]] ++name = "narrowlink-types" ++version = "0.1.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "06a2e4b95bcc18504b455bff0e8d23321c8fa3bd68526f7bf1567f918f36925f" + dependencies = [ + "chrono", + "hmac", +@@ -1661,18 +1703,18 @@ dependencies = [ + + [[package]] + name = "serde" +-version = "1.0.185" ++version = "1.0.186" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "be9b6f69f1dfd54c3b568ffa45c310d6973a5e5148fd40cf515acaf38cf5bc31" ++checksum = "9f5db24220c009de9bd45e69fb2938f4b6d2df856aa9304ce377b3180f83b7c1" + dependencies = [ + "serde_derive", + ] + + [[package]] + name = "serde_derive" +-version = "1.0.185" ++version = "1.0.186" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "dc59dfdcbad1437773485e0367fea4b090a2e0a16d9ffc46af47764536a298ec" ++checksum = "5ad697f7e0b65af4983a4ce8f56ed5b357e8d3c36651bf6a7e13639c17b8e670" + dependencies = [ + "proc-macro2", + "quote", diff --git a/pkgs/tools/networking/narrowlink/default.nix b/pkgs/tools/networking/narrowlink/default.nix new file mode 100644 index 00000000000000..68732b518ca94d --- /dev/null +++ b/pkgs/tools/networking/narrowlink/default.nix @@ -0,0 +1,43 @@ +{ lib +, rustPlatform +, fetchFromGitHub +, pkg-config +, openssl +, stdenv +, darwin +}: + +rustPlatform.buildRustPackage rec { + pname = "narrowlink"; + version = "0.1.4"; + + src = fetchFromGitHub { + owner = "narrowlink"; + repo = "narrowlink"; + rev = version; + hash = "sha256-vef7ctauSl0xfYNqjvl8wLGbqzzkMItz1O7sT1UZ4b0="; + }; + + # Cargo.lock is outdated + cargoPatches = [ ./Cargo.lock.patch ]; + + cargoHash = "sha256-craOunscE6o8PXtZFCYpkFH/amkuLOK7SrV+XHbS2GM="; + + nativeBuildInputs = [ + pkg-config + ]; + + buildInputs = [ + openssl + ] ++ lib.optionals stdenv.isDarwin [ + darwin.apple_sdk_11_0.frameworks.IOKit + darwin.apple_sdk_11_0.frameworks.Security + ]; + + meta = { + description = "Narrowlink securely connects devices and services together, even when both nodes are behind separate NAT"; + homepage = "https://github.com/narrowlink/narrowlink"; + license = with lib.licenses; [ agpl3Only mpl20 ]; # the gateway component is AGPLv3, the rest is MPLv2 + maintainers = with lib.maintainers; [ dit7ya ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 9ead406f346d82..cd06496a5e8faf 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -40177,6 +40177,8 @@ with pkgs; mysides = callPackage ../os-specific/darwin/mysides { }; + narrowlink = callPackage ../tools/networking/narrowlink { }; + nar-serve = callPackage ../tools/nix/nar-serve { }; neo = callPackage ../applications/misc/neo { };