Add declarative ssh known hosts

Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
2025-02-25 12:28:22 +00:00
parent f843deafbe
commit a3dc4129d6
22 changed files with 258 additions and 79 deletions

View File

@@ -1,4 +1,7 @@
{ ... }:
{ inputs, system, ... }:
let
selfPkgs = inputs.self.packages.${system};
in
{
sops.secrets."ssh/sas/key" = {
sopsFile = ../../../../secrets/sas/secrets.yaml;
@@ -6,15 +9,22 @@
path = "/root/.ssh/ssh_sas_ed25519_key";
};
programs.ssh.extraConfig = ''
Host github.com
User git
HostName github.com
IdentityFile /root/.ssh/ssh_sas_ed25519_key
programs.ssh = {
extraConfig = ''
Host github.com
User git
HostName github.com
IdentityFile /root/.ssh/ssh_sas_ed25519_key
Host gitlab.sas.com
User git
HostName gitlab.sas.com
IdentityFile /root/.ssh/ssh_sas_ed25519_key
'';
Host gitlab.sas.com
User git
HostName gitlab.sas.com
IdentityFile /root/.ssh/ssh_sas_ed25519_key
'';
knownHostsFiles = with selfPkgs; [
ssh-known-hosts-github
ssh-known-hosts-sas-gitlab
];
};
}