33 lines
1 KiB
Nix
33 lines
1 KiB
Nix
# The `hyperhive/hyperhive` repo the offline VM tests put on their forge: one
|
|
# commit holding the source tree of `self`, with a fixed author and date, so its
|
|
# id depends on the tree alone.
|
|
{ pkgs, self }:
|
|
let
|
|
commitEnv = ''
|
|
export HOME=$TMPDIR
|
|
export GIT_AUTHOR_NAME=fixture GIT_AUTHOR_EMAIL=fixture@forge.test
|
|
export GIT_COMMITTER_NAME=fixture GIT_COMMITTER_EMAIL=fixture@forge.test
|
|
export GIT_AUTHOR_DATE="946684800 +0000" GIT_COMMITTER_DATE="946684800 +0000"
|
|
'';
|
|
in
|
|
{
|
|
inherit commitEnv;
|
|
|
|
# `repo.git` (bare, branch `main`) and `rev` (the commit id).
|
|
hyperhiveRepo =
|
|
pkgs.runCommand "hyperhive-fixture-repo"
|
|
{
|
|
nativeBuildInputs = [ pkgs.git ];
|
|
}
|
|
''
|
|
${commitEnv}
|
|
cp -a ${self} work
|
|
chmod -R u+w work
|
|
git -C work init -q -b main
|
|
git -C work add -f .
|
|
git -C work commit -q -m "hyperhive source tree"
|
|
mkdir $out
|
|
git clone -q --bare work $out/repo.git
|
|
git -C work rev-parse HEAD > $out/rev
|
|
'';
|
|
}
|