difftreelog
fix post-refactor
in: trunk
3 files changed
cmds/fleet/src/cmds/secrets/mod.rsdiffbeforeafterboth--- a/cmds/fleet/src/cmds/secrets/mod.rs
+++ b/cmds/fleet/src/cmds/secrets/mod.rs
@@ -167,13 +167,12 @@
let on: String = nix_go_json!(default_generator.impureOn);
let call_package = nix_go!(
- config_field.buildableSystems(Obj {
- localSystem: { config.local_system.clone() },
- })[{ on }]
- .config
- .nixpkgs
- .resolvedPkgs
- .callPackage
+ config_field.hosts[{ on }]
+ .nixosSystem
+ .config
+ .nixpkgs
+ .resolvedPkgs
+ .callPackage
);
let host = config.host(&on).await?;
@@ -486,7 +485,6 @@
}
let config_field = &config.config_unchecked_field;
- let config_field = nix_go!(config_field.configUnchecked);
let field = nix_go!(config_field.sharedSecrets[{ name }]);
let updated = update_owner_set(
@@ -512,7 +510,6 @@
let shared_set = config.list_shared().into_iter().collect::<HashSet<_>>();
for missing in expected_shared_set.difference(&shared_set) {
let config_field = &config.config_unchecked_field;
- let config_field = nix_go!(config_field.configUnchecked);
let secret = nix_go!(config_field.sharedSecrets[{ missing }]);
let expected_owners: Option<Vec<String>> =
nix_go_json!(secret.expectedOwners);
@@ -561,7 +558,6 @@
info!("updating secret: {name}");
let data = config.shared_secret(name)?;
let config_field = &config.config_unchecked_field;
- let config_field = nix_go!(config_field.configUnchecked);
let expected_owners: Vec<String> =
nix_go_json!(config_field.sharedSecrets[{ name }].expectedOwners);
if expected_owners.is_empty() {
cmds/fleet/src/host.rsdiffbeforeafterboth204204205 pub async fn host(&self, name: &str) -> Result<ConfigHost> {205 pub async fn host(&self, name: &str) -> Result<ConfigHost> {206 let config = &self.config_unchecked_field;206 let config = &self.config_unchecked_field;207 let nixos_config = nix_go!(config.configuredSystems[{ name }].config);207 let nixos_config = nix_go!(config.hosts[{ name }].nixosSystem.config);208 Ok(ConfigHost {208 Ok(ConfigHost {209 config: self.clone(),209 config: self.clone(),210 name: name.to_owned(),210 name: name.to_owned(),236 /// Shared secrets configured in fleet.nix or in flake236 /// Shared secrets configured in fleet.nix or in flake237 pub async fn list_configured_shared(&self) -> Result<Vec<String>> {237 pub async fn list_configured_shared(&self) -> Result<Vec<String>> {238 let config_field = &self.config_unchecked_field;238 let config_field = &self.config_unchecked_field;239 nix_go!(config_field.configUnchecked.sharedSecrets)239 nix_go!(config_field.sharedSecrets).list_fields().await240 .list_fields()241 .await242 }240 }299 pub async fn shared_secret_expected_owners(&self, secret: &str) -> Result<Vec<String>> {297 pub async fn shared_secret_expected_owners(&self, secret: &str) -> Result<Vec<String>> {300 let config_field = &self.config_unchecked_field;298 let config_field = &self.config_unchecked_field;301 Ok(nix_go_json!(299 Ok(nix_go_json!(302 config_field.configUnchecked.sharedSecrets[{ secret }].expectedOwners300 config_field.sharedSecrets[{ secret }].expectedOwners303 ))301 ))304 }302 }305303lib/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;
};
};
}