2024-07-09 05:03:34 +00:00
|
|
|
{ lib, config, ... }:
|
|
|
|
|
|
|
|
let
|
|
|
|
cfg = config.snowhawk.ssh;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
options.snowhawk.ssh = {
|
|
|
|
enable = lib.mkEnableOption "ssh";
|
2024-07-11 12:13:00 +00:00
|
|
|
|
|
|
|
homeNetwork = lib.mkEnableOption "include local hostnames for home network devices";
|
2024-07-09 05:03:34 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
|
|
programs.ssh = {
|
|
|
|
enable = true;
|
2024-07-11 12:18:10 +00:00
|
|
|
includes = [
|
|
|
|
"conf.d/*"
|
|
|
|
];
|
2024-07-09 05:03:34 +00:00
|
|
|
matchBlocks = {
|
|
|
|
"git.zynh.me" = {
|
|
|
|
hostname = "git.zynh.me";
|
|
|
|
user = "git";
|
|
|
|
port = 2221;
|
|
|
|
identityFile = "${config.home.homeDirectory}/.ssh/personal_git";
|
|
|
|
};
|
2024-07-09 08:30:45 +00:00
|
|
|
msiserver = {
|
|
|
|
hostname = "scarlet.zynh.me";
|
|
|
|
user = "zynh";
|
2024-07-09 08:47:23 +00:00
|
|
|
identityFile = "${config.home.homeDirectory}/.ssh/msiserver";
|
|
|
|
};
|
2024-07-11 12:13:00 +00:00
|
|
|
"msiserver.local" = lib.mkIf cfg.homeNetwork {
|
2024-07-09 08:47:23 +00:00
|
|
|
hostname = "msiserver";
|
|
|
|
user = "zynh";
|
|
|
|
identityFile = "${config.home.homeDirectory}/.ssh/msiserver";
|
2024-07-09 08:30:45 +00:00
|
|
|
};
|
2024-07-11 12:58:16 +00:00
|
|
|
caveserver = {
|
|
|
|
identityFile = "${config.home.homeDirectory}/.ssh/caveserver";
|
|
|
|
};
|
2024-07-09 05:03:34 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|