flakelight/builtinModules
Archit Gupta ff24d5d433 Allow bundlers to be functions that take pkgs
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.
2023-11-06 23:13:47 -08:00
..
apps.nix Rename project from flakelite to flakelight 2023-08-26 22:48:57 -07:00
builtinFormatters.nix Clarify use of formatter option 2023-09-16 20:59:54 -07:00
builtinOverlay.nix Add statix check to flakelight flake 2023-09-04 16:59:59 -07:00
bundlers.nix Allow bundlers to be functions that take pkgs 2023-11-06 23:13:47 -08:00
checks.nix Rename project from flakelite to flakelight 2023-08-26 22:48:57 -07:00
core.nix Fix inf recursions in computing default package's name 2023-08-27 13:57:16 -07:00
devShells.nix Allow overriding of default devShell 2023-10-18 20:04:16 -07:00
editorconfig.nix Rename project from flakelite to flakelight 2023-08-26 22:48:57 -07:00
flakelightModules.nix Add options for flakelight modules 2023-08-26 22:57:59 -07:00
formatter.nix Have formatters for each file run in parallel 2023-08-28 19:57:26 -07:00
functor.nix Add functor option for flake's __functor attribute 2023-09-13 21:02:39 -07:00
homeConfigurations.nix Allow functions for NixOS or home-manager configurations 2023-10-23 20:25:38 -07:00
homeModules.nix Rename project from flakelite to flakelight 2023-08-26 22:48:57 -07:00
lib.nix Add lib option 2023-09-13 23:17:17 -07:00
nixDir.nix Add support for bundlers 2023-11-05 15:14:26 -08:00
nixosConfigurations.nix Allow functions for NixOS or home-manager configurations 2023-10-23 20:25:38 -07:00
nixosModules.nix Rename project from flakelite to flakelight 2023-08-26 22:48:57 -07:00
overlays.nix Add option for extending default overlay 2023-08-26 23:46:37 -07:00
packages.nix Fix inf recursions in computing default package's name 2023-08-27 13:57:16 -07:00
templates.nix Fix merge function for custom option types 2023-10-18 20:02:24 -07:00