diff --git a/home/programs/ssh.nix b/home/programs/ssh.nix index b52dc8d..7160c23 100644 --- a/home/programs/ssh.nix +++ b/home/programs/ssh.nix @@ -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"; + }; }; }; }