From 9a4cbea5be0f20f9e4c3f31db2d1b83590feeb2e Mon Sep 17 00:00:00 2001 From: "Alexander \"PapaTutuWawa" Date: Thu, 2 Dec 2021 11:11:54 +0100 Subject: [PATCH] alexander: Fix SSH config --- .gitattributes | 3 ++- lib/ports.nix | Bin 0 -> 44 bytes modules/users/alexander.nix | 42 ++++++++++++++++++++++++------------ 3 files changed, 30 insertions(+), 15 deletions(-) create mode 100644 lib/ports.nix diff --git a/.gitattributes b/.gitattributes index 71f6e5a..ff55a01 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,3 +1,4 @@ modules/programs/emacs/mu4e.el filter=git-crypt diff=git-crypt modules/hardware/wifi.nix filter=git-crypt diff=git-crypt -secrets/default.nix filter=git-crypt diff=git-crypt \ No newline at end of file +secrets/default.nix filter=git-crypt diff=git-crypt +lib/ports.nix filter=git-crypt diff=git-crypt \ No newline at end of file diff --git a/lib/ports.nix b/lib/ports.nix new file mode 100644 index 0000000000000000000000000000000000000000..711f71637add1e4358f24effd788aaf34d1c48d7 GIT binary patch literal 44 zcmV+{0Mq{fM@dveQdv+`0E{#rb?A%fGxw`4XY};F&~GWNIh6juxGUxLPBWjcZ5fBJ C*%fX8 literal 0 HcmV?d00001 diff --git a/modules/users/alexander.nix b/modules/users/alexander.nix index 0f388e3..278345d 100644 --- a/modules/users/alexander.nix +++ b/modules/users/alexander.nix @@ -21,20 +21,34 @@ programs.ssh = { enable = true; - extraConfig = '' - IdentityFile ~/.ssh/gitea_papatutuwawa - IdentityFile ~/.ssh/github_polynomdivision - - Host git.polynom.me - HostName git.polynom.me - User git - IdentityFile ~/.ssh/gitea_papatutuwawa - - Host github.com - HostName github.com - User git - IdentityFile ~/.ssh/github_polynomdivision - ''; + matchBlocks = let + sshPort = (import ../../lib/ports.nix).sshPort; + in { + ayame = { + port = sshPort; + hostname = "78.46.184.48"; + user = "alexander"; + identityFile = "~/.ssh/polynom.me_ayame"; + identitiesOnly = true; + }; + "git.polynom.me" = { + port = 2222; + user = "gitea"; + hostname = "git.polynom.me"; + identityFile = "~/.ssh/gitea_papatutuwawa_ed"; + }; + "github.com" = { + user = "git"; + hostname = "github.com"; + identityFile = "~/.ssh/github_polynomdivision"; + }; + "minecraft" = { + port = sshPort; + user = "alexander"; + hostname = "49.12.33.24"; + identityFile = "~/.ssh/polynom.me"; + }; + }; }; # TODO: Maybe move this somewhere else