From ea6c7c815bba8ec394c6dcded25912fbaecb78e9 Mon Sep 17 00:00:00 2001 From: Yan Lin Date: Mon, 28 Jul 2025 13:50:46 +0200 Subject: [PATCH] Add multi-platform git credential management MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add git-credential-oauth package for OAuth authentication - Configure OAuth helpers for GitHub, GitLab, BitBucket - Add token-based authentication for Overleaf - Remove disabled credential helper configuration - Support secure browser-based OAuth flows and token storage 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- flake.nix | 1 + modules/git.nix | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index 5b1b444..e9b8ef7 100644 --- a/flake.nix +++ b/flake.nix @@ -68,6 +68,7 @@ nerd-fonts.jetbrains-mono gitui ncdu + git-credential-oauth ]; fonts.fontconfig.enable = true; diff --git a/modules/git.nix b/modules/git.nix index 6492a3a..802eb90 100644 --- a/modules/git.nix +++ b/modules/git.nix @@ -1,6 +1,10 @@ { config, pkgs, ... }: { + # Enable git-credential-oauth for GitHub, GitLab, BitBucket + programs.git-credential-oauth = { + enable = true; + }; programs.git = { enable = true; @@ -79,7 +83,17 @@ ]; extraConfig = { - credential.helper = ""; + # Platform-specific credential configuration + credential = { + # OAuth platforms (handled by git-credential-oauth) + "https://github.com".helper = "oauth"; + "https://gitlab.com".helper = "oauth"; + "https://bitbucket.org".helper = "oauth"; + + # Token-based platforms + "https://git.overleaf.com".helper = "store"; + "https://git.overleaf.com".username = "git"; + }; core = { editor = "nvim";