File tree Expand file tree Collapse file tree
pkgs/build-support/fetchgit Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2121 postFetch ? ""
2222, preferLocalBuild ? true
2323, fetchLFS ? false
24+ , # Shell code to build a netrc file for BASIC auth
25+ netrcPhase ? null
26+ , # Impure env vars (https://nixos.org/nix/manual/#sec-advanced-attributes)
27+ # needed for netrcPhase
28+ netrcImpureEnvVars ? [ ]
2429} :
2530
2631/* NOTE:
@@ -64,10 +69,17 @@ stdenvNoCC.mkDerivation {
6469
6570 inherit url rev leaveDotGit fetchLFS fetchSubmodules deepClone branchName postFetch ;
6671
72+ postHook = if netrcPhase == null then null else ''
73+ ${ netrcPhase }
74+ # required that git uses the netrc file
75+ mv {,.}netrc
76+ export HOME=$PWD
77+ '' ;
78+
6779 GIT_SSL_CAINFO = "${ cacert } /etc/ssl/certs/ca-bundle.crt" ;
6880
69- impureEnvVars = lib . fetchers . proxyImpureEnvVars ++ [
70- "GIT_PROXY_COMMAND" "SOCKS_SERVER"
81+ impureEnvVars = lib . fetchers . proxyImpureEnvVars ++ netrcImpureEnvVars ++ [
82+ "GIT_PROXY_COMMAND" "NIX_GIT_SSL_CAINFO" " SOCKS_SERVER"
7183 ] ;
7284
7385 inherit preferLocalBuild ;
Original file line number Diff line number Diff line change @@ -17,6 +17,10 @@ branchName=$NIX_PREFETCH_GIT_BRANCH_NAME
1717out=${out:- }
1818http_proxy=${http_proxy:- }
1919
20+ # allow overwritting cacert's ca-bundle.crt with a custom one
21+ # this can be done by setting NIX_GIT_SSL_CAINFO and NIX_SSL_CERT_FILE enviroment variables for the nix-daemon
22+ GIT_SSL_CAINFO=${NIX_GIT_SSL_CAINFO:- $GIT_SSL_CAINFO }
23+
2024# populated by clone_user_rev()
2125fullRev=
2226humanReadableRev=
You can’t perform that action at this time.
0 commit comments