Previously null was used when a value could not be loaded. This
prevented setting a value to null using a nixDir auto-load.
This change removes the use of null as a special value when loading from
nixDir, allowing it to be used as a normal value.
This removes the manual configuration of which options are auto-loaded.
Now all options are eligible except for "nixDir" and "_module" as those
would cause inf recursions.
Additionally, instead of setting name aliases in the nixDir module, a
config option is added, enabling other modules to extend the aliases
lists.
Many attributes can take moduleArgs when auto-loaded in order to
facilitate access to them from other files. Those same attributes could
not take moduleArgs when included directly, which was inconsistent.
With this change, all attributes that could take moduleArgs when
auto-loaded can now always do so. Auto-loading no longer needs special
cases.
This edge case was inconsistent between setting outputs directly and
auto-loading. Setting directly did not support args, so just merged
sets, thus resulting in a __functor flake output. When autoloading, a
set with a __functor attr was treated as a function and passed module
args.
To correct this inconsistency, outputs now always supports taking args,
and has the autoloading behavior.
Code that relied on previous behavior is easy to fix, as the value needs
to be converted to a function, which can then return the set with
__functor.
Previously, devShell was inconsistent when setting it to a function.
When setting directly, a function was assumed to be a package definition
and was used to set devShells.default directly. When auto-loading, a
function was assumed to take module args, and result in config (not a
derivation).
This now enables both behaviors in either case by detecting if a
function is a package definition or if it expects module args and
handling it accordingly.
The set of args passed to modules is useful for more than just
autoloading. This renames it appropriately and makes it available
through pkgs arguments as well.
This allows for conveniently making flakes callable.
Setting this is expected to be uncommon in general, but having the
option is useful as flakelight module flakes can use this to reduce the
boilerplate in using them.