infrastructure/config/modules/meta/secrets.nix
2021-08-08 19:33:21 +01:00

21 lines
556 B
Nix

{ config, lib, ... }:
with lib;
{
options = let tf = config; in {
variables = mkOption {
type = types.attrsOf (types.submodule ({ name, config, ... }: {
options.externalSecret = mkEnableOption "Is ths secret to be templated into a command provided?";
config = mkIf config.externalSecret {
type = "string";
value.shellCommand = "${tf.commandPrefix} ${escapeShellArg name}";
};
}));
};
commandPrefix = mkOption {
type = types.nullOr types.str;
default = null;
};
};
}