1
1
forked from extern/flakelight
Commit Graph

3 Commits

Author SHA1 Message Date
Archit Gupta
543e3aaa4d Replace nixpkgs nullOr type with custom type
`nullOr`'s merge function requires definitions to all be null or all be
non-null. It was being used where the intent was that null be used as a
value representing unset, and as such the merge should return null if
all definitions are null and ignore nulls otherwise. This adds a type
with that merge semantics.
2024-02-07 01:49:29 -08:00
Archit Gupta
bb0080c21c Fix inconsistency when setting outputs.__functor
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.
2024-01-14 19:22:46 -08:00
Archit Gupta
62083df539 Add functor option for flake's __functor attribute
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.
2023-09-13 21:02:39 -07:00