git: add osxkeychainSupport option (#112503)

in order to be able to disable osxkeychain credential helper if no
wanted / necessary. Keep it `true` by default such that current logic is
not affected.

Signed-off-by: Andreas Schmid <service@aaschmid.de>

authored by

Andreas Schmid and committed by
GitHub
b5a137b2 b14d8bae

+6 -4
+6 -4
pkgs/applications/version-management/git-and-tools/git/default.nix
··· 8 8 , svnSupport, subversionClient, perlLibs, smtpPerlLibs 9 9 , perlSupport ? true 10 10 , nlsSupport ? true 11 + , osxkeychainSupport ? stdenv.isDarwin 11 12 , guiSupport 12 13 , withManual ? true 13 14 , pythonSupport ? true ··· 19 20 , gzip # needed at runtime by gitweb.cgi 20 21 }: 21 22 23 + assert osxkeychainSupport -> stdenv.isDarwin; 22 24 assert sendEmailSupport -> perlSupport; 23 25 assert svnSupport -> perlSupport; 24 26 ··· 115 117 make -C contrib/subtree 116 118 '' + (lib.optionalString perlSupport '' 117 119 make -C contrib/diff-highlight 118 - '') + (lib.optionalString stdenv.isDarwin '' 120 + '') + (lib.optionalString osxkeychainSupport '' 119 121 make -C contrib/credential/osxkeychain 120 122 '') + (lib.optionalString withLibsecret '' 121 123 make -C contrib/credential/libsecret ··· 129 131 130 132 installFlags = [ "NO_INSTALL_HARDLINKS=1" ]; 131 133 132 - preInstall = (lib.optionalString stdenv.isDarwin '' 134 + preInstall = (lib.optionalString osxkeychainSupport '' 133 135 mkdir -p $out/bin 134 136 ln -s $out/share/git/contrib/credential/osxkeychain/git-credential-osxkeychain $out/bin/ 135 137 rm -f $PWD/contrib/credential/osxkeychain/git-credential-osxkeychain.o ··· 248 250 notSupported "$out/$prog" 249 251 done 250 252 '') 251 - + lib.optionalString stdenv.isDarwin '' 252 - # enable git-credential-osxkeychain by default if darwin 253 + + lib.optionalString osxkeychainSupport '' 254 + # enable git-credential-osxkeychain on darwin if desired (default) 253 255 mkdir -p $out/etc 254 256 cat > $out/etc/gitconfig << EOF 255 257 [credential]