- There is useless ability for use Git submodules with Nix flakes
- It let us built Simula with the query,
.?submodules=1#simula
, from thenix build
command.
- It let us built Simula with the query,
- Then we can choose:
- Creates the Nix derivations from another repository. For now I chose this way.
- Creates the Nix derivations from local source code. The submodules will be replaced to normal source code, if we choose this way.
Creates the Nix derivations from submodules' source code.This way has an problem which will let us built Simula with.?submodules=1#simula
.
I chose this way, because The godot, wlroots, monado and godot-haskell are already in SimulaVR's GitHub repository. I wrote these source code fetching process, by fetchFromGitHub
. This Nix function can be get GitHub repository's source code with the submodules.
src = fetchFromGitHub {
owner = "SimulaVR";
repo = "godot-haskell";
rev = "c4105239909af90758c585d35f2d03f71381fb57";
hash = lib.fakeHash;
};
However, this way has a problem; When we create newer commits, Do we change the commit hashes by hand? If we use this way in the future, My answer is yes. Yes, we must change the commit hashes, BY HAND. 皆思う、とてもめんどうくさいと。(We must think, VERY ANNOYING.)
I didn't choose this way, because there are already some submodules we use in SimulaVR's GitHub repository, and the source code copying is troublesome process & large range of influence for the developers.
However this way has a merit; We can write src
attribute as ./.
When we choose to use SimulaVR's GitHub repository, we must edit the commit hashes (and source's hash. Don't forget!) BY HAND. the ./.
is the path
primitive type1, then we can write as the following. ./.
isn't needed to write source's hash (Of course it isn't needed to write commit hash).
src = ./.;