`lib` as flake output?

There is no flake output called lib. How does this work?

You can output arbitrary fields from a Flake, the Schema is not limiting what you can export, see also the last sentence in the output schema:

You can also define additional arbitrary attributes, but these are the outputs that Nix knows about.

However, common Nix tooling usually only looks at the outputs that are in the schema so it’s a good idea to use them when they fit. But if not (like in this case), just define another one.

1 Like

lib is a quasistandard.

And it works because nix is not enforcing anything.

nix flake check did warn for a while, but does nowadays nothing on seeing a lib output anymore.

2 Likes