mirror of
https://github.com/nix-community/home-manager
synced 2024-11-23 03:29:45 +01:00
parent
93435d27d2
commit
05d9bee4a5
5 changed files with 42 additions and 1 deletions
|
@ -30,7 +30,8 @@ in {
|
|||
home.packages = [ cfg.package ];
|
||||
|
||||
programs.git.extraConfig.credential.helper = [
|
||||
("${cfg.package}/bin/git-credential-oauth" + lib.mkIf cfg.extraFlags
|
||||
("${cfg.package}/bin/git-credential-oauth"
|
||||
+ lib.optionalString (cfg.extraFlags != [ ])
|
||||
" ${lib.strings.concatStringsSep " " cfg.extraFlags}")
|
||||
];
|
||||
};
|
||||
|
|
|
@ -81,6 +81,7 @@ in import nmtSrc {
|
|||
./modules/programs/gh-dash
|
||||
./modules/programs/git
|
||||
./modules/programs/git-cliff
|
||||
./modules/programs/git-credential-oauth
|
||||
./modules/programs/gpg
|
||||
./modules/programs/gradle
|
||||
./modules/programs/granted
|
||||
|
|
16
tests/modules/programs/git-credential-oauth/basic.nix
Normal file
16
tests/modules/programs/git-credential-oauth/basic.nix
Normal file
|
@ -0,0 +1,16 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
programs.git-credential-oauth = { enable = true; };
|
||||
|
||||
programs.git = { enable = true; };
|
||||
|
||||
test.stubs.git-credential-oauth = { };
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.config/git/config
|
||||
assertFileContains \
|
||||
home-files/.config/git/config \
|
||||
"${config.programs.git-credential-oauth.package}/bin/git-credential-oauth"
|
||||
'';
|
||||
}
|
4
tests/modules/programs/git-credential-oauth/default.nix
Normal file
4
tests/modules/programs/git-credential-oauth/default.nix
Normal file
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
git-credential-oauth-basic = ./basic.nix;
|
||||
git-credential-oauth-extra-flags = ./extra-flags.nix;
|
||||
}
|
19
tests/modules/programs/git-credential-oauth/extra-flags.nix
Normal file
19
tests/modules/programs/git-credential-oauth/extra-flags.nix
Normal file
|
@ -0,0 +1,19 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
programs.git-credential-oauth = {
|
||||
enable = true;
|
||||
extraFlags = [ "-device" ];
|
||||
};
|
||||
|
||||
programs.git = { enable = true; };
|
||||
|
||||
test.stubs.git-credential-oauth = { };
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.config/git/config
|
||||
assertFileContains \
|
||||
home-files/.config/git/config \
|
||||
"${config.programs.git-credential-oauth.package}/bin/git-credential-oauth -device"
|
||||
'';
|
||||
}
|
Loading…
Reference in a new issue