difftreelog
feat use fleet-tf
in: trunk
10 files changed
cmds/fleet/Cargo.tomldiffbeforeafterboth45human-repr = { version = "1.1", optional = true }45human-repr = { version = "1.1", optional = true }46indicatif = { version = "0.18", optional = true }46indicatif = { version = "0.18", optional = true }47nom = "8.0.0"47nom = "8.0.0"48opentelemetry = "0.30.0"49opentelemetry_sdk = "0.30.0"48tracing-indicatif = { version = "0.3", optional = true }50tracing-indicatif = { version = "0.3", optional = true }49tracing-opentelemetry = "0.31.0"51tracing-opentelemetry = "0.31.0"50opentelemetry = "0.30.0"51opentelemetry_sdk = "0.30.0"525253[features]53[features]54default = []54default = []cmds/fleet/src/cmds/tf.rsdiffbeforeafterboth38 {38 {39 debug!("generating terraform configs");39 debug!("generating terraform configs");40 let system = &config.local_system;40 let system = &config.local_system;41 let config = &config.config_field;41 let config = &config.flake_outputs;42 let data = nix_go!(config.tf({ system }));42 let data = nix_go!(config.tf({ system }));43 let data: PathBuf = spawn_blocking(move || data.build("out"))43 let data: PathBuf = spawn_blocking(move || data.build("out"))44 .await44 .awaitcrates/fleet-base/src/host.rsdiffbeforeafterboth34 pub nix_args: Vec<OsString>,34 pub nix_args: Vec<OsString>,35 /// fleet_config.config35 /// fleet_config.config36 pub config_field: Value,36 pub config_field: Value,37 /// flake.output38 pub flake_outputs: Value,37 // TODO: Remove with connectivity refactor39 // TODO: Remove with connectivity refactor38 pub localhost: String,40 pub localhost: String,3941crates/fleet-base/src/opts.rsdiffbeforeafterboth267 Ok(Config(Arc::new(FleetConfigInternals {267 Ok(Config(Arc::new(FleetConfigInternals {268 directory,268 directory,269 data,269 data,270 flake_outputs: flake,270 local_system: self.local_system.clone(),271 local_system: self.local_system.clone(),271 nix_args,272 nix_args,272 config_field,273 config_field,crates/fleet-shared/src/encoding.rsdiffbeforeafterboth1use std::{1use std::{2 collections::BTreeMap, fmt::{self, Display}, str::FromStr2 collections::BTreeMap,3 fmt::{self, Display},4 str::FromStr,3};5};465use base64::engine::{Engine, general_purpose::STANDARD_NO_PAD};7use base64::engine::{Engine, general_purpose::STANDARD_NO_PAD};crates/nix-eval/src/logging.ccdiffbeforeafterbothno syntactic changes
flake.lockdiffbeforeafterboth71 "url": "https://flakehub.com/f/hercules-ci/flake-parts/0.1"71 "url": "https://flakehub.com/f/hercules-ci/flake-parts/0.1"72 }72 }73 },73 },74 "fleet-tf": {75 "inputs": {76 "flake-parts": [77 "flake-parts"78 ],79 "nixpkgs": [80 "nixpkgs"81 ],82 "shelly": [83 "shelly"84 ]85 },86 "locked": {87 "lastModified": 1759080490,88 "owner": "CertainLach",89 "repo": "fleet-tf",90 "rev": "878bd8c23933d628bf750378bbe527b841901c3d",91 "type": "github"92 },93 "original": {94 "owner": "CertainLach",95 "repo": "fleet-tf",96 "type": "github"97 }98 },74 "git-hooks-nix": {99 "git-hooks-nix": {75 "inputs": {100 "inputs": {76 "flake-compat": "flake-compat",101 "flake-compat": "flake-compat",183 "inputs": {208 "inputs": {184 "crane": "crane",209 "crane": "crane",185 "flake-parts": "flake-parts",210 "flake-parts": "flake-parts",211 "fleet-tf": "fleet-tf",186 "nix": "nix",212 "nix": "nix",187 "nixpkgs": "nixpkgs_2",213 "nixpkgs": "nixpkgs_2",188 "rust-overlay": "rust-overlay",214 "rust-overlay": "rust-overlay",flake.nixdiffbeforeafterboth13 };13 };14 crane.url = "github:ipetkov/crane";14 crane.url = "github:ipetkov/crane";15 shelly.url = "github:CertainLach/shelly";15 shelly.url = "github:CertainLach/shelly";16 fleet-tf = {17 url = "github:CertainLach/fleet-tf";18 inputs.nixpkgs.follows = "nixpkgs";19 inputs.shelly.follows = "shelly";20 inputs.flake-parts.follows = "flake-parts";21 };16 treefmt-nix = {22 treefmt-nix = {17 url = "github:numtide/treefmt-nix";23 url = "github:numtide/treefmt-nix";18 inputs.nixpkgs.follows = "nixpkgs";24 inputs.nixpkgs.follows = "nixpkgs";42 };48 };43 flakeModule = flakeModules.default;49 flakeModule = flakeModules.default;445045 fleetModules.tf = ./modules/extras/tf.nix;51 flakeModules.fleet-tf = ./modules/extras/tf.nix;465247 # Used to test nix-eval bindings53 # Used to test nix-eval bindings48 testData = {54 testData = {modules/extras/tf-bootstrap.nixdiffbeforeafterbothno changes
modules/extras/tf.nixdiffbeforeafterboth18 module: system:19 module: system:19 inputs.terranix.lib.terranixConfiguration {20 inputs.terranix.lib.terranixConfiguration {20 inherit system;21 inherit system;21 pkgs = config.nixpkgs.buildUsing.legacyPackages.${system};22 pkgs = inputs.nixpkgs.legacyPackages.${system};22 modules = [23 modules = [23 module24 module24 ];25 ];35 };36 };363737 config = {38 config = {39 flake.tf = config.tf;4038 tf.output.fleet = {41 tf.output.fleet = {39 value = {42 value = {43 # will be somehow processed by fleet tf.46 # will be somehow processed by fleet tf.44 sensitive = true;47 sensitive = true;45 };48 };46 hosts = config.data.extra.terraformHosts;49 fleetConfigurations.default.hosts = config.data.extra.terraformHosts;5051 perSystem.imports = [ ./tf-bootstrap.nix ];47 };52 };48}53}4954