diff options
| author | Mel <mel@rnrd.eu> | 2025-07-25 15:40:28 +0200 |
|---|---|---|
| committer | Mel <mel@rnrd.eu> | 2025-07-25 15:40:28 +0200 |
| commit | 8572f3b4db7e26d7e2751f03873069943fca3fe8 (patch) | |
| tree | 2693aa8104a3afb2459cab2d5d3763ad1f5443ee /secrets/keys.nix | |
| parent | 99a008a30f2be2cc417e309ef01d02d6995f0c78 (diff) | |
| download | minerals-8572f3b4db7e26d7e2751f03873069943fca3fe8.tar.zst minerals-8572f3b4db7e26d7e2751f03873069943fca3fe8.zip | |
Use age secrets on mineral machines (mainly for work-related tasks)
Signed-off-by: Mel <mel@rnrd.eu>
Diffstat (limited to 'secrets/keys.nix')
| -rw-r--r-- | secrets/keys.nix | 37 |
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; +} |
