mirror of
https://github.com/nix-community/home-manager
synced 2024-06-13 10:13:39 +02:00
Merge 0482a66a21
into f8e6694eda
This commit is contained in:
commit
43ede0a9fb
|
@ -12,13 +12,26 @@ in {
|
||||||
enable = lib.mkEnableOption "Git authentication handler for OAuth";
|
enable = lib.mkEnableOption "Git authentication handler for OAuth";
|
||||||
|
|
||||||
package = lib.mkPackageOption pkgs "git-credential-oauth" { };
|
package = lib.mkPackageOption pkgs "git-credential-oauth" { };
|
||||||
|
|
||||||
|
extraFlags = lib.mkOption {
|
||||||
|
type = lib.types.listOf lib.types.str;
|
||||||
|
default = [ ];
|
||||||
|
example = lib.literalExpression ''[ "-device" ]'';
|
||||||
|
description = ''
|
||||||
|
Extra command-line arguments passed to git-credential-oauth.
|
||||||
|
|
||||||
|
For valid arguments, see {manpage}`git-credential-oauth(1)`.
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
home.packages = [ cfg.package ];
|
home.packages = [ cfg.package ];
|
||||||
|
|
||||||
programs.git.extraConfig.credential.helper =
|
programs.git.extraConfig.credential.helper = [
|
||||||
[ "${cfg.package}/bin/git-credential-oauth" ];
|
("${cfg.package}/bin/git-credential-oauth" + lib.mkIf cfg.extraFlags
|
||||||
|
" ${lib.strings.concatStringsSep " " cfg.extraFlags}")
|
||||||
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user