nixos/modules/misc/documentation.nix: Don't use toString on a path

It gives a warning on the lazy-trees branch of Nix
(https://github.com/NixOS/nix/pull/6530) and should generally be
avoided because it causes an unnecessary copy to the store.
This commit is contained in:
Eelco Dolstra 2022-10-28 17:05:03 +02:00
parent 38164d1660
commit 2e860868fe

View file

@ -56,6 +56,7 @@ let
)
pkgSet;
in scrubbedEval.options;
baseOptionsJSON =
let
filter =
@ -67,9 +68,9 @@ let
);
in
pkgs.runCommand "lazy-options.json" {
libPath = filter "${toString pkgs.path}/lib";
pkgsLibPath = filter "${toString pkgs.path}/pkgs/pkgs-lib";
nixosPath = filter "${toString pkgs.path}/nixos";
libPath = filter (pkgs.path + "/lib");
pkgsLibPath = filter (pkgs.path + "/pkgs/pkgs-lib");
nixosPath = filter (pkgs.path + "/nixos");
modules = map (p: ''"${removePrefix "${modulesPath}/" (toString p)}"'') docModules.lazy;
} ''
export NIX_STORE_DIR=$TMPDIR/store
@ -99,6 +100,7 @@ let
exit 1
} >&2
'';
inherit (cfg.nixos.options) warningsAreErrors allowDocBook;
};