2024-01-08 07:49:51 +03:00
|
|
|
{
|
|
|
|
declare = defs: {
|
|
|
|
age.secrets = builtins.listToAttrs (
|
|
|
|
map
|
|
|
|
(def:
|
|
|
|
let obj = if builtins.isString def then { name = def; } else def;
|
|
|
|
in {
|
|
|
|
name = obj.name;
|
|
|
|
value = builtins.removeAttrs
|
|
|
|
(obj // {
|
|
|
|
file = ../secrets + "/${obj.name}.age";
|
|
|
|
}) [ "name" ];
|
|
|
|
}
|
|
|
|
)
|
|
|
|
defs
|
|
|
|
);
|
|
|
|
};
|
2024-01-09 08:34:03 +03:00
|
|
|
|
2024-05-01 04:59:31 +03:00
|
|
|
|
2024-01-09 08:34:03 +03:00
|
|
|
file = config: name: config.age.secrets.${name}.path;
|
|
|
|
|
|
|
|
mount = config: name:
|
|
|
|
let
|
|
|
|
path = config.age.secrets.${name}.path;
|
2024-03-03 04:35:11 +03:00
|
|
|
localPath = "/mnt/secrets/${name}";
|
2024-01-09 08:34:03 +03:00
|
|
|
in
|
|
|
|
{
|
2024-03-03 04:35:11 +03:00
|
|
|
path = localPath;
|
2024-01-09 08:34:03 +03:00
|
|
|
mounts = {
|
2024-03-03 04:35:11 +03:00
|
|
|
${localPath} = {
|
2024-01-09 08:34:03 +03:00
|
|
|
hostPath = path;
|
|
|
|
isReadOnly = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2024-01-08 07:49:51 +03:00
|
|
|
}
|