From 4cc6b92a22aa1d81ba091f7ed6e4e4a474319a5b Mon Sep 17 00:00:00 2001 From: Greg Hellings Date: Tue, 29 Oct 2024 23:52:10 -0500 Subject: [PATCH] Add public keys to programs.ssh --- home/modules/baseline/xonsh_footer.xsh | 1 + modules/baseline.nix | 85 ++++++++++++++++++++++++-- 2 files changed, 82 insertions(+), 4 deletions(-) diff --git a/home/modules/baseline/xonsh_footer.xsh b/home/modules/baseline/xonsh_footer.xsh index 1867181..08a1a34 100644 --- a/home/modules/baseline/xonsh_footer.xsh +++ b/home/modules/baseline/xonsh_footer.xsh @@ -62,6 +62,7 @@ def _rebuild(args): nom build f"/etc/nixos#nixosConfigurations.{hostname}.config.system.build.toplevel" if g`result`: nvd diff /run/current-system result + sudo result/bin/switch-to-configuration boot sudo result/bin/switch-to-configuration switch popd aliases['rebuild'] = _rebuild diff --git a/modules/baseline.nix b/modules/baseline.nix index 12c0cd8..e5071b2 100644 --- a/modules/baseline.nix +++ b/modules/baseline.nix @@ -67,15 +67,92 @@ in ''; }; - programs.ssh.extraConfig = ( - builtins.concatStringsSep "\n" ( + programs.ssh = { + knownHosts = { + chronicles = { + extraHostNames = [ + "chronicles.thehellings.lan" + "chronicles.home" + "nas" + "nas.thehellings.lan" + "nas.home" + ]; + publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEBecZUva9OnZuXLaBun6/1ITo5f9p0YMLPD+q0egLRS"; + }; + dns = { + extraHostNames = [ + "dns" + "dns.me.ts" + "dns.home" + ]; + publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKRCXdhXWHEvw84V9JC5bAGovvj12DLVphcEnsTHDjxW"; + }; + "genesis" = { + extraHostNames = [ + "genesis.shire-zebra.ts.net" + "genesis.home" + ]; + publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEI9jbTPmEWQ0F2bLYmnIOLmBnag1fkKxHRjz3X8lB/k"; + }; + "git" = { + extraHostNames = [ + "git.home" + "git.thehellings.lan" + ]; + publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKCH6L3YT7W8regzG395UWfRVfjYyUMJtmM+3w579bsT"; + }; + hosea = { + extraHostNames = [ + "hosea.home" + "hosea.thehellings.lan" + ]; + publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKLIwkTTXA56sUlUjEulXXZRvZy5H4a5ZwgKWLlpkQDz"; + }; + isaiah = { + extraHostNames = [ + "isaiah.home" + "myself" + "isaiah.thehellings.lan" + "myself.home" + "myself.thehellings.lan" + "isaiah.builder" + "myself-builder" + ]; + publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHleYKtfV4W1Z63Ysu9w5Rbglqlz4F92YcZoMkucoTNf"; + }; + jeremiah = { + extraHostNames = [ + "jeremiah.home" + "jeremiah.thehellings.lan" + "jeremiah-builder" + ]; + publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOjQjXq9WYU2Ki27BR9WwJ4ZruS/lJXbjC1b0Q42Adi0"; + }; + jude = { + extraHostNames = [ + "jude.home" + "jude.thehellings.lan" + "jude-builder" + ]; + publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOos0zQePsa+T6Z2dsKbPOvEdrBQ8a6mx3s7pN6ysCI0"; + }; + linode = { + extraHostNames = [ + "linode.home" + "linode.thehellings.lan" + "thehellings.com" + ]; + publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMv9Zud3kZOl86gtmkn+uj3D4kiXWDPtyUL02VVLNR4Q"; + }; + }; + extraConfig = builtins.concatStringsSep "\n" ( lib.map (x: '' Host ${x}-builder Hostname ${x}.home User remote-builder-user '') builderHosts - ) - ); + ); + }; nixpkgs.config = { allowUnfree = true;