Add tailscale SSH host and use username variable

- Simplify server aliases and add tailscale‑specific aliases
- Make SSH module accept a username argument
- Add match block for Tailscale host with port 22 and identity file
This commit is contained in:
2026-01-19 11:14:41 +01:00
parent 7501159100
commit 01cc53fff1
2 changed files with 12 additions and 4 deletions

View File

@@ -123,7 +123,9 @@
fc = "fortune | cowsay"; fc = "fortune | cowsay";
# Network aliases # Network aliases
kssh-server = "kssh garand_plg@192.168.1.156 -i ~/.ssh/hp-t640-homeserver"; kssh-server = "kssh hp-t640-homeserver";
ssh-server = "ssh garand_plg@192.168.1.156 -i ~/.ssh/hp-t640-homeserver"; kssh-server-ts = "kssh hp-t640-homeserver-tailscale";
ssh-server = "ssh hp-t640-homeserver";
ssh-server-ts = "ssh hp-t640-homeserver-tailscale";
}; };
} }

View File

@@ -1,11 +1,17 @@
_: { {username, ...}: {
programs.ssh = { programs.ssh = {
enable = true; enable = true;
enableDefaultConfig = false; enableDefaultConfig = false;
matchBlocks = { matchBlocks = {
"hp-t640-homeserver" = { "hp-t640-homeserver" = {
hostname = "192.168.1.156"; hostname = "192.168.1.156";
user = "garand_plg"; user = "${username}";
port = 22;
identityFile = "~/.ssh/hp-t640-homeserver";
};
"hp-t640-homeserver-tailscale" = {
hostname = "100.106.225.106";
user = "${username}";
port = 22; port = 22;
identityFile = "~/.ssh/hp-t640-homeserver"; identityFile = "~/.ssh/hp-t640-homeserver";
}; };