forked from DGNum/infrastructure
feat(infra): Internalize nix-lib, and make keys management simpler
This commit is contained in:
parent
53c865a335
commit
6c4099d369
45 changed files with 762 additions and 182 deletions
|
@ -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"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue