1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-30 06:01:00 +01:00

Add some internal documentation for flake support objects.

This commit is contained in:
Kevin Quick 2020-09-26 14:32:58 -07:00
parent 8b4a542d17
commit bd5328814f
No known key found for this signature in database
GPG key ID: E6D7733599CC0A21
3 changed files with 56 additions and 4 deletions

View file

@ -21,6 +21,13 @@ struct Tree
struct InputScheme;
// The Input object is generated by a specific fetcher, based on the
// user-supplied input attribute in the flake.nix file, and contians
// the information that the specific fetcher needs to perform the
// actual fetch. The Input object is most commonly created via the
// "fromURL()" or "fromAttrs()" static functions which are provided the
// url or attrset specified in the flake file.
struct Input
{
friend struct InputScheme;
@ -82,6 +89,15 @@ public:
std::optional<time_t> getLastModified() const;
};
// The InputScheme represents a type of fetcher. Each fetcher
// registers with nix at startup time. When processing an input for a
// flake, each scheme is given an opportunity to "recognize" that
// input from the url or attributes in the flake file's specification
// and return an Input object to represent the input if it is
// recognized. The Input object contains the information the fetcher
// needs to actually perform the "fetch()" when called.
struct InputScheme
{
virtual std::optional<Input> inputFromURL(const ParsedURL & url) = 0;