From cbdc06c9fb334131c0c83232a26d9761f1a205bd Mon Sep 17 00:00:00 2001 From: vorboyvo Date: Wed, 8 May 2024 12:54:24 -0400 Subject: [PATCH] Moved per-host ssh config from using /etc/hosts to actually using ssh config lol. --- configuration.nix | 7 ------- home.nix | 1 + programs/ssh.nix | 16 ++++++++++++++++ 3 files changed, 17 insertions(+), 7 deletions(-) create mode 100644 programs/ssh.nix diff --git a/configuration.nix b/configuration.nix index 9efc2ba..e1cc703 100644 --- a/configuration.nix +++ b/configuration.nix @@ -36,13 +36,6 @@ networking.networkmanager.enable = true; # Easiest to use and most distros use this by default. - # Extra hosts for connecting to tailscale'd servers - networking.extraHosts = '' - 100.89.185.72 raymond - 100.119.100.64 sherbrooke - 168.138.90.29 souligny - ''; - networking.firewall = let kdeConnectPorts = { from = 1714; diff --git a/home.nix b/home.nix index 467db91..0b71163 100644 --- a/home.nix +++ b/home.nix @@ -7,6 +7,7 @@ let in { imports = [ ./programs/kdeconnect.nix + ./programs/ssh.nix ]; home.username = "alice"; home.homeDirectory = "/home/alice"; diff --git a/programs/ssh.nix b/programs/ssh.nix new file mode 100644 index 0000000..a93e826 --- /dev/null +++ b/programs/ssh.nix @@ -0,0 +1,16 @@ +{ + programs.ssh = { + enable = true; + matchBlocks = { + "sherbrooke" = { + hostname = "100.119.100.64"; + user = "vorboyvo"; + }; + "souligny" = { + hostname = "100.89.207.70"; + user = "ubuntu"; + identityFile = "~/.ssh/ssh-key-2024-04-12.key"; # supply this manually + }; + }; + }; +}