Add support for git inputs

This commit is contained in:
Eelco Dolstra 2020-04-29 13:06:17 +02:00
parent 88dc02caca
commit f012cc5092

View file

@ -23,8 +23,21 @@ let
lastModifiedDate = formatSecondsSinceEpoch info.lastModified;
narHash = info.narHash;
}
else if locked.type == "git" then
{ outPath =
builtins.fetchGit
({ url = locked.url; }
// (if locked ? rev then { inherit (locked) rev; } else {})
// (if locked ? ref then { inherit (locked) ref; } else {})
);
rev = locked.rev;
shortRev = builtins.substring 0 7 locked.rev;
lastModified = info.lastModified;
lastModifiedDate = formatSecondsSinceEpoch info.lastModified;
narHash = info.narHash;
}
else
# FIXME: add Git, Mercurial, tarball inputs.
# FIXME: add Mercurial, tarball inputs.
throw "flake input has unsupported input type '${locked.type}'";
callFlake4 = flakeSrc: locks: