Commit 1dcba055 authored by hacker1024's avatar hacker1024
Browse files

buildDartApplication: Supply CA bundle to Dart in FOD

DART_VM_OPTIONS is not effective.
parent 0606fd67
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
{ lib, stdenv, fetchDartDeps, writeText, dartHooks, makeWrapper, dart, nodejs, darwin }:
{ lib, stdenv, fetchDartDeps, runCommand, writeText, dartHooks, makeWrapper, dart, cacert, nodejs, darwin }:

{ pubGetScript ? "dart pub get"

@@ -30,7 +30,13 @@
}@args:

let
  dartDeps = fetchDartDeps {
  dartDeps = (fetchDartDeps.override {
    dart = runCommand "dart-fod" { nativeBuildInputs = [ makeWrapper ]; } ''
      mkdir -p "$out/bin"
      makeWrapper "${dart}/bin/dart" "$out/bin/dart" \
        --add-flags "--root-certs-file=${cacert}/etc/ssl/certs/ca-bundle.crt"
    '';
  }) {
    buildDrvArgs = args;
    inherit pubGetScript vendorHash pubspecLockFile;
  };
+1 −7
Original line number Diff line number Diff line
@@ -79,13 +79,7 @@ let

      installPhase = ''
        _pub_get() {
          (
            # Dart does not respect SSL_CERT_FILE.
            # https://github.com/dart-lang/sdk/issues/48506
            export DART_VM_OPTIONS="--root-certs-file=$SSL_CERT_FILE"

          ${pubGetScript}
          )
        }

        # so we can use lock, diff yaml