Git-credential-manager on NixOS

How do I set up git-credential-manager on NixOS? So far I have tried setting it up via Home Manager, but that did not give me any results. I do see this PR on the nixpkgs repo that should fix my problem. Is there any other way I can set it up so I can log into my GitHub account?

Wdym “doesn’t give any results”?

As you linked an unmerged PR that adds the software to nixpkgs, I assume that you can’t install it, because it’s simply not available.

If you tried anything that’s different from writing a random pkgs.git-credential-manager anywhere, then please tell us.

It attempted to login using password authentication which has apparently been removed since august of 2021

I tried adding programs.git.extrConfig.credential.helper = "${pkgs.gitAndTools.gitFull}/bin/git-credential-libsecret";

Hello, original author of the PR you linked here. You can, in fact, install GCM through my NUR (where I’ve already added the package as the PR got lost in the thousands of open PRs on nixpkgs). NURs are basically alternative repositories by individual users, and often have more obscure or customized packages. It’s listed here, and you can see instructions for using NURs here.

The package would then be nur.repos.utybo.git-credential-manager. You can then follow the instructions in the PR for using it with Home Manager, but with the correct package, i.e.:

programs.git = {
  enable = true;
  # ...
  extraConfig = {
    credential = {
      credentialStore = "secretservice";
      helper = "${nur.repos.utybo.git-credential-manager}/bin/git-credential-manager-core";
    };
  };
};
1 Like

oooh thanks! Ill try this in a bit

Not removed, the package just moved to top-level (pkgs.gitFull). And the NixOS option was renamed. I would expect something like the following to work today:

programs.git = {
  enable = true;
  package = pkgs.gitFull;
  config.credential.helper = "libsecret";
};
2 Likes