lib/private: add attachSopsPathPrefix

This commit is contained in:
Gabriel Arazas 2023-07-05 13:03:41 +08:00
parent 1027f97333
commit 2677400a43
No known key found for this signature in database
GPG Key ID: ADE0C41DAB221FCC

View File

@ -34,6 +34,14 @@ rec {
lib.mapAttrs (path: attrs: lib.mapAttrs (path: attrs:
attrs // (getKey path)) secrets; attrs // (getKey path)) secrets;
attachSopsPathPrefix = prefix: secrets:
lib.mapAttrs'
(key: settings:
lib.nameValuePair
"${prefix}/${key}"
settings // { inherit key; })
secrets;
getUsers = type: users: getUsers = type: users:
let let
userModules = lib.filesToAttr ../users/${type}; userModules = lib.filesToAttr ../users/${type};