backrest: fix tests on Darwin

+10 -4
+10 -4
pkgs/by-name/ba/backrest/package.nix
··· 2 2 buildGoModule, 3 3 fetchFromGitHub, 4 4 gzip, 5 + iana-etc, 5 6 lib, 7 + libredirect, 6 8 nodejs, 7 9 pnpm_9, 8 10 restic, ··· 76 78 go generate -skip="npm" ./... 77 79 ''; 78 80 79 - nativeCheckInputs = [ util-linux ]; 81 + nativeCheckInputs = [ 82 + util-linux 83 + ] 84 + ++ lib.optionals stdenv.hostPlatform.isDarwin [ libredirect.hook ]; 80 85 81 86 checkFlags = 82 87 let ··· 96 101 # Use restic from nixpkgs, otherwise download fails in sandbox 97 102 export BACKREST_RESTIC_COMMAND="${restic}/bin/restic" 98 103 export HOME=$(pwd) 104 + '' 105 + + lib.optionalString (stdenv.hostPlatform.isDarwin) '' 106 + export NIX_REDIRECTS=/etc/protocols=${iana-etc}/etc/protocols:/etc/services=${iana-etc}/etc/services 99 107 ''; 100 108 101 - # skip tests on darwin due to /etc/protocols failure 102 - # `__darwinAllowLocalNetworking = true;` wasn't sufficient 103 - doCheck = !stdenv.isDarwin; 109 + doCheck = true; 104 110 105 111 postInstall = '' 106 112 wrapProgram $out/bin/backrest \