namespaceFromDir needs to exist as a backstop in an obscure case:
a service built with lib.builders.derivation consisting entirely of CRDs
whose output will register nothing in `lib.gatherNamespaces`.
I refer, of course, to the Gateway API and `ns/gateway-system`.
The documentation for pkgs.lib.lists.unique warned me that the function
is O(n^2). So I conducted some rather unscientific tests using my own
Kubernetes flake and found no noticeable time penalty:
`rm result && nix-collect-garbage -d && nix build` always took
between 37 and 40 seconds, with or without gatherNamespaces.
But, well, n=10.
Also, make more obvious the flaw in mk.namespaces.
If I prefix something with "N.B." it shouldn't be hidden in the code.
It appears that I'm nearly finished with this README.
It's been a very productive session tonight: I fixed a lot of
indefensible architectural choices, simply by tasking myself with
explaining my own code. An invisible rubber duck, if you will.
Sourcehut supports only plaintext and Markdown for READMEs, but I'm
writing reStructuredText for the first time because I figured all
the hyperlinks would make the text nearly impossible to read.
I can publish the README using a build.sr.ht job, `docutils`, and `hut`:
https://git.xenrox.net/~xenrox/custom-readme/tree/1c4ffcd5/item/.build.yml
module.args still needs them for the builder, but I can finally put to
rest the doubts I had about writing things like `name = "breezewiki";`
in a module into which I could damn well pass that variable.
This interface was getting ridiculous.
`app-template` gets released infrequently enough that keeping a static
`chart.nix` is a small tradeoff for the previous lunacy of passing a
whole derivation tree in through the flake.
`mkDerivation` doesn't have to be assigned beforehand; it can just be
passed two attrsets. I only realized this after writing out its
signature in the documentation.
Also, the example flake in the documentation doesn't use nixpkgs,
so I removed it.
It doesn't make sense for `kubeVersions` to be an _input_ to the module,
i.e., one provided by the Haumea loader. Let it be passed inside the
foldler instead, like `apiVersions`.
En passant, I realized it's as easy to expose apiVersions to user input;
maybe one'd want to specify APIs not installed by this flake.
They were good enough for corralling my disorganized thoughts,
but they hardly rise to the quality befitting their name.
Comments and documentation will suffice.
Wrong check for module-has-extraObjects. `module ? extra` is always
true and leads to failure when evaulating `module.extra.outPath`.
I also missed an `inherit apiVersions` and had to retrofit the
accumulator to include debug output to find that out.