feat(infra): Internalize nix-lib, and make keys management simpler

This commit is contained in:
Tom Hubrecht 2024-10-09 17:04:30 +02:00 committed by thubrecht
parent 53c865a335
commit 6c4099d369
45 changed files with 762 additions and 182 deletions

View file

@ -1,6 +1,7 @@
{
config,
lib,
dgn-keys,
name,
...
}:
@ -103,15 +104,12 @@ in
access = [
{
repo = "default";
keys = lib.extra.getAllKeys (
# Nodes allowed to create backups
builtins.map (host: "machines/${host}") [
"compute01"
"storage01"
"vault01"
"web01"
]
);
keys = dgn-keys.getKeys [
"compute01"
"storage01"
"vault01"
"web01"
];
allowed = [ "put" ];
}
];
@ -121,8 +119,7 @@ in
};
programs.ssh.knownHosts =
lib.extra.mapFuse
(host: { "${host}.dgnum".publicKey = builtins.head (lib.extra.getKeys "machines/${host}"); })
lib.extra.mapFuse (host: { "${host}.dgnum".publicKey = builtins.head dgn-keys._keys.${host}; })
[
"compute01"
"geo01"