From 1ebaeb4efa5b257fccbfe20870322188db8d69db Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Thu, 30 Jan 2025 10:35:32 +0100 Subject: [PATCH 1/2] mullvad: fix tests in darwin sandbox --- pkgs/applications/networking/mullvad/mullvad.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/applications/networking/mullvad/mullvad.nix b/pkgs/applications/networking/mullvad/mullvad.nix index 3b29d73675f8..6935218bcb04 100644 --- a/pkgs/applications/networking/mullvad/mullvad.nix +++ b/pkgs/applications/networking/mullvad/mullvad.nix @@ -101,6 +101,7 @@ rustPlatform.buildRustPackage rec { --set-default MULLVAD_RESOURCE_DIR "$out/share/mullvad" ''; + __darwinAllowLocalNetworking = true; passthru = { inherit libwg; inherit openvpn-mullvad; From e5ff76fa4937d8d67bdfc12aaac0a98e1884c0cc Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Thu, 30 Jan 2025 10:48:44 +0100 Subject: [PATCH 2/2] mullvad: improve --- .../networking/mullvad/mullvad.nix | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/pkgs/applications/networking/mullvad/mullvad.nix b/pkgs/applications/networking/mullvad/mullvad.nix index 6935218bcb04..9e6fe6ff56d9 100644 --- a/pkgs/applications/networking/mullvad/mullvad.nix +++ b/pkgs/applications/networking/mullvad/mullvad.nix @@ -16,6 +16,7 @@ , shadowsocks-rust , installShellFiles , writeShellScriptBin +, versionCheckHook, }: let # NOTE(cole-h): This is necessary because wireguard-go-rs executes go in its build.rs (whose goal @@ -33,7 +34,7 @@ rustPlatform.buildRustPackage rec { src = fetchFromGitHub { owner = "mullvad"; repo = "mullvadvpn-app"; - rev = version; + tag = version; fetchSubmodules = true; hash = "sha256-5GcYiyvulsOFepguBcBec98juw22YTbT7yvZJUOJUwc="; }; @@ -102,15 +103,24 @@ rustPlatform.buildRustPackage rec { ''; __darwinAllowLocalNetworking = true; + + nativeInstallCheckInputs = [ + versionCheckHook + ]; + versionCheckProgramArg = [ "--version" ]; + doInstallCheck = true; + passthru = { inherit libwg; inherit openvpn-mullvad; }; - meta = with lib; { + meta = { description = "Mullvad VPN command-line client tools"; homepage = "https://github.com/mullvad/mullvadvpn-app"; - license = licenses.gpl3Only; - maintainers = with maintainers; [ cole-h ]; + changelog = "https://github.com/mullvad/mullvadvpn-app/blob/2025.2/CHANGELOG.md"; + license = lib.licenses.gpl3Only; + maintainers = with lib.maintainers; [ cole-h ]; + mainProgram = "mullvad"; }; }