fix: never attempt to call builtins.storePath in pure evaluation mode

After 5a16547d46, I started getting errors like https://github.com/nix-community/home-manager/issues/2409.

@moduon MT-1075
This commit is contained in:
Jairo Llopis 2023-11-22 11:22:23 +00:00 committed by GitHub
parent 0f9255e01c
commit a46249687a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -109,7 +109,7 @@ let
# Massage `src` into a store path.
if builtins.isPath src
then
if dirOf (toString src) == builtins.storeDir
if builtins ? currentSystem && dirOf (toString src) == builtins.storeDir
then
# If it's already a store path, don't copy it again.
builtins.storePath src