Skip to content

Commit

Permalink
Revert "lib/trivial: fix 'error: cannot decode virtual path '/nix/sto…
Browse files Browse the repository at this point in the history
…re/virtual0000000000000000000000005-source''"

This reverts commit b67ee6e.

NixOS#202244

error: a string that refers to a store path cannot be appended to a path, at /etc/nixos/nix/nixos-unstable/lib/sources.nix:193:30

appears to happen when there's a nixpkgs git submodule

> So one of the things that is different for a git submodule is that the .git folder isn't a folder, it's a textfile that contains (in my case) this:

> $ cat nix/nixos-unstable/.git
> gitdir: ../../.git/modules/nixpkgs
  • Loading branch information
Artturin committed Nov 22, 2022
1 parent 671732f commit f0e298c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/trivial.nix
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,8 @@ rec {
# Default value to return if revision can not be determined
default:
let
revisionFile = ./.. + "/.git-revision";
gitRepo = ./.. + "/.git";
revisionFile = "${toString ./..}/.git-revision";
gitRepo = "${toString ./..}/.git";
in if lib.pathIsGitRepo gitRepo
then lib.commitIdFromGitRepo gitRepo
else if lib.pathExists revisionFile then lib.fileContents revisionFile
Expand Down

0 comments on commit f0e298c

Please sign in to comment.