git.delta.rocks / jrsonnet / refs/commits / 8fa5c73b5fe4

difftreelog

source

modules/extras/tf.nix1.1 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{1415  options = {16    tf = mkOption {17      type = deferredModule;18      apply =19        module: system:20        inputs.terranix.lib.terranixConfiguration {21          inherit system;22          pkgs = inputs.nixpkgs.legacyPackages.${system};23          modules = [24            module25          ];26        };27    };28    data = mkDataOption {29      # host => hostData30      options.extra.terraformHosts = mkOption {31        default = { };32        type = attrsOf (attrsOf unspecified);33        description = "Hosts data provided by fleet tf";34      };35    };36  };3738  config = {39    flake.tf = config.tf;4041    tf.output.fleet = {42      value = {43        managed = true;44      };45      # Just to avoid printing this attribute on every apply, the whole fleet attribute46      # will be somehow processed by fleet tf.47      sensitive = true;48    };49    fleetConfigurations.default.hosts = config.data.extra.terraformHosts;5051    perSystem.imports = [ ./tf-bootstrap.nix ];52  };53}