summary refs log tree commit diff
path: root/secrets/keys.nix
diff options
context:
space:
mode:
Diffstat (limited to 'secrets/keys.nix')
-rw-r--r--secrets/keys.nix37
1 files changed, 37 insertions, 0 deletions
diff --git a/secrets/keys.nix b/secrets/keys.nix
new file mode 100644
index 0000000..a0538e3
--- /dev/null
+++ b/secrets/keys.nix
@@ -0,0 +1,37 @@
+let
+  machines = {
+    bismuth = {
+      user = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEK96G1n31aJsZOrux3BKM0ztzi/SFAVHn0MsGkPDdqY";
+      system = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEP1Q8/07PD5AXghM7cd9Uf54YY8rkuBHfllr1Kzxh10";
+    };
+
+    graphite = {
+      user = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEDujTul5wWyGnidLnNuJDRze0Up29l2cDpyKdmvW2Ls";
+      system = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHd+EvfxJC1rZbeI6hUq5tPpy8b3Xio02orgMBLwPU2l";
+    };
+
+    moissanite = {
+      user = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINTG/DHTkuQgwLakSBuXx3XBe+WjUmDlSgLBGzldx/ZD";
+      system = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPy6IFaPkJMT89s1PZ/ekFGDKF2kvsRuAUB5NTtYQPSL";
+    };
+  };
+
+  keysOfType = type: from: with builtins; catAttrs type (attrValues from);
+
+  machinesWithKey = type: from: builtins.mapAttrs (m: k: k.${type}) from;
+in
+rec {
+  inherit machines;
+
+  # keys of admin accounts on network machines
+  allUsers = keysOfType "user" machines;
+  # system host keys of all network machines
+  allSystems = keysOfType "system" machines;
+  # all keys, whether system or user
+  all = allUsers ++ allSystems;
+
+  # user keys per machine
+  user = machinesWithKey "user" machines;
+  # system keys per machine
+  system = machinesWithKey "system" machines;
+}