Skip to content

All options should have types #76184

@dasJ

Description

@dasJ

Describe the bug

To make the usage of options and errors more clear, every option should have a type.
Currently, more than 300 199 151 117 27 20 18 options don't have a type.

To Reproduce
Steps to reproduce the behavior:

Details
let
  config = { };
  pkgs = import ./. {};
  lib = import ./lib;

  scrubDerivations = namePrefix: pkgSet: lib.mapAttrs
    (name: value:
      let wholeName = "${namePrefix}.${name}"; in
      if lib.isAttrs value then
        scrubDerivations wholeName value
        // (lib.optionalAttrs (lib.isDerivation value) { outPath = "\${${wholeName}}"; })
      else value
    )
    pkgSet;

  scrubbedEval = lib.evalModules {
    modules = import ./nixos/modules/module-list.nix;
    specialArgs = {
      pkgs = scrubDerivations "pkgs" pkgs;
    };
  };

  manual = import ./nixos/doc/manual {
    inherit config pkgs;
    inherit (scrubbedEval) options;
    version = "master";
    revision = "master";
  };
in manual.optionsJSON
jsonFile="$(NIX_PATH='' nix-build types.nix)/share/doc/nixos/options.json"
jq -r 'to_entries[] | select(.value.type == "unspecified") | [ "`" + .key + "`", "[" + .value.declarations[0] + "](../blob/master/" + .value.declarations[0] + ")" ] | join(" - ")' < "${jsonFile}" | sed 's/^\(.*\)$/- [ ] \1/g'

Expected behavior

All options should have a type.

Additional context

Options without types:

Metadata

Metadata

Assignees

No one assigned

    Labels

    0.kind: bugSomething is broken6.topic: nixosIssues or PRs affecting NixOS modules, or package usability issues specific to NixOS
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions