Files
home-manager/modules/programs/git-credential-oauth.nix
Austin Horstman 355734d876 treewide: remove literalExpression where unneeded
`literalExpression` is intended just to signify code that needs to stay
a string that gets represented exactly as-is for docs. It has been
misused heavily and people get confused repeatedly on when or not to use
it because of the rampant misuse.
2026-05-17 21:43:25 -05:00

46 lines
1003 B
Nix

{
config,
lib,
pkgs,
...
}:
let
cfg = config.programs.git-credential-oauth;
in
{
meta.maintainers = [ lib.maintainers.tomodachi94 ];
options = {
programs.git-credential-oauth = {
enable = lib.mkEnableOption "Git authentication handler for OAuth";
package = lib.mkPackageOption pkgs "git-credential-oauth" { };
extraFlags = lib.mkOption {
type = lib.types.listOf lib.types.str;
default = [ ];
example = [ "-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 {
home.packages = [ cfg.package ];
programs.git.settings.credential.helper = lib.mkAfter [
(
"${cfg.package}/bin/git-credential-oauth"
+ lib.optionalString (cfg.extraFlags != [ ]) " ${lib.strings.concatStringsSep " " cfg.extraFlags}"
)
];
};
}