lib/private: fix key override for getting secrets

The secrets key and path shouldn't be overridden by the functions. The
fix was simpler than I thought.
This commit is contained in:
Gabriel Arazas 2023-07-05 13:34:41 +08:00
parent 426e4e360a
commit 0aa69a1ad8
No known key found for this signature in database
GPG Key ID: ADE0C41DAB221FCC

View File

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