From 1c26e0e7a9b5e6306e7cfaa16989e2d203e0ff42 Mon Sep 17 00:00:00 2001 From: Zahrun Date: Tue, 10 Jun 2025 15:52:36 +0530 Subject: [PATCH] speedify: init at 15.6.4-12495 Co-authored-by: Sandro Co-authored-by: emaryn <197520219+emaryn@users.noreply.github.com> --- .../manual/release-notes/rl-2511.section.md | 2 + nixos/modules/module-list.nix | 1 + .../modules/services/networking/speedify.nix | 59 ++++++++++++++++++ pkgs/by-name/sp/speedify/package.nix | 61 +++++++++++++++++++ 4 files changed, 123 insertions(+) create mode 100755 nixos/modules/services/networking/speedify.nix create mode 100755 pkgs/by-name/sp/speedify/package.nix diff --git a/nixos/doc/manual/release-notes/rl-2511.section.md b/nixos/doc/manual/release-notes/rl-2511.section.md index 9e5212541d47..d3cff7b638e7 100644 --- a/nixos/doc/manual/release-notes/rl-2511.section.md +++ b/nixos/doc/manual/release-notes/rl-2511.section.md @@ -54,6 +54,8 @@ - [qBittorrent](https://www.qbittorrent.org/), is a bittorrent client programmed in C++ / Qt that uses libtorrent by Arvid Norberg. Available as [services.qbittorrent](#opt-services.qbittorrent.enable). +- [Speedify](https://speedify.com/), a proprietary VPN which allows combining multiple internet connections (Wi-Fi, 4G, 5G, Ethernet, Starlink, Satellite, and more) to improve the stability, speed, and security of online experiences. Available as [services.speedify](#opt-services.speedify.enable). + - [Szurubooru](https://github.com/rr-/szurubooru), an image board engine inspired by services such as Danbooru, dedicated for small and medium communities. Available as [services.szurubooru](#opt-services.szurubooru.enable). - The [Neat IP Address Planner](https://spritelink.github.io/NIPAP/) (NIPAP) can now be enabled through [services.nipap.enable](#opt-services.nipap.enable). diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index ccddf7c3e8fb..d18f68e0c196 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -1335,6 +1335,7 @@ ./services/networking/soju.nix ./services/networking/solanum.nix ./services/networking/spacecookie.nix + ./services/networking/speedify.nix ./services/networking/spiped.nix ./services/networking/squid.nix ./services/networking/ssh/sshd.nix diff --git a/nixos/modules/services/networking/speedify.nix b/nixos/modules/services/networking/speedify.nix new file mode 100755 index 000000000000..a1291d4ad732 --- /dev/null +++ b/nixos/modules/services/networking/speedify.nix @@ -0,0 +1,59 @@ +{ + config, + lib, + pkgs, + ... +}: +let + cfg = config.services.speedify; +in +{ + options.services.speedify = { + enable = lib.mkOption { + type = lib.types.bool; + default = false; + description = '' + This option enables Speedify daemon. + This sets {option}`networking.firewall.checkReversePath` to "loose", which might be undesirable for security. + ''; + }; + + package = lib.mkPackageOption pkgs "speedify" { }; + }; + + config = lib.mkIf cfg.enable { + boot.kernelModules = [ "tun" ]; + + networking.firewall.checkReversePath = "loose"; + + systemd.services.speedify = { + description = "Speedify Service"; + wantedBy = [ "multi-user.target" ]; + wants = [ + "network.target" + "network-online.target" + ]; + after = [ + "network-online.target" + ] + ++ lib.optional config.networking.networkmanager.enable "NetworkManager.service"; + path = [ + pkgs.procps + pkgs.nettools + ]; + serviceConfig = { + ExecStart = "${cfg.package}/share/speedify/SpeedifyStartup.sh"; + ExecStop = "${cfg.package}/share/speedify/SpeedifyShutdown.sh"; + Restart = "on-failure"; + RestartSec = 5; + TimeoutStartSec = 30; + TimeoutStopSec = 30; + Type = "forking"; + }; + }; + }; + + meta.maintainers = with lib.maintainers; [ + zahrun + ]; +} diff --git a/pkgs/by-name/sp/speedify/package.nix b/pkgs/by-name/sp/speedify/package.nix new file mode 100755 index 000000000000..ad592e7b6417 --- /dev/null +++ b/pkgs/by-name/sp/speedify/package.nix @@ -0,0 +1,61 @@ +{ + lib, + stdenv, + dpkg, + fetchurl, + procps, + net-tools, + autoPatchelfHook, +}: +stdenv.mkDerivation rec { + pname = "speedify"; + version = "15.6.4-12495"; + + src = fetchurl { + url = "https://apt.connectify.me/pool/main/s/speedify/speedify_${version}_amd64.deb"; + hash = "sha256-b8J7JqVxuRREC16DeKD7hOBX4IZMbJPLArLmPtnDUB4="; + }; + + nativeBuildInputs = [ + dpkg + autoPatchelfHook + ]; + + buildInputs = [ + procps + net-tools + ]; + + installPhase = '' + runHook preInstall + + substituteInPlace "usr/share/speedify/SpeedifyStartup.sh" "usr/share/speedify/SpeedifyShutdown.sh" "usr/share/speedify/GenerateLogs.sh" \ + --replace-fail '/usr/share/' "$out/share/" + substituteInPlace "usr/share/speedify/SpeedifyStartup.sh" \ + --replace-fail 'logs' "/var/log/speedify" + + mkdir -p $out/share/ + mv usr/share $out/ + mkdir -p $out/etc/ + mv lib/systemd $out/etc/ + + mkdir -p $out/bin + ln -s $out/share/speedify/speedify_cli $out/bin/speedify_cli + + runHook postInstall + ''; + + meta = { + homepage = "https://speedify.com/"; + description = "Use multiple internet connections in parallel"; + longDescription = '' + Combine multiple internet connections (Wi-Fi, 4G, 5G, Ethernet, Starlink, Satellite, and more) + to improve the stability, speed, and security of your online experiences. + Check corresponding option {option}`services.speedify.enable` + ''; + sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ]; + license = lib.licenses.unfree; + platforms = [ "x86_64-linux" ]; + maintainers = with lib.maintainers; [ zahrun ]; + }; +}