diff options
| author | Arpit Chakladar <arpitchakladar@proton.me> | 2026-07-09 00:34:46 +0530 |
|---|---|---|
| committer | Arpit Chakladar <arpitchakladar@proton.me> | 2026-07-09 00:34:46 +0530 |
| commit | 3a6f2ce2a2334c514c5310aa58cab626775d3e01 (patch) | |
| tree | 96af9971a43047a758956a8c7b79dcb541e01867 /modules/programs/git/default.nix | |
| parent | 6941090be12bb5eae7edd76ec19c255536802493 (diff) | |
| download | home-manager-config-3a6f2ce2a2334c514c5310aa58cab626775d3e01.tar.gz home-manager-config-3a6f2ce2a2334c514c5310aa58cab626775d3e01.zip | |
fix: some minor typos
Diffstat (limited to 'modules/programs/git/default.nix')
| -rw-r--r-- | modules/programs/git/default.nix | 16 |
1 files changed, 10 insertions, 6 deletions
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/"; } ); }; |
