I create my own repository to get some git source.
with (import <nixpkgs> {});
rec {
rustcSource = fetchgit {
url = https://github.com/rust-lang/rust;
rev = "3191fbae9da539442351f883bdabcad0d72efcb6";
sha256 = "0w1l14kz9kxyj5dw3w9xxk1fzww5xqs3sf8saay0mh7nkmvrdb59";
};
}
Then I build rustcSource,
sudo nix-env -f package.nix -A rustcSource
Shows the storage path /nix/store/096fpy9qjbz5r14aadjnq9d2md9ql9cg-rust-3191fba. The problem is that I forgot to load its submodules, so I change my expression to include submodules,
with (import <nixpkgs> {});
rec {
rustcSource = fetchgit {
url = https://github.com/rust-lang/rust;
rev = "3191fbae9da539442351f883bdabcad0d72efcb6";
sha256 = "0w1l14kz9kxyj5dw3w9xxk1fzww5xqs3sf8saay0mh7nkmvrdb59";
leaveDotGit = true;
fetchSubmodules = true;
};
}
But I found that I nix-builddid not recalculate the hash and did not see that the path was built. Thus, it does not load submodules.
Q: Is this a nix error? How can I rebuild or reload the repository?
PS Actually, I create output with fetchgit in it, but it fails because the submodules are not loading. So the above case simplifies my problem.
source
share