flake-packages are not exported unless they are included.
steps to reproduce:
git clone https://github.com/body20002/denful-flake-packages-not-exported-by-defaultmv modules/system.nix modules/_system.nixnix flake show
the nix flake show output doesn't show the hello package for it to show you'll have to include it
mv modules/_system.nix modules/system.nixnix flake show
I believe this is a bug.
replacing den.schema.flake-packages with den.schema.flake-system seems to work.
Is this intentional?
Thanks for the clear repro, @body20002. You did nothing wrong here, this is a mistake in our docs.
The flake output reference tells you to write den.schema.flake-packages.includes = [ ... ], but flake-packages is not a real schema kind. The registered kinds are flake, flake-system, flake-parts, and default. Since den.schema is freeform, the bad kind is silently accepted and nothing ever resolves to it, so the includes are never walked. It does nothing.
That is why the package only showed up with modules/system.nix present: the host in that file pulled in den.aspects.hello via den.aspects.test.includes. The schema line was never doing the work, the host was. Remove the host and the package disappears.
Your workaround is exactly the intended API:
den.schema.flake-system.includes = [ den.aspects.hello ];
flake-system is instantiated once per system, the included aspect resolves at each per-system scope, and the per-output routes carry the class output to the flake, no host required. Confirmed it exports hello for every system in your repro with system.nix removed.
Doc fix is up in #587.
Thank you for the clarification.