meta/meeting-notes/2025-04-16_development-notes.md

2.9 KiB

Attendees: @kiara @fricklerhandwerk

let
  fancy-wrapper = go-wild (
    { lib, ... }:
    let
      inherit (lib) mkOption types;
    in
    {
      options = {
        initialUser = mkOption {
          type = types.submodule {
            options = {
            displayName = mkOption {
                type = types.str;
                description = "Display name of the user";
                meta.ui = lib.mkOptionMeta {
                  type = types.uiSchema;
                  value = {
                    title = "Display name";
                  };
                };
            };
      };
    });
in
{
  module-options = fancy-wrapper.module;
  annotations = fancy-wrapper.annotations;
}

The fancy-wrapper would inject a custom lib where module-system-related functions will essentially act as id to preserve the information passed to them. On its outputs it will

  • reconstruct the module specification, throwing away the meta annotations
  • splice out the meta annotations and convert them to regular modules with the appropriate fields

Then, the value of fancy-wrapper.annotations would mirror the stuctrue of the module in the example be equivalent to something along the lines of:

{ lib, ... }
let
  inherit (lib) mkOption types;
in
{
  options = {
    initialUser = {
      displayName = mkOption {
        type = types.uiSchema;
        default = {
          label = "Display name";
        };
      };
    };
  };
}

Matching up the string identifiers could then be done programmatically by a function (supplied with the fancy wrapper library for use within the Nix language), so humans would be out of the loop.