From fecf32505984f4b8feae4c54663f322dcc8bd080 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Wed, 5 Jan 2022 14:37:28 +0100 Subject: [PATCH] nixos/documentation.nix: Only use store non-flake pkgs.path directly when already copied --- nixos/modules/misc/documentation.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/nixos/modules/misc/documentation.nix b/nixos/modules/misc/documentation.nix index 361815b48d52..59ded4b01888 100644 --- a/nixos/modules/misc/documentation.nix +++ b/nixos/modules/misc/documentation.nix @@ -71,8 +71,14 @@ let # produce separate, smaller store paths # When already in the store, # avoid copying; reuse the whole nixpkgs sources + # + # We can only avoid copying when pkgs.path is already a string. A path + # value can not be converted to a store path without rehashing it. + # builtins.storePath would be a solution but is currently off-limits + # because of https://github.com/NixOS/nix/issues/1888 + # and https://github.com/NixOS/nix/issues/5868 pull = dir: - if isStorePath pkgs.path + if builtins.typeOf pkgs.path == "string" && isStorePath pkgs.path then "${pkgs.path}/${dir}" else filter "${toString pkgs.path}/${dir}"; in