The formatter uses `devShell.packages` for its path which is not
available when devShell is null. A default value of empty list should be
used when devShell is null.
Using a submodule for devShell removes the need to make every option
nullable and the need to check all of them. By using nullOr submodule,
we can tell if the value has been set and have default values for
options.
This also enables enabling a devShell with no options set.
NixOS build checks significantly slowed down `nix flake show` as it
prints out the derivation names, which for NixOS derivations requires a
large amount of evaluation. By wrapping the derivations, we now give
them trivial names. The NixOS configurations are still built when
running checks as they are a dependency of the wrappers.
In addition to a regular bundler of the form `x: x`, this allows setting
bundler options to a function of the form `pkgs: x: x` which is passed
the package set for the system (for example: `{ hello, ... }: x: hello`
to always return hello). This allows, in particular, an autoloaded
bundler in its own file to access the package set.
This is non-trivial as we must tell `x: x` and `pkgs: x: x` apart.
Fortunately, given some derivation `drv`, `pkgs // drv` is a valid
derivation and a set with attr names matching pkgs. When applying this
to the function, if it returns a derivation, it was of the `x: x` form,
and if it returns a function, it was of the `pkgs: x: x` form.
In order to prevent IFD when evaluating the flake if the bundler is of
form `x: x` and uses IFD, we determine the form and apply pkgs when
applying the bundler instead of during flake evaluation. This is done by
wrapping the bundler.
Of note, we cannot rely on `builtins.functionArgs`, since
`pkgs: { hello, ... }: (x: hello) pkgs` is the same as the inner
function but with args hidden.
This allows a configuration to be set as a function that will be passed
autoloadArgs. This is useful when each configuration is in its own file
when autoloading.
This sets the default devShell using mkDefault, letting user set default
shells override it. Previously, to set a different default shell, one
would have to not set any of the devShell.* options and then define
devShells.default, or use mkForce.
If merge is not set for an option type, it will use the default merge
function; this was not what was intended. Updated the merge values for
options that did not set one to mergeOneOption or mergeEqualOption.
The fact it uses bash is an implementation detail. Update the
documentation to state that the input is a file name glob rather than a
bash case match. Updates the default formatters to not rely on being a
bash case statement.
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.