Move setting and builtin documentation that is currently in C++ to .md files; make setting defaults generate C++? #292

Open
opened 2024-05-09 23:15:01 +00:00 by jade · 0 comments
Owner

We currently have a Pawblem: Lix documentation doesn't like to be built in cross, since the documentation needs to be extracted by running a C++ program. This is backwards, we should put the docs into another file, which we have a simple program to generate C++ from (maybe the .gen.hh things, but we actually think we might want more cleverness), and then generate the docs forward from that.

Probably we can use the same kind of machinery and the same python libs as release notes and shove the metadata in yaml front-matter blocks, then generate simple C++ from that, including generating defaults so they don't go out of date?

Concept:

---
name: pre-build-hook
default: ""
default-text: "pre-build-hook is not used by default"
---

If set, the path to a program that can set extra derivation-specific
settings for this system. This is used for settings that can't be
captured by the derivation model itself and are too variable between
different versions of the same system to be hard-coded into nix.

The hook is passed the derivation path and, if sandboxes are
enabled, the sandbox directory. It can then modify the sandbox and
send a series of commands to modify various settings to stdout. The
currently recognized commands are:

- `extra-sandbox-paths`\
  Pass a list of files and directories to be included in the
  sandbox for this build. One entry per line, terminated by an
  empty line. Entries have the same format as `sandbox-paths`.

and then this would be used as:

Setting<std::string> preBuildHook{
#include "settings/pre-build-hook.gen.hh"
};
We currently have a Pawblem: Lix documentation doesn't like to be built in cross, since the documentation needs to be extracted by running a C++ program. This is backwards, we should put the docs into another file, which we have a simple program to generate C++ from (*maybe* the .gen.hh things, but we actually think we might want more cleverness), and then generate the docs forward from that. Probably we can use the same kind of machinery and the same python libs as release notes and shove the metadata in yaml front-matter blocks, then generate simple C++ from that, including generating defaults so they don't go out of date? Concept: ```md --- name: pre-build-hook default: "" default-text: "pre-build-hook is not used by default" --- If set, the path to a program that can set extra derivation-specific settings for this system. This is used for settings that can't be captured by the derivation model itself and are too variable between different versions of the same system to be hard-coded into nix. The hook is passed the derivation path and, if sandboxes are enabled, the sandbox directory. It can then modify the sandbox and send a series of commands to modify various settings to stdout. The currently recognized commands are: - `extra-sandbox-paths`\ Pass a list of files and directories to be included in the sandbox for this build. One entry per line, terminated by an empty line. Entries have the same format as `sandbox-paths`. ``` and then this would be used as: ```c++ Setting<std::string> preBuildHook{ #include "settings/pre-build-hook.gen.hh" }; ```
jade added the
Area/build-packaging
label 2024-05-09 23:15:01 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: lix-project/lix#292
No description provided.