Comprehensive reference for flake input syntax?

I ended up here

https://nix.dev/manual/nix/2.28/command-ref/new-cli/nix3-flake.html#flake-inputs

Looking for a reference for flake inputs. Unfortunately its only an overview with a smattering of examples. I’m looking for a reference.

For instance, it has this example:

inputs.import-cargo = {
  type = "github";
  owner = "edolstra";
  repo = "import-cargo";
};

And that’s great. But what about gitlab, or other repos? What about more obscure things like

?submodules=1 or rev=?

How about a full reference? What are ALL the possible options for an input, and what are ALL the possible values for each of those?

1 Like

https://nix.dev/manual/nix/2.32/command-ref/new-cli/nix3-flake.html#types

AIUI these are just args passed to fetchTree, so those docs would sort-of cover it. Params seem to be implicitly converted to attrs.

https://nix.dev/manual/nix/2.32/language/builtins.html#source-types

But the actual URL-like syntax is not clearly documented.

2 Likes

This doesn’t perfectly cover the non-url schema either, FWIW, some attributes are undocumented, particularly for those bonus fetcher args. I’ve butted my head against this before, too.

I don’t think a comprehensive reference currently exists. But it’s fine, flakes are still experimental, right?

1 Like