lib/trivial: fix 'error: cannot decode virtual path '/nix/store/virtual0000000000000000000000005-source''

happens on lazy-trees branch of Nix (NixOS/nix#6530)
This commit is contained in:
Artturin 2022-11-06 06:16:13 +02:00
parent 1f3ebb2bd1
commit b67ee6e861

View File

@ -213,8 +213,8 @@ rec {
# Default value to return if revision can not be determined
default:
let
revisionFile = "${toString ./..}/.git-revision";
gitRepo = "${toString ./..}/.git";
revisionFile = ./.. + "/.git-revision";
gitRepo = ./.. + "/.git";
in if lib.pathIsGitRepo gitRepo
then lib.commitIdFromGitRepo gitRepo
else if lib.pathExists revisionFile then lib.fileContents revisionFile