Logging in with `gh auth` and home-manager

I have a home-manager config that looks like this:

programs.git = {
  enable = true;
  userName = "<name>";
  userEmail = "<email>";
  signing = {
    key = "<key>";
    signByDefault = true;
  };
};

programs.gh.enable = true;

I can login with gh auth login, but gh cannot configure git to use the credentials because it can’t write to ~/.config/git/config.

invariance@nixos ~> gh auth setup-git
failed to set up git credential helper: failed to run git: error: could not lock config file /home/invariance/.config/git/config: Read-only file system 

Is it possible to get this working? If not, what are the alternatives?

If you want the Home Manager configuration that allows you to use gh as the credential helper,

{
  programs.gh = {
    enable = true;
    gitCredentialHelper = {
      enable = true;
    };
  };
}

works on my tablet.

Thanks—no idea how I missed that when looking over the options.