programs/ssh: matchBlocks -> settings

This commit is contained in:
2026-06-14 01:06:31 +02:00
parent 9a6bb716b9
commit 372952d32f
+38 -34
View File
@@ -1,41 +1,45 @@
{ ... }:
{ stable, ... }:
{
programs.ssh = {
enable = true;
enableDefaultConfig = false;
matchBlocks."*" = {
addKeysToAgent = "yes";
forwardAgent = false;
compression = false;
serverAliveInterval = 0;
serverAliveCountMax = 3;
hashKnownHosts = false;
userKnownHostsFile = "~/.ssh/known_hosts";
controlMaster = "no";
controlPath = "~/.ssh/master-%r@%n:%p";
controlPersist = "no";
};
matchBlocks."pvv-git git.pvv.ntnu.no" = {
port = 2222;
user = "Gitea";
hostname = "git.pvv.ntnu.no";
addressFamily = "inet";
proxyJump = "microbel";
identityFile = "~/.ssh/pvv_gitea_id_ed25519";
};
matchBlocks."github.com" = {
hostname = "github.com";
identityFile = "~/.ssh/nixos_xeon_github_id_ed25519";
};
matchBlocks."microbel" = {
user = "vegardbm";
hostname = "microbel.pvv.ntnu.no";
addressFamily = "inet";
identityFile = "~/.ssh/pvv_gitea_id_ed25519";
};
matchBlocks."pvv-login login.pvv.ntnu.no" = {
user = "vegardbm";
hostname = "login.pvv.ntnu.no";
"${if stable then "matchBlocks" else "settings"}" = {
"*" = {
addKeysToAgent = "yes";
forwardAgent = false;
compression = false;
serverAliveInterval = 0;
serverAliveCountMax = 3;
hashKnownHosts = false;
userKnownHostsFile = "~/.ssh/known_hosts";
controlMaster = "no";
controlPath = "~/.ssh/master-%r@%n:%p";
controlPersist = "no";
};
"*.pvv.ntnu.no" = {
identityFile = "~/.ssh/pvv_nixos_id_ed25519";
user = "vegardbm";
};
"pvv-git git.pvv.ntnu.no" = {
port = 2222;
user = "Gitea";
hostname = "git.pvv.ntnu.no";
proxyJump = "microbel";
identityFile = "~/.ssh/pvv_gitea_id_ed25519";
};
"github.com" = {
hostname = "github.com";
identityFile = "~/.ssh/nixos_xeon_github_id_ed25519";
};
"microbel" = {
hostname = "microbel.pvv.ntnu.no";
identityFile = "~/.ssh/pvv_gitea_id_ed25519";
user = "vegardbm";
};
"pvv-login login.pvv.ntnu.no" = {
hostname = "login.pvv.ntnu.no";
user = "vegardbm";
};
};
};
}