diff --git a/pkgs/by-name/iv/ivpn-service/package.nix b/pkgs/by-name/iv/ivpn-service/package.nix new file mode 100644 index 000000000000..98db81a7c214 --- /dev/null +++ b/pkgs/by-name/iv/ivpn-service/package.nix @@ -0,0 +1,102 @@ +{ + buildGoModule, + fetchFromGitHub, + lib, + wirelesstools, + makeWrapper, + wireguard-tools, + openvpn, + obfs4, + iproute2, + dnscrypt-proxy, + iptables, + gawk, + util-linux, + nix-update-script, +}: +buildGoModule (finalAttrs: { + pname = "ivpn-service"; + version = "3.15.0"; + + buildInputs = [ wirelesstools ]; + nativeBuildInputs = [ makeWrapper ]; + + src = fetchFromGitHub { + owner = "ivpn"; + repo = "desktop-app"; + tag = "v${finalAttrs.version}"; + hash = "sha256-Y+oW/2WDkH/YydR+xSzEHPdCNKTmmsV4yEsju+OmDYE="; + }; + + modRoot = "daemon"; + vendorHash = "sha256-DVKSCcEeE7vI8aOYuEwk22n0wtF7MMDOyAgYoXYadwI="; + + proxyVendor = true; # .c file + + patches = [ ./permissions.patch ]; + + postPatch = '' + substituteInPlace daemon/service/platform/platform_linux.go \ + --replace 'openVpnBinaryPath = "/usr/sbin/openvpn"' \ + 'openVpnBinaryPath = "${openvpn}/bin/openvpn"' \ + --replace 'routeCommand = "/sbin/ip route"' \ + 'routeCommand = "${iproute2}/bin/ip route"' + + substituteInPlace daemon/netinfo/netinfo_linux.go \ + --replace 'retErr := shell.ExecAndProcessOutput(log, outParse, "", "/sbin/ip", "route")' \ + 'retErr := shell.ExecAndProcessOutput(log, outParse, "", "${iproute2}/bin/ip", "route")' + + substituteInPlace daemon/service/platform/platform_linux_release.go \ + --replace 'installDir := "/opt/ivpn"' "installDir := \"$out\"" \ + --replace 'obfsproxyStartScript = path.Join(installDir, "obfsproxy/obfs4proxy")' \ + 'obfsproxyStartScript = "${lib.getExe obfs4}"' \ + --replace 'wgBinaryPath = path.Join(installDir, "wireguard-tools/wg-quick")' \ + 'wgBinaryPath = "${wireguard-tools}/bin/wg-quick"' \ + --replace 'wgToolBinaryPath = path.Join(installDir, "wireguard-tools/wg")' \ + 'wgToolBinaryPath = "${wireguard-tools}/bin/wg"' \ + --replace 'dnscryptproxyBinPath = path.Join(installDir, "dnscrypt-proxy/dnscrypt-proxy")' \ + 'dnscryptproxyBinPath = "${dnscrypt-proxy}/bin/dnscrypt-proxy"' + ''; + + ldflags = [ + "-s" + "-w" + "-X github.com/ivpn/desktop-app/daemon/version._version=${finalAttrs.version}" + "-X github.com/ivpn/desktop-app/daemon/version._time=1970-01-01" + ]; + + postInstall = '' + mv $out/bin/{daemon,ivpn-service} + ''; + + postFixup = '' + mkdir -p $out/etc + cp -r $src/daemon/References/Linux/etc/* $out/etc/ + cp -r $src/daemon/References/common/etc/* $out/etc/ + + patchShebangs --build $out/etc/firewall.sh $out/etc/splittun.sh $out/etc/client.down $out/etc/client.up + + wrapProgram "$out/bin/ivpn-service" \ + --suffix PATH : ${ + lib.makeBinPath [ + iptables + gawk + util-linux + ] + } + ''; + + passthru.updateScript = nix-update-script { }; + + meta = { + description = "Official IVPN Desktop app service daemon"; + homepage = "https://www.ivpn.net/apps"; + changelog = "https://github.com/ivpn/desktop-app/releases/tag/v${finalAttrs.version}"; + license = lib.licenses.gpl3Only; + maintainers = with lib.maintainers; [ + urandom + blenderfreaky + ]; + mainProgram = "ivpn-service"; + }; +}) diff --git a/pkgs/tools/networking/ivpn/permissions.patch b/pkgs/by-name/iv/ivpn-service/permissions.patch similarity index 100% rename from pkgs/tools/networking/ivpn/permissions.patch rename to pkgs/by-name/iv/ivpn-service/permissions.patch diff --git a/pkgs/by-name/iv/ivpn-ui/package.nix b/pkgs/by-name/iv/ivpn-ui/package.nix index f55e3b12d323..8c5a79d4b851 100644 --- a/pkgs/by-name/iv/ivpn-ui/package.nix +++ b/pkgs/by-name/iv/ivpn-ui/package.nix @@ -9,23 +9,20 @@ makeWrapper, ivpn-service, }: -let - version = "3.14.34"; -in -buildNpmPackage { +buildNpmPackage (finalAttrs: { pname = "ivpn-ui"; - inherit version; + version = "3.15.0"; src = fetchFromGitHub { owner = "ivpn"; repo = "desktop-app"; - tag = "v${version}"; - hash = "sha256-Q96G5mJahJnXxpqJ8IF0oFie7l0Nd1p8drHH9NSpwEw="; + tag = "v${finalAttrs.version}"; + hash = "sha256-Y+oW/2WDkH/YydR+xSzEHPdCNKTmmsV4yEsju+OmDYE="; }; sourceRoot = "source/ui"; - npmDepsHash = "sha256-y/VxvSZUvcIuckJF87639i5pcVJLg8SDAbWmg5bO3/s="; + npmDepsHash = "sha256-OOBBUDJwTP2T/KqzJPRV+A9ncRmb14KBoAXqa0T6c58="; nativeBuildInputs = [ copyDesktopItems @@ -85,9 +82,9 @@ buildNpmPackage { mainProgram = "ivpn-ui"; homepage = "https://www.ivpn.net"; downloadPage = "https://github.com/ivpn/desktop-app"; - changelog = "https://github.com/ivpn/desktop-app/releases/tag/v${version}"; + changelog = "https://github.com/ivpn/desktop-app/releases/tag/v${finalAttrs.version}"; license = lib.licenses.gpl3Only; maintainers = with lib.maintainers; [ blenderfreaky ]; platforms = [ "x86_64-linux" ]; }; -} +}) diff --git a/pkgs/by-name/iv/ivpn/package.nix b/pkgs/by-name/iv/ivpn/package.nix new file mode 100644 index 000000000000..76c74c08932a --- /dev/null +++ b/pkgs/by-name/iv/ivpn/package.nix @@ -0,0 +1,50 @@ +{ + buildGoModule, + fetchFromGitHub, + lib, + wirelesstools, + nix-update-script, +}: +buildGoModule (finalAttrs: { + pname = "ivpn"; + version = "3.15.0"; + + buildInputs = [ wirelesstools ]; + + src = fetchFromGitHub { + owner = "ivpn"; + repo = "desktop-app"; + tag = "v${finalAttrs.version}"; + hash = "sha256-Y+oW/2WDkH/YydR+xSzEHPdCNKTmmsV4yEsju+OmDYE="; + }; + + modRoot = "cli"; + vendorHash = "sha256-xZ1tMiv06fE2wtpDagKjHiVTPYWpj32hM6n/v9ZcgrE="; + + proxyVendor = true; # .c file + + ldflags = [ + "-s" + "-w" + "-X github.com/ivpn/desktop-app/daemon/version._version=${finalAttrs.version}" + "-X github.com/ivpn/desktop-app/daemon/version._time=1970-01-01" + ]; + + postInstall = '' + mv $out/bin/{cli,ivpn} + ''; + + passthru.updateScript = nix-update-script { }; + + meta = { + description = "Official IVPN Desktop app"; + homepage = "https://www.ivpn.net/apps"; + changelog = "https://github.com/ivpn/desktop-app/releases/tag/v${finalAttrs.version}"; + license = lib.licenses.gpl3Only; + maintainers = with lib.maintainers; [ + urandom + blenderfreaky + ]; + mainProgram = "ivpn"; + }; +}) diff --git a/pkgs/tools/networking/ivpn/default.nix b/pkgs/tools/networking/ivpn/default.nix deleted file mode 100644 index 39299da1a681..000000000000 --- a/pkgs/tools/networking/ivpn/default.nix +++ /dev/null @@ -1,118 +0,0 @@ -{ - buildGoModule, - fetchFromGitHub, - lib, - wirelesstools, - makeWrapper, - wireguard-tools, - openvpn, - obfs4, - iproute2, - dnscrypt-proxy, - iptables, - gawk, - util-linux, - nix-update-script, -}: - -builtins.mapAttrs - ( - pname: attrs: - buildGoModule ( - attrs - // rec { - inherit pname; - version = "3.14.34"; - - buildInputs = [ - wirelesstools - ]; - - src = fetchFromGitHub { - owner = "ivpn"; - repo = "desktop-app"; - tag = "v${version}"; - hash = "sha256-Q96G5mJahJnXxpqJ8IF0oFie7l0Nd1p8drHH9NSpwEw="; - }; - - proxyVendor = true; # .c file - - ldflags = [ - "-s" - "-w" - "-X github.com/ivpn/desktop-app/daemon/version._version=${version}" - "-X github.com/ivpn/desktop-app/daemon/version._time=1970-01-01" - ]; - - postInstall = '' - mv $out/bin/{${attrs.modRoot},${pname}} - ''; - - passthru.updateScript = nix-update-script { }; - - meta = { - description = "Official IVPN Desktop app"; - homepage = "https://www.ivpn.net/apps"; - changelog = "https://github.com/ivpn/desktop-app/releases/tag/v${version}"; - license = lib.licenses.gpl3Only; - maintainers = with lib.maintainers; [ - urandom - blenderfreaky - ]; - mainProgram = "ivpn"; - }; - } - ) - ) - { - ivpn = { - modRoot = "cli"; - vendorHash = "sha256-xZ1tMiv06fE2wtpDagKjHiVTPYWpj32hM6n/v9ZcgrE="; - }; - ivpn-service = { - modRoot = "daemon"; - vendorHash = "sha256-DVKSCcEeE7vI8aOYuEwk22n0wtF7MMDOyAgYoXYadwI="; - nativeBuildInputs = [ makeWrapper ]; - - patches = [ ./permissions.patch ]; - postPatch = '' - substituteInPlace daemon/service/platform/platform_linux.go \ - --replace 'openVpnBinaryPath = "/usr/sbin/openvpn"' \ - 'openVpnBinaryPath = "${openvpn}/bin/openvpn"' \ - --replace 'routeCommand = "/sbin/ip route"' \ - 'routeCommand = "${iproute2}/bin/ip route"' - - substituteInPlace daemon/netinfo/netinfo_linux.go \ - --replace 'retErr := shell.ExecAndProcessOutput(log, outParse, "", "/sbin/ip", "route")' \ - 'retErr := shell.ExecAndProcessOutput(log, outParse, "", "${iproute2}/bin/ip", "route")' - - substituteInPlace daemon/service/platform/platform_linux_release.go \ - --replace 'installDir := "/opt/ivpn"' "installDir := \"$out\"" \ - --replace 'obfsproxyStartScript = path.Join(installDir, "obfsproxy/obfs4proxy")' \ - 'obfsproxyStartScript = "${lib.getExe obfs4}"' \ - --replace 'wgBinaryPath = path.Join(installDir, "wireguard-tools/wg-quick")' \ - 'wgBinaryPath = "${wireguard-tools}/bin/wg-quick"' \ - --replace 'wgToolBinaryPath = path.Join(installDir, "wireguard-tools/wg")' \ - 'wgToolBinaryPath = "${wireguard-tools}/bin/wg"' \ - --replace 'dnscryptproxyBinPath = path.Join(installDir, "dnscrypt-proxy/dnscrypt-proxy")' \ - 'dnscryptproxyBinPath = "${dnscrypt-proxy}/bin/dnscrypt-proxy"' - ''; - - postFixup = '' - mkdir -p $out/etc - cp -r $src/daemon/References/Linux/etc/* $out/etc/ - cp -r $src/daemon/References/common/etc/* $out/etc/ - - patchShebangs --build $out/etc/firewall.sh $out/etc/splittun.sh $out/etc/client.down $out/etc/client.up - - wrapProgram "$out/bin/ivpn-service" \ - --suffix PATH : ${ - lib.makeBinPath [ - iptables - gawk - util-linux - ] - } - ''; - }; - } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index b3c100c8a08b..48dc7cff6d71 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1066,11 +1066,6 @@ with pkgs; iroh-dns-server ; - inherit (callPackages ../tools/networking/ivpn/default.nix { }) - ivpn - ivpn-service - ; - kanata-with-cmd = kanata.override { withCmd = true; }; linux-router-without-wifi = linux-router.override { useWifiDependencies = false; };