Files
nixos-config/home-manager/modules/ssh.nix
T
2026-02-07 22:11:44 +03:00

74 lines
1.6 KiB
Nix

{ config, lib, pkgs, ... }:
{
programs.ssh = {
enable = true;
matchBlocks = {
"kr0sh.ru" = {
host = "kr0sh.ru";
user = "krosh";
identityFile = [ "~/.ssh/id" ];
};
"github.com" = {
host = "github.com";
user = "git";
identityFile = [ "~/.ssh/id" ];
};
"homeserver" = {
host = "homeserver";
hostname = "192.168.3.71";
port = 2006;
user = "krosh";
identityFile = [ "~/.ssh/id_ed25519_sk" ];
};
"homeserver-wg" = {
host = "homeserver-wg";
hostname = "10.10.0.10";
port = 2006;
user = "krosh";
identityFile = [ "~/.ssh/id_ed25519_sk" ];
};
"polus" = {
host = "polus";
hostname = "polus.hpc.cs.msu.ru";
user = "edu-cmc-skpod25-321-05";
identityFile = [ "~/.ssh/edu-cmc-skpod25-321-05.ppk" ];
};
"all" = lib.hm.dag.entryAfter [ "kr0sh.ru" "github.com" "polus" ] {
host = "*";
identityFile = [
# "~/.ssh/id_ed25519_sk"
"~/.ssh/gitlab.ppk"
"~/.ssh/id_rsa.ppk"
"~/.ssh/edu-cmc-skpod25-321-05.ppk"
"~/.ssh/id"
];
};
};
};
programs.ssh.enableDefaultConfig = false;
programs.ssh.matchBlocks."*" = {
forwardAgent = false;
addKeysToAgent = "no";
compression = false;
serverAliveInterval = 0;
serverAliveCountMax = 3;
hashKnownHosts = false;
userKnownHostsFile = "~/.ssh/known_hosts";
controlMaster = "no";
controlPath = "~/.ssh/master-%r@%n:%p";
controlPersist = "no";
};
# services.ssh-agent.enable = true;
}