gh: option to enable helper for additional hosts (#4288)
* gh: option to enable helper for additional hosts `gh` can also be used with github enterprise hosts, for which there exists no easy option to enable the credential helper except for directly working with `programs.git.extraConfig`. Not sure if this is a needed addition since it's somewhat niche, at the same time it's not very complex and makes the life of github enterprise a little easier. * gh: update credential-helper tests * gh: refactor credential helper option this moves from `enableGitCredentialHelper` to `gitCredentialHelper.enable` and `gitCredentialHelper.hosts`. * gh: lib.mkIf -> mkIf
This commit is contained in:
parent
3db43afcb4
commit
4fd794d3df
3 changed files with 30 additions and 6 deletions
|
|
@ -1,2 +1,5 @@
|
|||
[credential "https://github.com"]
|
||||
helper = "@gh@/bin/gh auth git-credential"
|
||||
|
||||
[credential "https://github.example.com"]
|
||||
helper = "@gh@/bin/gh auth git-credential"
|
||||
|
|
|
|||
|
|
@ -3,7 +3,10 @@
|
|||
{
|
||||
programs.gh = {
|
||||
enable = true;
|
||||
enableGitCredentialHelper = true;
|
||||
gitCredentialHelper = {
|
||||
enable = true;
|
||||
hosts = [ "https://github.com" "https://github.example.com" ];
|
||||
};
|
||||
};
|
||||
|
||||
programs.git.enable = true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue