0
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-12 05:16:25 +03:00

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