mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 12:29:19 -08:00
21 lines
481 B
Nix
21 lines
481 B
Nix
{ config, lib, meta, ... }:
|
|
|
|
with lib;
|
|
|
|
let
|
|
mcfg = meta.kw.secrets;
|
|
cfg = config.kw.secrets;
|
|
in
|
|
{
|
|
config = mkIf (cfg.variables != { }) {
|
|
deploy.tf.variables = mapAttrs'
|
|
(name: content:
|
|
nameValuePair name ({
|
|
value.shellCommand = "${mcfg.command} ${content.path}" + optionalString (content.field != "") " -f ${content.field}";
|
|
type = "string";
|
|
sensitive = true;
|
|
})
|
|
)
|
|
cfg.variables;
|
|
};
|
|
}
|