From 68cce8fdf474fd30ef784614e8b7307c06ae76ca Mon Sep 17 00:00:00 2001 From: Matt Moriarity Date: Sun, 27 Apr 2025 18:10:13 -0600 Subject: [PATCH 1/2] ghostunnel: fix darwin build --- pkgs/by-name/gh/ghostunnel/package.nix | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/pkgs/by-name/gh/ghostunnel/package.nix b/pkgs/by-name/gh/ghostunnel/package.nix index 2a3221b08c9e..464da25dc643 100644 --- a/pkgs/by-name/gh/ghostunnel/package.nix +++ b/pkgs/by-name/gh/ghostunnel/package.nix @@ -4,6 +4,8 @@ fetchFromGitHub, lib, nixosTests, + apple-sdk_12, + darwinMinVersionHook, }: buildGoModule rec { @@ -17,16 +19,20 @@ buildGoModule rec { hash = "sha256-NnRm1HEdfK6WI5ntilLSwdR2B5czG5CIcMFzl2TzEds="; }; - vendorHash = null; + vendorHash = "sha256-vP8OtjpYNMm1KkNfD3pmNrHh3HRy1GkzUbfLKWKhHbo="; deleteVendor = true; - # The certstore directory isn't recognized as a subpackage, but is when moved - # into the vendor directory. - postUnpack = '' - mkdir -p $sourceRoot/vendor/ghostunnel - mv $sourceRoot/certstore $sourceRoot/vendor/ghostunnel/ - ''; + buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ + apple-sdk_12 + (darwinMinVersionHook "12.0") + ]; + + # These tests don't exist for Linux, and on Darwin they attempt to use the macOS Keychain + # which doesn't work from a nix build. Presumably other platform implementations of the + # certstore would have similar issues, so it probably makes sense to skip them in + # general wherever they are available. + checkFlags = [ "-skip=^Test(ImportDelete|Signer|Certificate)(RSA|ECDSA|EC)$" ]; passthru.tests = { nixos = nixosTests.ghostunnel; @@ -34,7 +40,6 @@ buildGoModule rec { }; meta = with lib; { - broken = stdenv.hostPlatform.isDarwin; description = "TLS proxy with mutual authentication support for securing non-TLS backend applications"; homepage = "https://github.com/ghostunnel/ghostunnel#readme"; changelog = "https://github.com/ghostunnel/ghostunnel/releases/tag/v${version}"; From c27dd8a81571bafc2fee6493b52abdd76fd6feb9 Mon Sep 17 00:00:00 2001 From: Matt Moriarity Date: Sun, 27 Apr 2025 18:46:02 -0600 Subject: [PATCH 2/2] ghostunnel: add mjm as maintainer --- pkgs/by-name/gh/ghostunnel/package.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/gh/ghostunnel/package.nix b/pkgs/by-name/gh/ghostunnel/package.nix index 464da25dc643..4ad5562b358c 100644 --- a/pkgs/by-name/gh/ghostunnel/package.nix +++ b/pkgs/by-name/gh/ghostunnel/package.nix @@ -44,7 +44,10 @@ buildGoModule rec { homepage = "https://github.com/ghostunnel/ghostunnel#readme"; changelog = "https://github.com/ghostunnel/ghostunnel/releases/tag/v${version}"; license = licenses.asl20; - maintainers = with maintainers; [ roberth ]; + maintainers = with maintainers; [ + roberth + mjm + ]; mainProgram = "ghostunnel"; }; }