git.delta.rocks / jrsonnet / refs/commits / 3e7b063c34a7

difftreelog

source

modules/extras/tf.nix1.0 KiBsourcehistory
1{2  config,3  lib,4  fleetLib,5  inputs,6  ...7}: let8  inherit (lib.options) mkOption;9  inherit (lib.types) deferredModule attrsOf unspecified;10  inherit (fleetLib.options) mkDataOption;11in {12  options = {13    tf = mkOption {14      type = deferredModule;15      apply = module: system:16        inputs.terranix.lib.terranixConfiguration {17          inherit system;18          pkgs = config.nixpkgs.buildUsing.legacyPackages.${system};19          modules = [20            module21          ];22        };23    };24    data = mkDataOption {25      # host => hostData26      options.extra.terraformHosts = mkOption {27        default = {};28        type = attrsOf (attrsOf unspecified);29        description = "Hosts data provided by fleet tf";30      };31    };32  };3334  config = {35    tf.output.fleet = {36      value = {37        managed = true;38      };39      # Just to avoid printing this attribute on every apply, the whole fleet attribute40      # will be somehow processed by fleet tf.41      sensitive = true;42    };43    hosts = config.data.extra.terraformHosts;44  };45}