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
2
tests/modules/programs/gh/credential-helper.git.conf
Normal file
2
tests/modules/programs/gh/credential-helper.git.conf
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
[credential "https://github.com"]
|
||||
helper = "@gh@/bin/gh auth git-credential"
|
||||
21
tests/modules/programs/gh/credential-helper.nix
Normal file
21
tests/modules/programs/gh/credential-helper.nix
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
programs.gh = {
|
||||
enable = true;
|
||||
enableGitCredentialHelper = true;
|
||||
};
|
||||
|
||||
programs.git.enable = true;
|
||||
|
||||
test.stubs = {
|
||||
gh = { };
|
||||
git = { };
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.config/git/config
|
||||
assertFileContent home-files/.config/git/config \
|
||||
${./credential-helper.git.conf}
|
||||
'';
|
||||
}
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
{
|
||||
gh-config-file = ./config-file.nix;
|
||||
gh-credential-helper = ./credential-helper.nix;
|
||||
gh-warnings = ./warnings.nix;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue