1{
2 lib,
3 fetchFromGitHub,
4 buildDotnetModule,
5 dotnetCorePackages,
6 libsecret,
7 git,
8 git-credential-manager,
9 gnupg,
10 pass,
11 testers,
12 withLibsecretSupport ? true,
13 withGpgSupport ? true,
14}:
15
16buildDotnetModule rec {
17 pname = "git-credential-manager";
18 version = "2.6.1";
19
20 src = fetchFromGitHub {
21 owner = "git-ecosystem";
22 repo = "git-credential-manager";
23 rev = "v${version}";
24 hash = "sha256-fzcGAcKOAEnBiAEYYyxKJ71xnixb5cz7FzR28/cKIFg=";
25 };
26
27 projectFile = "src/shared/Git-Credential-Manager/Git-Credential-Manager.csproj";
28 nugetDeps = ./deps.json;
29 dotnet-sdk = dotnetCorePackages.sdk_8_0;
30 dotnet-runtime = dotnetCorePackages.runtime_8_0;
31 dotnetInstallFlags = [
32 "--framework"
33 "net8.0"
34 ];
35 executables = [ "git-credential-manager" ];
36
37 runtimeDeps = lib.optional withLibsecretSupport libsecret;
38 makeWrapperArgs = [
39 "--prefix PATH : ${
40 lib.makeBinPath (
41 [ git ]
42 ++ lib.optionals withGpgSupport [
43 gnupg
44 pass
45 ]
46 )
47 }"
48 "--inherit-argv0"
49 ];
50
51 passthru = {
52 updateScript = ./update.sh;
53 tests.version = testers.testVersion {
54 package = git-credential-manager;
55 };
56 };
57
58 meta = with lib; {
59 description = "Secure, cross-platform Git credential storage with authentication to GitHub, Azure Repos, and other popular Git hosting services";
60 homepage = "https://github.com/git-ecosystem/git-credential-manager";
61 license = with licenses; [ mit ];
62 platforms = platforms.unix;
63 maintainers = with maintainers; [ _999eagle ];
64 longDescription = ''
65 git-credential-manager is a secure, cross-platform Git credential storage with authentication to GitHub, Azure Repos, and other popular Git hosting services.
66
67 > requires sandbox to be disabled on MacOS, so that
68 .NET can find `/usr/bin/codesign` to sign the compiled binary.
69 This problem is common to all .NET packages on MacOS with Nix.
70 '';
71 mainProgram = "git-credential-manager";
72 };
73}