{ pkgs-stable, ... }:

{
  # ============================================================================
  # Git Configuration
  # ============================================================================
  programs.git = {
    enable = true;
    package = pkgs-stable.git;

    settings = {
      user.name = "GammaKinematics";
      user.email = "gamma.kinematics@gmail.com";
      init.defaultBranch = "main";
      pull.rebase = true;
      push.autoSetupRemote = true;
      url."ssh://git@github.com/".insteadOf = "https://github.com/";
      url."ssh://forgejo@git.axiomania.org:2222/".insteadOf = "https://git.axiomania.org/";
    };
  };

  # ============================================================================
  # SSH Configuration
  # ============================================================================
  programs.ssh = {
    enable = true;
    package = pkgs-stable.openssh;
    enableDefaultConfig = false;
    matchBlocks = {
      "*" = {
        addKeysToAgent = "yes";
        serverAliveInterval = 60;
        controlMaster = "auto";
        controlPersist = "10m";
      };
      "github.com" = {
        identityFile = "~/.ssh/id_ed25519";
        identitiesOnly = true;
      };
      "git.axiomania.org" = {
        port = 2222;
        identityFile = "~/.ssh/id_ed25519";
        identitiesOnly = true;
      };
      "vps" = {
        hostname = "178.104.15.221";
        user = "root";
        identityFile = "~/.ssh/id_ed25519";
      };
    };
  };
}
