Add SSH configuration management via nix

- Create modules/ssh.nix with all host configurations
- Import SSH module in flake.nix homeConfiguration
- Manage SSH config declaratively through home-manager

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Yan Lin 2025-07-27 18:18:02 +02:00
parent cfc978c267
commit 2f096d9935
2 changed files with 61 additions and 0 deletions

View file

@ -43,6 +43,7 @@
./modules/nvim.nix
./modules/tmux.nix
./modules/zsh.nix
./modules/ssh.nix
];
home.username = "yanlin";

60
modules/ssh.nix Normal file
View file

@ -0,0 +1,60 @@
{ config, pkgs, ... }:
{
programs.ssh = {
enable = true;
matchBlocks = {
"aicloud" = {
hostname = "aicloud";
user = "hb05nk@cs.aau.dk";
identityFile = "~/.ssh/keys/aicloud";
proxyJump = "pi";
};
"nas" = {
hostname = "nas.hw.yanlincs.com";
user = "root";
identityFile = "~/.ssh/keys/nas";
};
"pi" = {
hostname = "pi.hw.yanlincs.com";
user = "yanlin";
identityFile = "~/.ssh/keys/pi";
};
"cm" = {
hostname = "cm.hw.yanlincs.com";
user = "yanlin";
identityFile = "~/.ssh/keys/pi";
};
"personal-vps" = {
hostname = "personal.vps.yanlincs.com";
user = "root";
identityFile = "~/.ssh/keys/hetzner";
};
"zero" = {
hostname = "zero.hw.yanlincs.com";
user = "yanlin";
identityFile = "~/.ssh/keys/pi";
};
"ucloud-a40" = {
hostname = "130.225.38.194";
user = "ucloud";
identityFile = "~/.ssh/keys/ucloud";
proxyJump = "imac";
};
"ucloud-h100" = {
hostname = "ssh.cloud.sdu.dk";
user = "ucloud";
port = 2281;
identityFile = "~/.ssh/keys/ucloud";
};
};
};
}