From 3a6f2ce2a2334c514c5310aa58cab626775d3e01 Mon Sep 17 00:00:00 2001 From: Arpit Chakladar Date: Thu, 9 Jul 2026 00:34:46 +0530 Subject: fix: some minor typos --- modules/programs/git/default.nix | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'modules/programs/git/default.nix') diff --git a/modules/programs/git/default.nix b/modules/programs/git/default.nix index bd91511..3d367df 100644 --- a/modules/programs/git/default.nix +++ b/modules/programs/git/default.nix @@ -12,14 +12,17 @@ type = lib.types.str; description = "Git username."; }; + email = lib.mkOption { type = lib.types.str; description = "Git email."; }; + + useSSH = lib.mkEnableOption "Use SSH instead of HTTPS for common git platforms."; }; config = lib.mkIf config.programs.git.enable { - home.packages = lib.mkIfconfig config.programs.pass.enable [ pkgs.pass-git-helper ]; + home.packages = lib.mkIf config.programs.pass.enable [ pkgs.pass-git-helper ]; programs.git = { settings = @@ -32,11 +35,12 @@ core.askPass = ""; } ( - lib.optionalAttrs config.programs.pass.enable { - credential."https://github.com" = { - username = config.programs.pass.github.username; - helper = lib.getExe pkgs.pass-git-helper; - }; + lib.optionalAttrs config.programs.git.useSSH { + url."git@github.com:".insteadOf = "https://github.com/"; + url."git@gitlab.com:".insteadOf = "https://gitlab.com/"; + url."git@bitbucket.org:".insteadOf = "https://bitbucket.org/"; + url."git@codeberg.org:".insteadOf = "https://codeberg.org/"; + url."git@git.sr.ht:".insteadOf = "https://git.sr.ht/"; } ); }; -- cgit v1.2.3