--- a/cmds/fleet/src/host.rs +++ b/cmds/fleet/src/host.rs @@ -301,8 +301,11 @@ /// Packages for this host, resolved with nixpkgs overlays pub async fn pkgs(&self) -> Result { - let nixos = self.nixos_config().await?; - Ok(nix_go!(nixos._resolvedPkgs)) + let Some(host_config) = &self.host_config else { + bail!("local host has no host_config"); + }; + // TODO: Should nixos.options be cached? + Ok(nix_go!(host_config.nixos.options._module.args.value.pkgs)) } } @@ -395,7 +398,6 @@ pub async fn host(&self, name: &str) -> Result { let config = &self.config_field; let host_config = nix_go!(config.hosts[{ name }]); - Ok(ConfigHost { config: self.clone(), --- a/modules/nixos/meta.nix +++ b/modules/nixos/meta.nix @@ -1,24 +1,8 @@ -{ - lib, - pkgs, - ... -}: let - inherit (lib.options) mkOption; +{lib, ...}: let inherit (lib.modules) mkRemovedOptionModule; in { - options = { - # TODO: Give a real name. - # Previously it was nixpkgs.resolvedPkgs, which was erroreously merged with nixpkgs override attribute. - _resolvedPkgs = mkOption { - type = lib.types.pkgs // {description = "nixpkgs.pkgs";}; - description = "Value of pkgs"; - }; - }; imports = [ (mkRemovedOptionModule ["tags"] "tags are now defined at the host level, not the nixos system level for fast filtering without evaluating unnecessary hosts.") (mkRemovedOptionModule ["network"] "network is now defined at the host level, not the nixos system level") ]; - config = { - _resolvedPkgs = pkgs; - }; }