gh: support gh as git credential manager for github.com
Co-authored-by: Sumner Evans <me@sumnerevans.com>
This commit is contained in:
parent
3e4fedc1d9
commit
cfe82d9f44
4 changed files with 33 additions and 0 deletions
|
|
@ -90,6 +90,11 @@ in {
|
|||
};
|
||||
'';
|
||||
};
|
||||
|
||||
enableGitCredentialHelper =
|
||||
mkEnableOption "the gh git credential helper for github.com" // {
|
||||
default = true;
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
|
|
@ -97,5 +102,9 @@ in {
|
|||
|
||||
xdg.configFile."gh/config.yml".source =
|
||||
yamlFormat.generate "gh-config.yml" cfg.settings;
|
||||
|
||||
programs.git.extraConfig.credential."https://github.com".helper =
|
||||
mkIf cfg.enableGitCredentialHelper
|
||||
"${cfg.package}/bin/gh auth git-credential";
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue