forked from Fediversity/Fediversity
this shows a proof of concept for generating Django forms from NixOS modules
note that the form behavior is still rather clumsy and doesn't exactly map to the module semantics:
- since forms can only be sent wholesale, empty form fields will show up as empty strings
and break validation without additional cleanup (not done here)
- it's not possible to faithfully translate `type = submodule { /* ... */}; default = {};`, since the default
is translated to an empty dict `{}`. this is because the JSON schema converter does not preserve type information.
this can be added by making it use `$defs` [1], but that would likely amount to half a rewrite
- there's a glitch in enum default values that needs to be fixed in `datamodel-code-generator` [0]
[0]:
|
||
---|---|---|
.. | ||
check/basic | ||
default.nix | ||
flake-part.nix | ||
options.nix | ||
README.md |
Deployment
This repository contains work to generate a full Fediversity deployment from a
minimal configuration. This is different from ../services/
that
focuses on one machine, providing a polished and unified interface to different
Fediverse services.