--- 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::>(); 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> = 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 = nix_go_json!(config_field.sharedSecrets[{ name }].expectedOwners); if expected_owners.is_empty() { --- a/cmds/fleet/src/host.rs +++ b/cmds/fleet/src/host.rs @@ -204,7 +204,7 @@ pub async fn host(&self, name: &str) -> Result { 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> { 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 { @@ -299,7 +297,7 @@ pub async fn shared_secret_expected_owners(&self, secret: &str) -> Result> { let config_field = &self.config_unchecked_field; Ok(nix_go_json!( - config_field.configUnchecked.sharedSecrets[{ secret }].expectedOwners + config_field.sharedSecrets[{ secret }].expectedOwners )) } --- 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; }; }; }