ssh.nix 916 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. { config, ... }:
  2. let
  3. inherit (config.xdg) configHome;
  4. in
  5. {
  6. home.sessionVariables = {
  7. SSH_AUTH_SOCK = "${configHome}/gnupg/S.gpg-agent.ssh";
  8. };
  9. programs.ssh = {
  10. enable = true;
  11. compression = true;
  12. forwardAgent = true;
  13. extraConfig = ''
  14. StreamLocalBindUnlink yes
  15. '';
  16. matchBlocks = {
  17. modgud = {
  18. hostname = "modgud.t5.st";
  19. user = "thomas";
  20. remoteForwards = [
  21. {
  22. host.address = "/Users/thomas/.config/gnupg/S.gpg-agent.extra";
  23. bind.address = "/run/user/1000/gnupg/d.o6jzqfigwppq1eps4nhng6n5/S.gpg-agent";
  24. }
  25. {
  26. host.address = "/Users/thomas/.config/gnupg/S.gpg-agent.ssh";
  27. bind.address = "/run/user/1000/gnupg/d.o6jzqfigwppq1eps4nhng6n5/S.gpg-agent.ssh";
  28. }
  29. ];
  30. };
  31. "github.com".user = "git";
  32. github.hostname = "github.com";
  33. };
  34. };
  35. }