summary refs log tree commit diff
diff options
context:
space:
mode:
authorRobert Hensing <robert@roberthensing.nl>2022-01-05 14:37:28 +0100
committerRobert Hensing <robert@roberthensing.nl>2022-01-22 16:42:08 +0100
commitfecf32505984f4b8feae4c54663f322dcc8bd080 (patch)
treefb89cd30aae928217af213dc31a11dea0dba7c9c
parent15a00be189be329f488986cd72d7315fa643b89a (diff)
downloadnixpkgs-fecf32505984f4b8feae4c54663f322dcc8bd080.tar
nixpkgs-fecf32505984f4b8feae4c54663f322dcc8bd080.tar.gz
nixpkgs-fecf32505984f4b8feae4c54663f322dcc8bd080.tar.bz2
nixpkgs-fecf32505984f4b8feae4c54663f322dcc8bd080.tar.lz
nixpkgs-fecf32505984f4b8feae4c54663f322dcc8bd080.tar.xz
nixpkgs-fecf32505984f4b8feae4c54663f322dcc8bd080.tar.zst
nixpkgs-fecf32505984f4b8feae4c54663f322dcc8bd080.zip
nixos/documentation.nix: Only use store non-flake pkgs.path directly when already copied
-rw-r--r--nixos/modules/misc/documentation.nix8
1 files changed, 7 insertions, 1 deletions
diff --git a/nixos/modules/misc/documentation.nix b/nixos/modules/misc/documentation.nix
index 361815b48d5..59ded4b0188 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