diff --git a/hosts/baseline.nix b/hosts/baseline.nix index 022290a..bc72789 100644 --- a/hosts/baseline.nix +++ b/hosts/baseline.nix @@ -1,6 +1,7 @@ { config, lib, + metadata, pkgs, ... }: @@ -66,79 +67,13 @@ }; 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 AAAAC3NzaC1lZDI1NTE5AAAAIC7hesFWwlmSbWPJWUiF8fIppy5a83yXw84O0Ytz+Zyq"; - }; - hosea = { - extraHostNames = [ - "hosea.home" - "hosea.thehellings.lan" - ]; - publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKLIwkTTXA56sUlUjEulXXZRvZy5H4a5ZwgKWLlpkQDz"; - }; - isaiah = { - extraHostNames = [ - "isaiah.home" - "isaiah.thehellings.lan" - "isaiah-builder" - ]; - publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHleYKtfV4W1Z63Ysu9w5Rbglqlz4F92YcZoMkucoTNf"; - }; - jeremiah = { - extraHostNames = [ - "jeremiah.home" - "jeremiah.thehellings.lan" - "jeremiah-builder" - ]; - publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOjQjXq9WYU2Ki27BR9WwJ4ZruS/lJXbjC1b0Q42Adi0"; - }; - zeke = { - extraHostNames = [ - "zeke.home" - "zeke.thehellings.lan" - "zeke-builder" - ]; - publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOos0zQePsa+T6Z2dsKbPOvEdrBQ8a6mx3s7pN6ysCI0"; - }; - linode = { - extraHostNames = [ - "linode.home" - "linode.thehellings.lan" - "thehellings.com" - ]; - publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMv9Zud3kZOl86gtmkn+uj3D4kiXWDPtyUL02VVLNR4Q"; - }; - }; + knownHosts = builtins.mapAttrs (n: v: { + extraHostNames = [ + "${n}.thehellings.lan" + "${n}.shire-zebra.ts.net" + ]; + publicKey = v.pubkey; + }) (lib.filterAttrs (_: v: v ? "pubkey") metadata.hosts); }; }; diff --git a/hosts/metadata.nix b/hosts/metadata.nix deleted file mode 100644 index b0a80f9..0000000 --- a/hosts/metadata.nix +++ /dev/null @@ -1,47 +0,0 @@ -{ - exodus = { - arch = [ "x86_64-linux" ]; - }; - genesis = { - arch = [ "x86_64-linux" ]; - }; - hosea = { - arch = [ "x86_64-linux" ]; - }; - icdm-root = { - arch = [ "x86_64-linux" ]; - }; - isaiah = { - arch = [ "x86_64-linux" ]; - }; - iso = { - arch = [ - "x86_64-linux" - "aarch64-linux" - ]; - }; - jeremiah = { - arch = [ "x86_64-linux" ]; - }; - linode = { - arch = [ "x86_64-linux" ]; - }; - nixos = { - arch = [ - "x86_64-linux" - "aarch64-linux" - ]; - }; - proxmoxtemplate = { - arch = [ - "x86_64-linux" - "aarch64-linux" - ]; - }; - vm-gitlab = { - arch = [ "x86_64-linux" ]; - }; - zeke = { - arch = [ "x86_64-linux" ]; - }; -} diff --git a/network.json b/network.json index 9ee34b5..0b436e7 100644 --- a/network.json +++ b/network.json @@ -8,6 +8,7 @@ "hosts": { "chronicles": { "ip": "10.42.1.4", + "pubkey": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEBecZUva9OnZuXLaBun6/1ITo5f9p0YMLPD+q0egLRS", "ts": "100.119.228.115" }, "exodus": { @@ -17,12 +18,14 @@ }, "genesis": { "ip": "10.42.1.5", + "pubkey": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO/CGE2rqlL2Qr0TJkwQMsHFSDkhGWlrUlvfcvcylO1n", "ts": "100.88.91.27", "system": "x86_64-linux", "tags": ["router", "server"] }, "hosea": { "ip": "10.42.1.7", + "pubkey": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKLIwkTTXA56sUlUjEulXXZRvZy5H4a5ZwgKWLlpkQDz", "ts": "100.68.203.1", "system": "x86_64-linux", "tags": ["server"] @@ -33,6 +36,7 @@ "isaiah": { "builder": true, "ip": "10.42.1.6", + "pubkey": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHleYKtfV4W1Z63Ysu9w5Rbglqlz4F92YcZoMkucoTNf", "ts": "100.84.183.79", "system": "x86_64-linux", "systems": ["x86_64-linux", "aarch64-linux"], @@ -47,6 +51,7 @@ "jeremiah": { "builder": true, "ip": "10.42.1.8", + "pubkey": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOjQjXq9WYU2Ki27BR9WwJ4ZruS/lJXbjC1b0Q42Adi0", "ts": "100.102.186.39", "system": "x86_64-linux", "systems": ["x86_64-linux", "aarch64-linux"], @@ -59,6 +64,7 @@ }, "linode": { "ip": null, + "pubkey": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMv9Zud3kZOl86gtmkn+uj3D4kiXWDPtyUL02VVLNR4Q", "ts": "100.109.86.8", "system": "x86_64-linux", "tags": ["public", "server"] @@ -88,6 +94,7 @@ "zeke": { "builder": true, "ip": "10.42.1.13", + "pubkey": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOos0zQePsa+T6Z2dsKbPOvEdrBQ8a6mx3s7pN6ysCI0", "ts": "100.90.74.19", "system": "x86_64-linux", "systems": ["x86_64-linux", "aarch64-linux"],