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

difftreelog

feat use fleet-tf

usksyzorYaroslav Bolyukin2025-10-01parent: #1b17cca.patch.diff
in: trunk

10 files changed

modifiedcmds/fleet/Cargo.tomldiffbeforeafterboth
45human-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"
5252
53[features]53[features]
54default = []54default = []
modifiedcmds/fleet/src/cmds/tf.rsdiffbeforeafterboth
38 {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 .await
modifiedcrates/fleet-base/src/host.rsdiffbeforeafterboth
34 pub nix_args: Vec<OsString>,34 pub nix_args: Vec<OsString>,
35 /// fleet_config.config35 /// fleet_config.config
36 pub config_field: Value,36 pub config_field: Value,
37 /// flake.output
38 pub flake_outputs: Value,
37 // TODO: Remove with connectivity refactor39 // TODO: Remove with connectivity refactor
38 pub localhost: String,40 pub localhost: String,
3941
modifiedcrates/fleet-base/src/opts.rsdiffbeforeafterboth
267 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,
modifiedcrates/fleet-shared/src/encoding.rsdiffbeforeafterboth
1use std::{1use std::{
2 collections::BTreeMap, fmt::{self, Display}, str::FromStr2 collections::BTreeMap,
3 fmt::{self, Display},
4 str::FromStr,
3};5};
46
5use base64::engine::{Engine, general_purpose::STANDARD_NO_PAD};7use base64::engine::{Engine, general_purpose::STANDARD_NO_PAD};
modifiedcrates/nix-eval/src/logging.ccdiffbeforeafterboth

no syntactic changes

modifiedflake.lockdiffbeforeafterboth
71 "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",
modifiedflake.nixdiffbeforeafterboth
13 };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;
4450
45 fleetModules.tf = ./modules/extras/tf.nix;51 flakeModules.fleet-tf = ./modules/extras/tf.nix;
4652
47 # Used to test nix-eval bindings53 # Used to test nix-eval bindings
48 testData = {54 testData = {
addedmodules/extras/tf-bootstrap.nixdiffbeforeafterboth

no changes

modifiedmodules/extras/tf.nixdiffbeforeafterboth
18 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 module
24 ];25 ];
35 };36 };
3637
37 config = {38 config = {
39 flake.tf = config.tf;
40
38 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;
50
51 perSystem.imports = [ ./tf-bootstrap.nix ];
47 };52 };
48}53}
4954