diff --git a/lib/strings.nix b/lib/strings.nix index d48624257cf..1cc633c729d 100644 --- a/lib/strings.nix +++ b/lib/strings.nix @@ -438,8 +438,13 @@ rec { => true isStorePath pkgs.python => true + isStorePath [] || isStorePath 42 || isStorePath {} || … + => false */ - isStorePath = x: builtins.substring 0 1 (toString x) == "/" && dirOf (builtins.toPath x) == builtins.storeDir; + isStorePath = x: + builtins.isString x + && builtins.substring 0 1 (toString x) == "/" + && dirOf (builtins.toPath x) == builtins.storeDir; /* Convert string to int Obviously, it is a bit hacky to use fromJSON that way.