git.delta.rocks / jrsonnet / refs/commits / 61365dfbca33

difftreelog

fix move fleet-tf data extra

ttuosnwpYaroslav Bolyukin2025-10-01parent: #001a19c.patch.diff
in: trunk

1 file changed

modifiedmodules/extras/tf.nixdiffbeforeafterboth
before · modules/extras/tf.nix
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}
after · modules/extras/tf.nix
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  };2930  config = {31    flake.tf = config.tf;3233    tf.output.fleet = {34      value = {35        managed = true;36      };37      # Just to avoid printing this attribute on every apply, the whole fleet attribute38      # will be somehow processed by fleet tf.39      sensitive = true;40    };41    fleetConfigurations.default = {config, ...}: {42      options.data = mkDataOption {43        # host => hostData44        options.extra.terraformHosts = mkOption {45          default = { };46          type = attrsOf (attrsOf unspecified);47          description = "Hosts data provided by fleet tf";48        };49      };50      config.hosts = config.data.extra.terraformHosts;51    };5253    perSystem.imports = [ ./tf-bootstrap.nix ];54  };55}