git.delta.rocks / jrsonnet / refs/commits / 718d88b1fcc6

difftreelog

fix post-refactor

Yaroslav Bolyukin2024-01-01parent: #d0d2d55.patch.diff
in: trunk

3 files changed

modifiedcmds/fleet/src/cmds/secrets/mod.rsdiffbeforeafterboth
167167
168 let on: String = nix_go_json!(default_generator.impureOn);168 let on: String = nix_go_json!(default_generator.impureOn);
169 let call_package = nix_go!(169 let call_package = nix_go!(
170 config_field.buildableSystems(Obj {170 config_field.hosts[{ on }]
171 localSystem: { config.local_system.clone() },171 .nixosSystem
172 })[{ on }]
173 .config172 .config
174 .nixpkgs173 .nixpkgs
175 .resolvedPkgs174 .resolvedPkgs
486 }485 }
487486
488 let config_field = &config.config_unchecked_field;487 let config_field = &config.config_unchecked_field;
489 let config_field = nix_go!(config_field.configUnchecked);
490 let field = nix_go!(config_field.sharedSecrets[{ name }]);488 let field = nix_go!(config_field.sharedSecrets[{ name }]);
491489
492 let updated = update_owner_set(490 let updated = update_owner_set(
512 let shared_set = config.list_shared().into_iter().collect::<HashSet<_>>();510 let shared_set = config.list_shared().into_iter().collect::<HashSet<_>>();
513 for missing in expected_shared_set.difference(&shared_set) {511 for missing in expected_shared_set.difference(&shared_set) {
514 let config_field = &config.config_unchecked_field;512 let config_field = &config.config_unchecked_field;
515 let config_field = nix_go!(config_field.configUnchecked);
516 let secret = nix_go!(config_field.sharedSecrets[{ missing }]);513 let secret = nix_go!(config_field.sharedSecrets[{ missing }]);
517 let expected_owners: Option<Vec<String>> =514 let expected_owners: Option<Vec<String>> =
518 nix_go_json!(secret.expectedOwners);515 nix_go_json!(secret.expectedOwners);
561 info!("updating secret: {name}");558 info!("updating secret: {name}");
562 let data = config.shared_secret(name)?;559 let data = config.shared_secret(name)?;
563 let config_field = &config.config_unchecked_field;560 let config_field = &config.config_unchecked_field;
564 let config_field = nix_go!(config_field.configUnchecked);
565 let expected_owners: Vec<String> =561 let expected_owners: Vec<String> =
566 nix_go_json!(config_field.sharedSecrets[{ name }].expectedOwners);562 nix_go_json!(config_field.sharedSecrets[{ name }].expectedOwners);
567 if expected_owners.is_empty() {563 if expected_owners.is_empty() {
modifiedcmds/fleet/src/host.rsdiffbeforeafterboth
--- a/cmds/fleet/src/host.rs
+++ b/cmds/fleet/src/host.rs
@@ -204,7 +204,7 @@
 
 	pub async fn host(&self, name: &str) -> Result<ConfigHost> {
 		let config = &self.config_unchecked_field;
-		let nixos_config = nix_go!(config.configuredSystems[{ name }].config);
+		let nixos_config = nix_go!(config.hosts[{ name }].nixosSystem.config);
 		Ok(ConfigHost {
 			config: self.clone(),
 			name: name.to_owned(),
@@ -236,9 +236,7 @@
 	/// Shared secrets configured in fleet.nix or in flake
 	pub async fn list_configured_shared(&self) -> Result<Vec<String>> {
 		let config_field = &self.config_unchecked_field;
-		nix_go!(config_field.configUnchecked.sharedSecrets)
-			.list_fields()
-			.await
+		nix_go!(config_field.sharedSecrets).list_fields().await
 	}
 	/// Shared secrets configured in fleet.nix
 	pub fn list_shared(&self) -> Vec<String> {
@@ -299,7 +297,7 @@
 	pub async fn shared_secret_expected_owners(&self, secret: &str) -> Result<Vec<String>> {
 		let config_field = &self.config_unchecked_field;
 		Ok(nix_go_json!(
-			config_field.configUnchecked.sharedSecrets[{ secret }].expectedOwners
+			config_field.sharedSecrets[{ secret }].expectedOwners
 		))
 	}
 
modifiedlib/default.nixdiffbeforeafterboth
--- a/lib/default.nix
+++ b/lib/default.nix
@@ -22,7 +22,7 @@
         ++ [
           data
           ({...}: {
-            inherit globalModules hosts;
+            inherit globalModules hosts overlays;
           })
         ]
         ++ modules;
@@ -39,7 +39,6 @@
       root,
       data,
     }: {
-      configuredHosts = root.config.hosts;
       config = root.config;
     };
     defaultData = withData {
@@ -49,9 +48,9 @@
     uncheckedData = withData {inherit data root;};
   in {
     inherit nixpkgs overlays;
-    inherit (defaultData) configuredHosts configuredSystems config buildableSystems;
+    inherit (defaultData) config;
     unchecked = {
-      inherit (uncheckedData) configuredHosts configuredSystems config buildableSystems;
+      inherit (uncheckedData) config;
     };
   };
 }