Fediversity/deployment/fediversity/resources/secrets/default.nix
Kiara Grouwstra c296bdab0a
deploy separate operator applications thru data model
Signed-off-by: Kiara Grouwstra <kiara@procolix.eu>
2025-11-22 17:55:10 +01:00

46 lines
1,010 B
Nix

{
lib,
...
}:
let
inherit (lib) mkOption types;
in
{
resources.secrets = {
description = "Age secrets.";
request =
{ ... }:
{
_class = "fediversity-resource-request";
options = {
names = mkOption {
type = types.listOf types.str;
default = [ ];
};
};
};
policy =
{ ... }:
{
_class = "fediversity-resource-policy";
config = {
resource-type = types.unspecified; # NixOS module
apply =
requests:
{
sources ? import ../../../../npins,
...
}:
{
imports = [
"${sources.agenix}/modules/age.nix"
];
age.secrets = lib.genAttrs (lib.concatMap (request: request.names) requests) (name: {
inherit name;
value.file = "../../../../${name}.age";
});
};
};
};
};
}