diff --git a/flake.nix b/flake.nix index f0804f7a..ad424a7e 100644 --- a/flake.nix +++ b/flake.nix @@ -347,16 +347,10 @@ # Nix options docs evaluation (#616). Cheap: pulls in # `nixosOptionsDoc` + the host module's stub eval, no rust or # frontend deps. CI fails fast if a module change breaks - # option declarations or the doc rendering. `docs-host` + - # `docs-agent` are exposed as `packages` outputs (not checks) - # — they share this eval, so building the bundle here covers - # both surfaces in one shot. - docs = - (import ./nix/docs.nix { - inherit pkgs self; - inherit (nixpkgs) lib; - inherit (nixpkgs.lib) nixosSystem; - }).bundle; + # option declarations or the doc rendering. Reuses the + # `packages..docs` derivation so the per-system eval + # of `nix/docs.nix` happens once. + inherit (self.packages.${system}) docs; } ); }; diff --git a/nix/docs.nix b/nix/docs.nix index ba222889..c4427c94 100644 --- a/nix/docs.nix +++ b/nix/docs.nix @@ -90,18 +90,12 @@ let pickSubtrees = options: roots: let - walk = - path: tree: - if path == [ ] then - lib.getAttrFromPath path options - else - lib.setAttrByPath path (lib.getAttrFromPath path tree); pick = path: - let - exists = lib.hasAttrByPath path options; - in - if exists then lib.setAttrByPath path (lib.getAttrFromPath path options) else { }; + if lib.hasAttrByPath path options then + lib.setAttrByPath path (lib.getAttrFromPath path options) + else + { }; in lib.foldl' lib.recursiveUpdate { } (map pick roots);