mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-10 04:49:19 -08:00
31 lines
621 B
Nix
31 lines
621 B
Nix
{ config, lib, ... }:
|
|
|
|
with lib;
|
|
|
|
let
|
|
secretType = types.submodule ({ name, ... }: {
|
|
options = {
|
|
source = mkOption {
|
|
type = types.path;
|
|
};
|
|
text = mkOption {
|
|
type = types.str;
|
|
};
|
|
};
|
|
});
|
|
in
|
|
{
|
|
options.kw = {
|
|
secrets = mkOption {
|
|
type = types.nullOr (types.listOf types.str);
|
|
default = null;
|
|
};
|
|
repoSecrets = mkOption {
|
|
type = types.nullOr (types.attrsOf secretType);
|
|
default = null;
|
|
};
|
|
};
|
|
config = mkIf (config.kw.secrets != null) {
|
|
deploy.tf.variables = genAttrs config.kw.secrets (n: { externalSecret = true; });
|
|
};
|
|
}
|