git.delta.rocks / jrsonnet / refs/commits / 426fcb53be1a

difftreelog

source

modules/extras/tf.nix1.0 KiBsourcehistory
1{2  config,3  lib,4  fleetLib,5  inputs,6  ...7}:8let9  inherit (lib.options) mkOption;10  inherit (lib.types) deferredModule attrsOf unspecified;11  inherit (fleetLib.options) mkDataOption;12in13{14  options = {15    tf = mkOption {16      type = deferredModule;17      apply =18        module: system:19        inputs.terranix.lib.terranixConfiguration {20          inherit system;21          pkgs = config.nixpkgs.buildUsing.legacyPackages.${system};22          modules = [23            module24          ];25        };26    };27    data = mkDataOption {28      # host => hostData29      options.extra.terraformHosts = mkOption {30        default = { };31        type = attrsOf (attrsOf unspecified);32        description = "Hosts data provided by fleet tf";33      };34    };35  };3637  config = {38    tf.output.fleet = {39      value = {40        managed = true;41      };42      # Just to avoid printing this attribute on every apply, the whole fleet attribute43      # will be somehow processed by fleet tf.44      sensitive = true;45    };46    hosts = config.data.extra.terraformHosts;47  };48}