secrets: Name host keys for slop-broker approvals
Approvals list host keys abbreviated, which says little about which box a secret goes to. Write each system's name after its key as the key's comment, which age ignores and slop-broker shows as the name. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit was merged in pull request #14.
This commit is contained in:
1 parent
44f0358fef
commit
68de43b467
2 files changed
+10
-8
No files matched your search
+7
-6
@@ -2,8 +2,8 @@ let
|
||||
self = getFlake (toString ./.);
|
||||
inherit (self) lib;
|
||||
|
||||
inherit (builtins) mapAttrs attrValues readFile getFlake;
|
||||
inherit (lib) fileContents optional flatten zipAttrsWith nameValuePair mapAttrs';
|
||||
inherit (builtins) mapAttrs readFile getFlake;
|
||||
inherit (lib) fileContents optional flatten zipAttrsWith nameValuePair mapAttrs' mapAttrsToList;
|
||||
|
||||
secretPath = p: "secrets/${p}.age";
|
||||
|
||||
@@ -15,12 +15,13 @@ let
|
||||
secretKeys =
|
||||
zipAttrsWith
|
||||
(_: keys: flatten (keys ++ defaultKeys))
|
||||
(map
|
||||
(c: let cfg = c.config.my.secrets; in mapAttrs'
|
||||
(mapAttrsToList
|
||||
# The comment names the key in `slop-broker` approvals; age ignores it
|
||||
(name: c: let cfg = c.config.my.secrets; in mapAttrs'
|
||||
(f: _: nameValuePair
|
||||
(secretPath f)
|
||||
(optional (cfg.key != null) cfg.key))
|
||||
(optional (cfg.key != null) "${cfg.key} ${name}"))
|
||||
cfg.files)
|
||||
(attrValues self.nixosConfigurations));
|
||||
self.nixosConfigurations);
|
||||
in
|
||||
mapAttrs (_: keys: { publicKeys = keys; }) secretKeys
|
||||
Reference in new issue
Block a user